Sha256: 3de4b909d13c07d72e674e1847b6500b49abf1670b57168de4f76ffe6829d6bf

Contents?: true

Size: 1.03 KB

Versions: 1

Compression:

Stored size: 1.03 KB

Contents

require_relative "./helpers"

describe BigBench::Configuration do
  
  it "should store the config values" do
    
    BigBench.configure = {
      :duration => 10.seconds,
      :output   => "test.ljson",
      :threads  => 20
    }
    
    BigBench.config.duration.should == 10.seconds
    BigBench.config.output.should == "test.ljson"
    BigBench.config.threads.should == 20
    
  end
  
  it "should allow to set options seperately" do
    BigBench.config.duration = 5.seconds
    BigBench.config.duration.should == 5.seconds
  end
  
  it "should check the minimal options" do
    BigBench.config.should_not be_valid
    
    BigBench.configure = {
      :duration => 10.seconds,
      :output   => "test.ljson",
      :threads  => 20
    }
    BigBench.config.should be_valid
  end
  
  it "should allow to check the validity of the config" do
    lambda {BigBench.check_config!}.should raise_error(BigBench::Configuration::InvalidOptions, "At least: #{BigBench::Configuration::Config::VALIDATE_OPTIONS.join(', ')} are required")
  end
  
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
bigbench-0.0.1 spec/configure_spec.rb