Skip to content

Commit 571f57e

Browse files
committed
Add very simple mock spec for testing stubbed methods
This was previous buggy on a previous version of opal
1 parent fe80fe9 commit 571f57e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

spec/mock_spec.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,9 @@
4949
person.name.should
5050
end
5151
end
52+
53+
it "can mock existing methods on objects" do
54+
expect(Time).to receive(:now).once.and_call_original
55+
Time.now.should be_kind_of(Time)
56+
end
5257
end

0 commit comments

Comments
 (0)