mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Merge pull request #44365 from nvasilevski/increment-assertions-on-assert-nothing-raised
Increment assertions count on assert_nothing_raised
This commit is contained in:
commit
85c32e8dba
3 changed files with 9 additions and 9 deletions
|
@ -31,7 +31,7 @@ module ActiveSupport
|
|||
# perform_service(param: 'no_exception')
|
||||
# end
|
||||
def assert_nothing_raised
|
||||
yield
|
||||
yield.tap { assert(true) }
|
||||
rescue => error
|
||||
raise Minitest::UnexpectedError.new(error)
|
||||
end
|
||||
|
|
|
@ -229,7 +229,7 @@ module ApplicationTests
|
|||
end
|
||||
output = rails("test")
|
||||
|
||||
assert_match(/7 runs, 9 assertions, 0 failures, 0 errors/, output)
|
||||
assert_match(/7 runs, 11 assertions, 0 failures, 0 errors/, output)
|
||||
assert_no_match(/Errors running/, output)
|
||||
end
|
||||
|
||||
|
@ -247,7 +247,7 @@ module ApplicationTests
|
|||
with_rails_env("test") { rails("db:migrate") }
|
||||
output = rails("test")
|
||||
|
||||
assert_match(/5 runs, 7 assertions, 0 failures, 0 errors/, output)
|
||||
assert_match(/5 runs, 9 assertions, 0 failures, 0 errors/, output)
|
||||
assert_no_match(/Errors running/, output)
|
||||
end
|
||||
|
||||
|
@ -260,7 +260,7 @@ module ApplicationTests
|
|||
end
|
||||
output = rails("test")
|
||||
|
||||
assert_match(/7 runs, 9 assertions, 0 failures, 0 errors/, output)
|
||||
assert_match(/7 runs, 11 assertions, 0 failures, 0 errors/, output)
|
||||
assert_no_match(/Errors running/, output)
|
||||
end
|
||||
|
||||
|
|
|
@ -573,7 +573,7 @@ class ScaffoldGeneratorTest < Rails::Generators::TestCase
|
|||
`bin/rails g scaffold User name:string age:integer;
|
||||
bin/rails db:migrate`
|
||||
end
|
||||
assert_match(/8 runs, 10 assertions, 0 failures, 0 errors/, `bin/rails test 2>&1`)
|
||||
assert_match(/8 runs, 12 assertions, 0 failures, 0 errors/, `bin/rails test 2>&1`)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -593,7 +593,7 @@ class ScaffoldGeneratorTest < Rails::Generators::TestCase
|
|||
assert_match(/class UsersController < ApplicationController/, content)
|
||||
end
|
||||
|
||||
assert_match(/8 runs, 10 assertions, 0 failures, 0 errors/, `bin/rails test 2>&1`)
|
||||
assert_match(/8 runs, 12 assertions, 0 failures, 0 errors/, `bin/rails test 2>&1`)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -607,7 +607,7 @@ class ScaffoldGeneratorTest < Rails::Generators::TestCase
|
|||
`bin/rails g scaffold User name:string age:integer;
|
||||
bin/rails db:migrate`
|
||||
end
|
||||
assert_match(/8 runs, 10 assertions, 0 failures, 0 errors/, `bin/rails test 2>&1`)
|
||||
assert_match(/8 runs, 12 assertions, 0 failures, 0 errors/, `bin/rails test 2>&1`)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -621,7 +621,7 @@ class ScaffoldGeneratorTest < Rails::Generators::TestCase
|
|||
`bin/rails g scaffold User name:string age:integer;
|
||||
bin/rails db:migrate`
|
||||
end
|
||||
assert_match(/6 runs, 8 assertions, 0 failures, 0 errors/, `bin/rails test 2>&1`)
|
||||
assert_match(/6 runs, 10 assertions, 0 failures, 0 errors/, `bin/rails test 2>&1`)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -635,7 +635,7 @@ class ScaffoldGeneratorTest < Rails::Generators::TestCase
|
|||
`bin/rails g scaffold User name:string age:integer;
|
||||
bin/rails db:migrate`
|
||||
end
|
||||
assert_match(/6 runs, 8 assertions, 0 failures, 0 errors/, `bin/rails test 2>&1`)
|
||||
assert_match(/6 runs, 10 assertions, 0 failures, 0 errors/, `bin/rails test 2>&1`)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue