spec/runner/shared_spec.rb in mspec-1.5.17 vs spec/runner/shared_spec.rb in mspec-1.5.18
- old
+ new
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../spec_helper'
+require 'spec_helper'
require 'mspec/runner/shared'
require 'mspec/runner/context'
require 'mspec/runner/example'
describe Object, "#it_behaves_like" do
@@ -21,9 +21,17 @@
ScratchPad.recorded.should == :some_method
end
it "creates @object if the passed object" do
object = Object.new
+ @shared.it("an example") { ScratchPad.record @object }
+ @state.it_behaves_like :shared_spec, :some_method, object
+ @state.process
+ ScratchPad.recorded.should == object
+ end
+
+ it "creates @object if the passed false" do
+ object = false
@shared.it("an example") { ScratchPad.record @object }
@state.it_behaves_like :shared_spec, :some_method, object
@state.process
ScratchPad.recorded.should == object
end