Sha256: 3e406459cae5f2f23816391168c628bc997bb9d52a32f4c11b4b727bc88e8879

Contents?: true

Size: 1.27 KB

Versions: 17

Compression:

Stored size: 1.27 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(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

17 entries across 17 versions & 3 rubygems

Version Path
cucumber-0.10.7 spec/cucumber/world/pending_spec.rb
cucumber-0.10.6 spec/cucumber/world/pending_spec.rb
cucumber-0.10.5 spec/cucumber/world/pending_spec.rb
cucumber-0.10.3 spec/cucumber/world/pending_spec.rb
cucumber-0.10.2 spec/cucumber/world/pending_spec.rb
cucumber-0.10.1 spec/cucumber/world/pending_spec.rb
stefl-cucumber-0.10.1 spec/cucumber/world/pending_spec.rb
vim-jar-0.1.2.0001 bundler/ruby/1.8/gems/cucumber-0.9.4/spec/cucumber/world/pending_spec.rb
vim-jar-0.1.2 bundler/ruby/1.8/gems/cucumber-0.9.4/spec/cucumber/world/pending_spec.rb
vim-jar-0.1.1 bundler/ruby/1.8/gems/cucumber-0.9.4/spec/cucumber/world/pending_spec.rb
vim-jar-0.1.0 bundler/ruby/1.8/gems/cucumber-0.9.4/spec/cucumber/world/pending_spec.rb
cucumber-0.10.0 spec/cucumber/world/pending_spec.rb
cucumber-0.9.4 spec/cucumber/world/pending_spec.rb
cucumber-0.9.3 spec/cucumber/world/pending_spec.rb
cucumber-0.9.2 spec/cucumber/world/pending_spec.rb
cucumber-0.9.1 spec/cucumber/world/pending_spec.rb
cucumber-0.9.0 spec/cucumber/world/pending_spec.rb