Skip to content

Commit

Permalink
Add very simple mock spec for testing stubbed methods
Browse files Browse the repository at this point in the history
This was previous buggy on a previous version of opal
  • Loading branch information
adambeynon committed Nov 20, 2013
1 parent fe80fe9 commit 571f57e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions spec/mock_spec.rb
Expand Up @@ -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

0 comments on commit 571f57e

Please sign in to comment.