lib/remarkable/pending.rb in remarkable-3.0.2 vs lib/remarkable/pending.rb in remarkable-3.0.3
- old
+ new
@@ -1,23 +1,23 @@
module Remarkable
module Macros
protected
- def pending(description=nil, &block)
+ def pending(description='TODO', &block)
PendingSandbox.new(description, self).instance_eval(&block)
end
class PendingSandbox < Struct.new(:description, :spec) #:nodoc:
include Macros
def example(mather_description=nil)
method_caller = caller.detect{ |c| c !~ /method_missing'/ }
error = begin
- ::Spec::Example::ExamplePendingError.new(description || 'TODO', method_caller)
- rescue # For rspec <= 1.1.12
- ::Spec::Example::ExamplePendingError.new(description || 'TODO')
+ ::Spec::Example::ExamplePendingError.new(description, method_caller)
+ rescue # For rspec <= 1.1.12 and rspec => 1.2.4
+ ::Spec::Example::ExamplePendingError.new(description)
end
spec.send(:example, mather_description){ raise error }
end
alias :it :example