<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>lib/cucumber/world.rb</filename>
    </added>
    <added>
      <filename>lib/cucumber/world/pending.rb</filename>
    </added>
    <added>
      <filename>spec/cucumber/world/pending_spec.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -15,6 +15,7 @@ require 'cucumber/formatters'
 require 'cucumber/treetop_parser/feature_parser'
 require 'cucumber/cli'
 require 'cucumber/broadcaster'
+require 'cucumber/world'
 
 module Cucumber
   LANGUAGE_FILE = File.expand_path(File.dirname(__FILE__) + '/cucumber/languages.yml')</diff>
      <filename>lib/cucumber.rb</filename>
    </modified>
    <modified>
      <diff>@@ -112,6 +112,9 @@ module Cucumber
           step.execute_in(@world, regexp, args, proc)
           @after_step_procs.each{|p| p.call_in(@world, *[])}
           formatters.step_passed(step, regexp, args)
+        rescue ForcedPending =&gt; e
+          step.error = e
+          record_pending_step(step, regexp, args)
         rescue Pending
           record_pending_step(step, regexp, args)
         rescue =&gt; e
@@ -124,6 +127,9 @@ module Cucumber
           regexp, args, proc = step.regexp_args_proc(@step_mother)
           step.execute_in(@world, regexp, args, proc)
           formatters.step_skipped(step, regexp, args)
+        rescue ForcedPending =&gt; e
+          step.error = e
+          record_pending_step(step, regexp, args)
         rescue Pending
           record_pending_step(step, regexp, args)
         rescue Exception
@@ -179,6 +185,7 @@ module Cucumber
     
     def create_world
       world = Object.new
+      world.extend(World::Pending)
       @world_procs.each do |world_proc|
         world = world_proc.call(world)
       end</diff>
      <filename>lib/cucumber/executor.rb</filename>
    </modified>
    <modified>
      <diff>@@ -18,6 +18,8 @@ module Cucumber
         @pending_steps      = []
         @skipped            = []
         @last_executed_was_row = false
+        @pending_messages = {}
+        @forced_pending_step_count = 0
       end
 
       def feature_executing(feature)
@@ -136,6 +138,10 @@ module Cucumber
           end
           @io.puts
         end
+        if step.forced_to_pending?
+          @pending_messages[regexp.inspect] ||= &quot;#{step.keyword} #{regexp.inspect} (#{step.error.message}) #{source_comment(step)}&quot; 
+          @forced_pending_step_count += 1
+        end
       end
 
       def output_failing_step(step)
@@ -150,24 +156,38 @@ module Cucumber
       def dump
         @io.puts
 
