Sha256: e05a8890a0969eacdfe5786ea4d057e7f818e108c1d4b5cef34c18e9f942f135

Contents?: true

Size: 1.36 KB

Versions: 21

Compression:

Stored size: 1.36 KB

Contents

require 'spec_helper'
require 'cucumber/wire_support/wire_language'

module Cucumber
  module WireSupport
    describe WireLanguage do
      def stub_wire_file!(filename, config)
        Configuration.stub(:from_file).with(filename).and_return config
      end

      describe "#load_code_file" do
        before(:each) do
          stub_wire_file! 'foo.wire', :config
        end

        it "creates a RemoteSteps object" do
          Connection.should_receive(:new).with(:config)
          WireLanguage.new(nil).load_code_file('foo.wire')
        end
      end

      describe "#step_matches" do
        def stub_remote_steps!(config, attributes)
          Connection.should_receive(:new).
            with(config).
            and_return( double('remote_steps', attributes) )
        end

        before(:each) do
          stub_wire_file! 'one.wire', :config_one
          stub_wire_file! 'two.wire', :config_two
        end

        it "should return the matches from each of the RemoteSteps" do
          stub_remote_steps! :config_one, :step_matches => [:a, :b]
          stub_remote_steps! :config_two, :step_matches => [:c]

          wire_language = WireLanguage.new(nil)
          wire_language.load_code_file('one.wire')
          wire_language.load_code_file('two.wire')

          wire_language.step_matches('','').should == [:a, :b, :c]
        end
      end
    end
  end
end

Version data entries

21 entries across 19 versions & 2 rubygems

Version Path
honeybadger-2.4.0 vendor/gems/ruby/1.9.1/gems/cucumber-1.3.18/spec/cucumber/wire_support/wire_language_spec.rb
honeybadger-2.4.0 vendor/gems/ruby/2.2.0/gems/cucumber-1.3.18/spec/cucumber/wire_support/wire_language_spec.rb
honeybadger-2.4.0 vendor/gems/ruby/2.1.0/gems/cucumber-1.3.16/spec/cucumber/wire_support/wire_language_spec.rb
cucumber-1.3.20 spec/cucumber/wire_support/wire_language_spec.rb
cucumber-1.3.19 spec/cucumber/wire_support/wire_language_spec.rb
cucumber-1.3.18 spec/cucumber/wire_support/wire_language_spec.rb
cucumber-1.3.17 spec/cucumber/wire_support/wire_language_spec.rb
cucumber-1.3.16 spec/cucumber/wire_support/wire_language_spec.rb
cucumber-1.3.15 spec/cucumber/wire_support/wire_language_spec.rb
cucumber-1.3.14 spec/cucumber/wire_support/wire_language_spec.rb
cucumber-1.3.13 spec/cucumber/wire_support/wire_language_spec.rb
cucumber-1.3.12 spec/cucumber/wire_support/wire_language_spec.rb
cucumber-1.3.11 spec/cucumber/wire_support/wire_language_spec.rb
cucumber-1.3.10 spec/cucumber/wire_support/wire_language_spec.rb
cucumber-1.3.9 spec/cucumber/wire_support/wire_language_spec.rb
cucumber-1.3.8 spec/cucumber/wire_support/wire_language_spec.rb
cucumber-1.3.7 spec/cucumber/wire_support/wire_language_spec.rb
cucumber-1.3.6 spec/cucumber/wire_support/wire_language_spec.rb
cucumber-1.3.5 spec/cucumber/wire_support/wire_language_spec.rb
cucumber-1.3.4 spec/cucumber/wire_support/wire_language_spec.rb