diff --git a/spec/mock_spec.rb b/spec/mock_spec.rb index 2c2f9349..f480bebc 100644 --- a/spec/mock_spec.rb +++ b/spec/mock_spec.rb @@ -49,4 +49,9 @@ person.name.should end end + + it "can mock existing methods on objects" do + expect(Time).to receive(:now).once.and_call_original + Time.now.should be_kind_of(Time) + end end