+        print_pending_messages if @pending_messages.any?
+
         @io.puts pending(&quot;#{@pending_scenarios.length} scenarios pending&quot;) if @pending_scenarios.any?
 
         @io.puts passed(&quot;#{@passed.length} steps passed&quot;)           if @passed.any?
         @io.puts failed(&quot;#{@failed.length} steps failed&quot;)           if @failed.any?
         @io.puts skipped(&quot;#{@skipped.length} steps skipped&quot;)        if @skipped.any?
-        @io.puts pending(&quot;#{@pending_steps.length} steps pending&quot;)  if @pending_steps.any?
+        if @pending_steps.any?
+          @io.print pending(&quot;#{@pending_steps.length} steps pending&quot;) 
+          @io.print pending(&quot; (#{number_of_unimplemented_steps} with no step definition)&quot;) if number_of_unimplemented_steps &gt; 0
+          @io.puts
+        end
 
         @io.print reset
 
         print_snippets if @options[:snippets]
       end
 
+      def print_pending_messages
+        @io.puts &quot;Pending Notes:&quot;
+        @pending_messages.each_value do |message|
+          @io.puts message
+        end
+        @io.puts
+      end
+
       def print_snippets
         snippets = @pending_steps
         snippets.delete_if {|snippet| snippet.row? || @step_mother.has_step_definition?(snippet.name)}
 
         unless snippets.empty?
-          @io.puts &quot;\nYou can use these snippets to implement pending steps:\n\n&quot;
+          @io.puts &quot;\nYou can use these snippets to implement pending steps which have no step definition:\n\n&quot;
 
           prev_keyword = nil
           snippets = snippets.map do |step|
@@ -184,6 +204,10 @@ module Cucumber
 
       private
 
+      def number_of_unimplemented_steps
+        @pending_steps.length - @forced_pending_step_count
+      end
+
       def escape_regexp_characters(string)
         Regexp.escape(string).gsub('\ ', ' ').gsub('/', '\/') unless string.nil?
       end</diff>
      <filename>lib/cucumber/formatters/pretty_formatter.rb</filename>
    </modified>
    <modified>
      <diff>@@ -4,6 +4,9 @@ module Cucumber
   class Pending &lt; StandardError
   end
 
+  class ForcedPending &lt; Pending
+  end
+
   class Duplicate &lt; StandardError
   end
 </diff>
      <filename>lib/cucumber/step_mother.rb</filename>
    </modified>
    <modified>
      <diff>@@ -90,6 +90,11 @@ module Cucumber
       def padding_length
         @scenario.step_padding_length(self)
       end
+
+      def forced_to_pending?
+        @error.kind_of?(ForcedPending)
+      end
+            
     end
     
     class Step &lt; BaseStep</diff>
      <filename>lib/cucumber/tree/step.rb</filename>
    </modified>
    <modified>
      <diff>@@ -75,6 +75,13 @@ dang
         world.doit.should == &quot;dunit&quot;
         world.beatit.should == &quot;beatenit&quot;
       end
+      
+      it &quot;should add support for calling 'pending' from world&quot; do
+        world = @executor.create_world
+      
+        world.should respond_to(:pending)
+      end
+      
     end
 
     describe &quot;visiting feature&quot; do
@@ -162,6 +169,40 @@ dang
       end
       
     end
+    
+    describe &quot;visit forced pending step&quot; do
+
+      before(:each) do
+        @executor.formatters = mock('formatter', :null_object =&gt; true)          
+      end
+
+      it &quot;should store the pending exception with the step&quot; do
+        mock_step = mock(&quot;mock step&quot;, :regexp_args_proc =&gt; nil)
+        pending_exception = ForcedPending.new(&quot;implement me&quot;)
+        mock_step.stub!(:execute_in).and_raise(pending_exception)
+
+        mock_step.should_receive(:'error=').with(pending_exception)
+        
+        @executor.visit_step(mock_step)
+      end
+      
+      describe &quot;after failed/pending step&quot; do
+        
+        it &quot;should store the pending exception with the step&quot; do
+          mock_step_1 = mock(&quot;mock step&quot;, :null_object =&gt; true)
+          mock_step_2 = mock(&quot;mock step&quot;, :regexp_args_proc =&gt; nil)
+          pending_exception = ForcedPending.new(&quot;implement me&quot;)
+          mock_step_1.stub!(:execute_in).and_raise(StandardError)
+          mock_step_2.stub!(:execute_in).and_raise(pending_exception)
+
+          mock_step_2.should_receive(:'error=').with(pending_exception)
+
+          @executor.visit_step(mock_step_1)
+          @executor.visit_step(mock_step_2)
+        end
+        
+      end
+    end
               
     describe &quot;visiting row scenarios&quot; do
       
@@ -293,6 +334,6 @@ dang
         @executor.visit_features(@features)
       end
     end
-        
+
   end
 end</diff>
      <filename>spec/cucumber/executor_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -13,9 +13,11 @@ module Cucumber
           :padding_length =&gt; 2,
           :file =&gt; 'test',
           :line =&gt; 1,
-          :row? =&gt; false}.merge(stubs))
+          :row? =&gt; false,
+          :forced_to_pending? =&gt; false,
+          :regexp_args_proc =&gt; [nil, nil, mock_proc]}.merge(stubs))
       end
-
+   
       def mock_scenario(stubs={})
         stub('scenario', {
           :name =&gt; 'test',
@@ -36,8 +38,8 @@ module Cucumber
           :backtrace =&gt; 'example backtrace'}.merge(stubs))
       end
 
-      def mock_proc
-        stub(Proc, :to_comment_line =&gt; '# steps/example_steps.rb:11')
+      def mock_proc(stubs={})
+        stub(Proc, {:to_comment_line =&gt; '# steps/example_steps.rb:11'}.merge(stubs))
       end
 
       it &quot;should print step file and line when passed&quot; do
@@ -199,6 +201,74 @@ module Cucumber
         }.should_not raise_error(TypeError)
       end
 
+      describe &quot;pending messages&quot; do
+
+        before(:each) do
+          @io = StringIO.new
+          @formatter = PrettyFormatter.new @io, mock('step_mother')
+        end
+
+        it &quot;should show pending message for step&quot; do
+          @formatter.step_pending(mock_step(:keyword =&gt; 'Given', :forced_to_pending? =&gt; true, :error =&gt; ForcedPending.new(&quot;please implement me&quot;)), /yatta/, nil)
+
+          @formatter.dump
+        
+          @io.string.should include(&quot;Given /yatta/ (please implement me)&quot;)
+        end
+        
+        it &quot;should show pending step's file and line&quot; do
+          @formatter.step_pending(mock_step(:forced_to_pending? =&gt; true, :error =&gt; ForcedPending.new(&quot;please implement me&quot;), 
+                                            :regexp_args_proc =&gt; [nil, nil, mock_proc(:to_comment_line =&gt; &quot;steps/example_steps.rb:11&quot;)]), nil, nil)
+
+          @formatter.dump
+        
+          @io.string.should include(&quot;steps/example_steps.rb:11&quot;)
+        end
+        
+        it &quot;should not show duplicates&quot; do
+          @formatter.step_pending(mock_step(:keyword =&gt; 'Given', :forced_to_pending? =&gt; true, :error =&gt; ForcedPending.new(&quot;please implement me&quot;)), /yatta/, [])
+          @formatter.step_pending(mock_step(:forced_to_pending? =&gt; true, :error =&gt; ForcedPending.new(&quot;please implement me&quot;), :row? =&gt; true), /yatta/, [])
+
+          @formatter.dump
+
+          @io.string.scan(/please implement me/).length.should_not == 2
+        end
+        
+        it &quot;should ignore messages from steps that where not forced to pending&quot; do
+          @formatter.step_pending(mock_step(:keyword =&gt; 'Given', :forced_to_pending? =&gt; false, :error =&gt; Pending.new(&quot;do not show me&quot;)), nil, [])
+          
+          @formatter.dump
+          
+          @io.string.should_not include(&quot;do not show me&quot;)
+        end
+        
+      end
+
+      describe &quot;no pending messages&quot; do
+        
+        it &quot;should not show any pending message information&quot; do
+          io = StringIO.new
+          formatter = PrettyFormatter.new io, mock('step_mother')
+
+          formatter.dump
+        
+          io.string.should_not include(&quot;Pending Notes:\n&quot;)
+        end
+
+      end
+      
+      it &quot;should show number of pending steps that have no step definition&quot; do
+        io = StringIO.new
+        formatter = PrettyFormatter.new io, mock('step_mother')
+        
+        formatter.step_pending(mock_step(:error =&gt; ForcedPending.new, :forced_to_pending? =&gt; true), nil, [])
+        formatter.step_pending(mock_step(:error =&gt; Pending.new, :forced_to_pending? =&gt; false), nil, [])
+        
+        formatter.dump
+        
+        io.string.should include(&quot;1 with no step definition&quot;)
+      end
+
     end
   end
 end</diff>
      <filename>spec/cucumber/formatters/pretty_formatter_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -43,6 +43,15 @@ module Cucumber
         end
 
       end
+
+      it &quot;should indicate if a forced pending exception occured&quot; do
+        scenario = Scenario.new(nil, '9', 1)
+        step = scenario.create_step('Given', '666666', 98)
+        
+        step.instance_variable_set(&quot;@error&quot;, ForcedPending.new)
+        
+        step.should be_forced_to_pending
+      end
       
     end
   end</diff>
      <filename>spec/cucumber/tree/step_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>db4696e3240a79a2634d5ca0ebe9aa52f7022017</id>
    </parent>
  </parents>
  <author>
    <name>Joseph Wilk</name>
    <email>josephwilk@joesniff.co.uk</email>
  </author>
  <url>http://github.com/josephwilk/cucumber/commit/ad48ddf031f0cf1d1776c8baed03ffef3b507775</url>
  <id>ad48ddf031f0cf1d1776c8baed03ffef3b507775</id>
  <committed-date>2008-12-07T11:09:52-08:00</committed-date>
  <authored-date>2008-12-07T11:09:52-08:00</authored-date>
  <message>Add support for calling 'pending' from step defintions.</message>
  <tree>bc642c5cf4c248d11cea0c94ecd1bbcb7e04b704</tree>
  <committer>
    <name>Joseph Wilk</name>
    <email>josephwilk@joesniff.co.uk</email>
  </committer>
</commit>
