Sha256: 2f89097a545be80e20ff698287fb0e3e5f5e4b06a1aa6d4b7f573f82ead92a7b

Contents?: true

Size: 1.22 KB

Versions: 17

Compression:

Stored size: 1.22 KB

Contents

require File.dirname(__FILE__) + '/../../spec_helper'
require 'cucumber/rb_support/rb_language'

module Cucumber
    describe 'Pending' do

      before(:each) do
        l = RbSupport::RbLanguage.new(StepMother.new)
        l.begin_rb_scenario(mock('scenario', :null_object => true))
        @world = l.current_world
      end

      it 'should raise a Pending if no block is supplied' do
        lambda {
          @world.pending "TODO"
        }.should raise_error(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(Pending, /TODO/)
      end

      it 'should raise a Pending if a supplied block fails as expected with a mock' do
        lambda {
          @world.pending "TODO" do
            m = mock('thing')
            m.should_receive(:foo)
            m.rspec_verify
          end
        }.should raise_error(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(Pending, /TODO/)
      end

    end
end

Version data entries

17 entries across 17 versions & 5 rubygems

Version Path
davidtrogers-cucumber-0.6.2 spec/cucumber/world/pending_spec.rb
cucumber-0.6.2 spec/cucumber/world/pending_spec.rb
cucumber-0.6.1 spec/cucumber/world/pending_spec.rb
cucumber-0.6.0 spec/cucumber/world/pending_spec.rb
cucumber-0.5.3 spec/cucumber/world/pending_spec.rb
cucumber-0.5.2 spec/cucumber/world/pending_spec.rb
cucumber-0.5.1 spec/cucumber/world/pending_spec.rb
cucumber-0.5.0 spec/cucumber/world/pending_spec.rb
cucumber-0.4.5.rc2 spec/cucumber/world/pending_spec.rb
kbaum-cucumber-0.4.5.pre spec/cucumber/world/pending_spec.rb
cucumber-0.4.5.rc1 spec/cucumber/world/pending_spec.rb
middleman-0.10.17 vendor/gems/gems/cucumber-0.4.4/spec/cucumber/world/pending_spec.rb
middleman-0.10.16 vendor/gems/gems/cucumber-0.4.4/spec/cucumber/world/pending_spec.rb
middleman-0.10.15 vendor/gems/gems/cucumber-0.4.4/spec/cucumber/world/pending_spec.rb
rackjour-0.1.8 vendor/gems/gems/cucumber-0.4.4/spec/cucumber/world/pending_spec.rb
middleman-0.10.14 vendor/gems/gems/cucumber-0.4.4/spec/cucumber/world/pending_spec.rb
cucumber-0.4.4 spec/cucumber/world/pending_spec.rb