All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.oneeyedmen.okeydoke.junit.ApprovalsRule Maven / Gradle / Ivy

There is a newer version: 2.0.3
Show newest version
package com.oneeyedmen.okeydoke.junit;

import com.oneeyedmen.okeydoke.Approver;
import com.oneeyedmen.okeydoke.ApproverFactories;
import com.oneeyedmen.okeydoke.ApproverFactory;
import com.oneeyedmen.okeydoke.Transcript;

import java.io.File;

/**
 * Use as an @Rule to automate approvals in JUnit.
 */
public class ApprovalsRule extends BaseApprovalsRule {

    public static ApprovalsRule fileSystemRule(String sourceRoot) {
        return new ApprovalsRule(ApproverFactories.fileSystemApproverFactory(new File(sourceRoot)));
    }

    public static ApprovalsRule streamingFileSystemRule(String sourceRoot) {
        return new ApprovalsRule(ApproverFactories.streamingApproverFactory(new File(sourceRoot)));
    }

    public static ApprovalsRule classPathRule(String actualRoot) {
        return new ApprovalsRule(ApproverFactories.classPathApproverFactory(new File(actualRoot)));
    }

    public ApprovalsRule(ApproverFactory factory) {
        super(factory);
    }

    public Transcript transcript() {
        return approver().transcript();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy