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-0.10.5 spec/cucumber/runtime_spec.rb
cucumber-0.10.3 spec/cucumber/runtime_spec.rb
cucumber-0.10.2 spec/cucumber/runtime_spec.rb
cucumber-0.10.1 spec/cucumber/runtime_spec.rb
stefl-cucumber-0.10.1 spec/cucumber/runtime_spec.rb
vim-jar-0.1.2.0001 bundler/ruby/1.8/gems/cucumber-0.9.4/spec/cucumber/runtime_spec.rb
vim-jar-0.1.2 bundler/ruby/1.8/gems/cucumber-0.9.4/spec/cucumber/runtime_spec.rb
vim-jar-0.1.1 bundler/ruby/1.8/gems/cucumber-0.9.4/spec/cucumber/runtime_spec.rb
vim-jar-0.1.0 bundler/ruby/1.8/gems/cucumber-0.9.4/spec/cucumber/runtime_spec.rb
cucumber-0.10.0 spec/cucumber/runtime_spec.rb
cucumber-0.9.4 spec/cucumber/runtime_spec.rb
cucumber-0.9.3 spec/cucumber/runtime_spec.rb