Skip to content

Commit 4d5afd6

Browse files
committed
Merge pull request #1 from rspec/lint-for-rails-master
Provide assertions getter/setter for Minitest.
2 parents c67eb34 + e244357 commit 4d5afd6

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

spec/rspec/active_model/mocks/mock_model_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,7 @@
385385
begin
386386
require 'minitest/assertions'
387387
include Minitest::Assertions
388+
include MinitestAssertion
388389
rescue LoadError
389390
require 'test/unit/assertions'
390391
include Test::Unit::Assertions

spec/support/minitest_support.rb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Minitest requires you provide an assertions ivar for the context
2+
# it is running within. We need this so that ActiveModel::Lint tests
3+
# can successfully be run.
4+
module MinitestAssertion
5+
def assertions
6+
@assertions ||= 0
7+
end
8+
9+
def assertions=(value)
10+
@assertions = value
11+
end
12+
end

0 commit comments

Comments
 (0)