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
candlepin-api-0.4.0 bundle/ruby/1.9.1/gems/cucumber-1.2.1/spec/cucumber/runtime_spec.rb
candlepin-api-0.4.0 bundle/ruby/1.8/gems/cucumber-1.2.1/spec/cucumber/runtime_spec.rb
candlepin-api-0.4.0 bundle/ruby/gems/cucumber-1.2.1/spec/cucumber/runtime_spec.rb
librarian-puppet-0.9.9 vendor/gems/ruby/1.9.1/gems/cucumber-1.2.1/spec/cucumber/runtime_spec.rb
librarian-puppet-0.9.8 vendor/gems/ruby/1.9.1/gems/cucumber-1.2.1/spec/cucumber/runtime_spec.rb
librarian-puppet-0.9.4 vendor/gems/ruby/1.8/gems/cucumber-1.2.1/spec/cucumber/runtime_spec.rb
casecumber-1.0.2.1 spec/cucumber/runtime_spec.rb
casecumber-1.2.1.cb2 spec/cucumber/runtime_spec.rb
librarian-puppet-0.9.3 vendor/gems/ruby/1.8/gems/cucumber-1.2.1/spec/cucumber/runtime_spec.rb
cucumber-1.2.1 spec/cucumber/runtime_spec.rb
resque-pool-0.3.0 vendor/bundle/ruby/1.8/gems/cucumber-1.1.9/spec/cucumber/runtime_spec.rb
ftl-0.2.0 vendor/bundle/gems/cucumber-1.2.0/spec/cucumber/runtime_spec.rb
cucumber-1.2.0 spec/cucumber/runtime_spec.rb
frameworks-capybara-0.2.0.rc6 vendor/bundle/ruby/1.8/gems/cucumber-1.1.9/spec/cucumber/runtime_spec.rb
frameworks-capybara-0.2.0.rc5 vendor/bundle/ruby/1.8/gems/cucumber-1.1.9/spec/cucumber/runtime_spec.rb
frameworks-capybara-0.2.0.rc4 vendor/bundle/ruby/1.8/gems/cucumber-1.1.9/spec/cucumber/runtime_spec.rb
frameworks-capybara-0.2.0.rc3 vendor/bundle/ruby/1.8/gems/cucumber-1.1.9/spec/cucumber/runtime_spec.rb
frameworks-capybara-0.2.0.rc2 vendor/bundle/ruby/1.8/gems/cucumber-1.1.9/spec/cucumber/runtime_spec.rb
resque-pool-0.3.0.beta.2 vendor/bundle/ruby/1.8/gems/cucumber-1.1.9/spec/cucumber/runtime_spec.rb
radiant-1.0.0 ruby-debug/ruby/1.8/gems/cucumber-1.1.9/spec/cucumber/runtime_spec.rb