-
-
Notifications
You must be signed in to change notification settings - Fork 159
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
20595f5
commit 5a214c0
Showing
2 changed files
with
29 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
require 'bundler/setup' | ||
require 'minitest/autorun' | ||
require 'mocha/minitest' | ||
|
||
# rubocop:disable Style/CommentedKeyword | ||
class TestMeme < Minitest::Test | ||
class Klass | ||
def self.foo; end | ||
end | ||
|
||
def test_foo_never_called # should fail, but doesn't | ||
Klass.stubs(:foo) | ||
Klass.expects(:foo).never | ||
Klass.foo | ||
end | ||
|
||
def test_foo_called_once # correctly passes | ||
Klass.stubs(:foo) | ||
Klass.expects(:foo).once | ||
Klass.foo | ||
end | ||
|
||
def test_no_stubs # correctly fails | ||
Klass.expects(:foo).never | ||
Klass.foo | ||
end | ||
end | ||
# rubocop:enable Style/CommentedKeyword |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters