Sha256: 6455a5cb084ef7c086f049912b5431a814b6750066798fe113d2f5e0cfb7ff6c

Contents?: true

Size: 1.28 KB

Versions: 14

Compression:

Stored size: 1.28 KB

Contents

require File.expand_path(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(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 mock' do
        lambda {
          @world.pending "TODO" do
            m = mock('thing')
            m.should_receive(:foo)
            m.rspec_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

14 entries across 14 versions & 1 rubygems

Version Path
cucumber-0.7.3 spec/cucumber/world/pending_spec.rb
cucumber-0.7.2 spec/cucumber/world/pending_spec.rb
cucumber-0.7.1 spec/cucumber/world/pending_spec.rb
cucumber-0.7.0 spec/cucumber/world/pending_spec.rb
cucumber-0.7.0.beta.8 spec/cucumber/world/pending_spec.rb
cucumber-0.7.0.beta.7 spec/cucumber/world/pending_spec.rb
cucumber-0.7.0.beta.6 spec/cucumber/world/pending_spec.rb
cucumber-0.7.0.beta.5 spec/cucumber/world/pending_spec.rb
cucumber-0.7.0.beta.4 spec/cucumber/world/pending_spec.rb
cucumber-0.7.0.beta.3 spec/cucumber/world/pending_spec.rb
cucumber-0.7.0.beta.2 spec/cucumber/world/pending_spec.rb
cucumber-0.7.0.beta.1 spec/cucumber/world/pending_spec.rb
cucumber-0.6.4 spec/cucumber/world/pending_spec.rb
cucumber-0.6.3 spec/cucumber/world/pending_spec.rb