Sha256: 7396838dbe4773bb41bea75860c67f2c614f2b809d440e9d56e5d4731c317594

Contents?: true

Size: 1.22 KB

Versions: 45

Compression:

Stored size: 1.22 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(mock('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 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

45 entries across 43 versions & 9 rubygems

Version Path
candlepin-api-0.4.0 bundle/ruby/1.9.1/gems/cucumber-1.2.1/spec/cucumber/world/pending_spec.rb
candlepin-api-0.4.0 bundle/ruby/1.8/gems/cucumber-1.2.1/spec/cucumber/world/pending_spec.rb
candlepin-api-0.4.0 bundle/ruby/gems/cucumber-1.2.1/spec/cucumber/world/pending_spec.rb
cucumber-1.3.2 spec/cucumber/world/pending_spec.rb
librarian-puppet-0.9.9 vendor/gems/ruby/1.9.1/gems/cucumber-1.2.1/spec/cucumber/world/pending_spec.rb
cucumber-1.3.1 spec/cucumber/world/pending_spec.rb
cucumber-1.3.0 spec/cucumber/world/pending_spec.rb
cucumber-1.2.5 spec/cucumber/world/pending_spec.rb
cucumber-1.2.3 spec/cucumber/world/pending_spec.rb
cucumber-1.2.2 spec/cucumber/world/pending_spec.rb
librarian-puppet-0.9.8 vendor/gems/ruby/1.9.1/gems/cucumber-1.2.1/spec/cucumber/world/pending_spec.rb
librarian-puppet-0.9.4 vendor/gems/ruby/1.8/gems/cucumber-1.2.1/spec/cucumber/world/pending_spec.rb
casecumber-1.0.2.1 spec/cucumber/world/pending_spec.rb
casecumber-1.2.1.cb2 spec/cucumber/world/pending_spec.rb
librarian-puppet-0.9.3 vendor/gems/ruby/1.8/gems/cucumber-1.2.1/spec/cucumber/world/pending_spec.rb
cucumber-1.2.1 spec/cucumber/world/pending_spec.rb
resque-pool-0.3.0 vendor/bundle/ruby/1.8/gems/cucumber-1.1.9/spec/cucumber/world/pending_spec.rb
ftl-0.2.0 vendor/bundle/gems/cucumber-1.2.0/spec/cucumber/world/pending_spec.rb
cucumber-1.2.0 spec/cucumber/world/pending_spec.rb
frameworks-capybara-0.2.0.rc6 vendor/bundle/ruby/1.8/gems/cucumber-1.1.9/spec/cucumber/world/pending_spec.rb