Sha256: 162b7cab5517819c335f3099caee1f266ee6163178f5f79d94b95c0d33e90156

Contents?: true

Size: 1.23 KB

Versions: 21

Compression:

Stored size: 1.23 KB

Contents

require 'spec_helper'
require 'cucumber/rb_support/rb_language'

module Cucumber
    describe 'Pending' do

      before(:each) do
        l = RbSupport::RbLanguage.new(Runtime.new)
        l.begin_rb_scenario(double('scenario').as_null_object)
        @world = l.current_world
      end

      it 'should raise a Pending if no block is supplied' do
        lambda {
          @world.pending "TODO"
        }.should raise_error(Cucumber::Pending, /TODO/)
      end

      it 'should raise a Pending if a supplied block fails as expected' do
        lambda {
          @world.pending "TODO" do
            raise "oops"
          end
        }.should raise_error(Cucumber::Pending, /TODO/)
      end

      it 'should raise a Pending if a supplied block fails as expected with a double' do
        lambda {
          @world.pending "TODO" do
            m = double('thing')
            m.should_receive(:foo)
            RSpec::Mocks.verify
          end
        }.should raise_error(Cucumber::Pending, /TODO/)
      end

      it 'should raise a Pending if a supplied block starts working' do
        lambda {
          @world.pending "TODO" do
            # success!
          end
        }.should raise_error(Cucumber::Pending, /TODO/)
      end

    end
end

Version data entries

21 entries across 19 versions & 2 rubygems

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