Sha256: f99194b37b14e3f644e6ab4e6b53a74437d16861b0fdc75397e4f58c6a18a965

Contents?: true

Size: 1.38 KB

Versions: 52

Compression:

Stored size: 1.38 KB

Contents

require 'spec_helper'

module Cucumber
describe Runtime do
  subject { Runtime.new(options) }
  let(:options)     { {} }
  
  describe "#features_paths" do
    let(:options) { {:paths => ['foo/bar/baz.feature', 'foo/bar/features/baz.feature', 'other_features'] } }
    it "returns the value from configuration.paths" do
      subject.features_paths.should == options[:paths]
    end
  end
  
  describe "#configure" do
    let(:support_code)      { double(Runtime::SupportCode).as_null_object }
    let(:results)           { double(Runtime::Results).as_null_object     }
    let(:new_configuration) { double('New configuration')}
    before(:each) do
      Runtime::SupportCode.stub(:new => support_code)
      Runtime::Results.stub(:new => results)
    end
    
    it "tells the support_code and results about the new configuration" do
      support_code.should_receive(:configure).with(new_configuration)
      results.should_receive(:configure).with(new_configuration)
      subject.configure(new_configuration)
    end
    
    it "replaces the existing configuration" do
      # not really sure how to test this. Maybe we should just expose 
      # Runtime#configuration with an attr_reader?
      some_new_paths = ['foo/bar', 'baz']
      new_configuration.stub(:paths => some_new_paths)
      subject.configure(new_configuration)
      subject.features_paths.should == some_new_paths
    end
  end
  
end
end

Version data entries

52 entries across 50 versions & 11 rubygems

Version Path
cucumber-1.1.9 spec/cucumber/runtime_spec.rb
cucumber-1.1.8 spec/cucumber/runtime_spec.rb
cucumber-1.1.7 spec/cucumber/runtime_spec.rb
cucumber-1.1.6 spec/cucumber/runtime_spec.rb
cucumber-1.1.5 spec/cucumber/runtime_spec.rb
cucumber-1.1.4 spec/cucumber/runtime_spec.rb
cucumber-1.1.3 spec/cucumber/runtime_spec.rb
cucumber-1.1.2 spec/cucumber/runtime_spec.rb
cucumber-1.1.1 spec/cucumber/runtime_spec.rb
js-log-cucumber-1.0.2 spec/cucumber/runtime_spec.rb
cucumber-1.1.0 spec/cucumber/runtime_spec.rb
cucumber-1.0.6 spec/cucumber/runtime_spec.rb
cucumber-1.0.5 spec/cucumber/runtime_spec.rb
cucumber-1.0.4 spec/cucumber/runtime_spec.rb
cucumber-1.0.3 spec/cucumber/runtime_spec.rb
cucumber-1.0.2 spec/cucumber/runtime_spec.rb
cucumber-1.0.1 spec/cucumber/runtime_spec.rb
cucumber-1.0.0 spec/cucumber/runtime_spec.rb
cucumber-0.10.7 spec/cucumber/runtime_spec.rb
cucumber-0.10.6 spec/cucumber/runtime_spec.rb