Merge pull request #13366 from vipulnsward/minitest-namespace-change
Change all `MiniTest` to `Minitest`
This commit is contained in:
commit
e63748cd37
@ -211,7 +211,7 @@ def recognized_request_for(path, extras = {})
|
||||
def fail_on(exception_class)
|
||||
yield
|
||||
rescue exception_class => e
|
||||
raise MiniTest::Assertion, e.message
|
||||
raise Minitest::Assertion, e.message
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -137,7 +137,7 @@ def delete_via_redirect(path, parameters = nil, headers_or_env = nil)
|
||||
class Session
|
||||
DEFAULT_HOST = "www.example.com"
|
||||
|
||||
include MiniTest::Assertions
|
||||
include Minitest::Assertions
|
||||
include TestProcess, RequestHelpers, Assertions
|
||||
|
||||
%w( status status_message headers body redirect? ).each do |method|
|
||||
|
@ -19,7 +19,7 @@ def test_assert_response_predicate_methods
|
||||
@response = FakeResponse.new sym
|
||||
assert_response sym
|
||||
|
||||
assert_raises(MiniTest::Assertion) {
|
||||
assert_raises(Minitest::Assertion) {
|
||||
assert_response :unauthorized
|
||||
}
|
||||
end
|
||||
@ -29,11 +29,11 @@ def test_assert_response_fixnum
|
||||
@response = FakeResponse.new 400
|
||||
assert_response 400
|
||||
|
||||
assert_raises(MiniTest::Assertion) {
|
||||
assert_raises(Minitest::Assertion) {
|
||||
assert_response :unauthorized
|
||||
}
|
||||
|
||||
assert_raises(MiniTest::Assertion) {
|
||||
assert_raises(Minitest::Assertion) {
|
||||
assert_response 500
|
||||
}
|
||||
end
|
||||
@ -42,11 +42,11 @@ def test_assert_response_sym_status
|
||||
@response = FakeResponse.new 401
|
||||
assert_response :unauthorized
|
||||
|
||||
assert_raises(MiniTest::Assertion) {
|
||||
assert_raises(Minitest::Assertion) {
|
||||
assert_response :ok
|
||||
}
|
||||
|
||||
assert_raises(MiniTest::Assertion) {
|
||||
assert_raises(Minitest::Assertion) {
|
||||
assert_response :success
|
||||
}
|
||||
end
|
||||
|
@ -5,7 +5,7 @@ module ActiveRecord
|
||||
class Migration
|
||||
class TableTest < ActiveRecord::TestCase
|
||||
def setup
|
||||
@connection = MiniTest::Mock.new
|
||||
@connection = Minitest::Mock.new
|
||||
end
|
||||
|
||||
def teardown
|
||||
|
@ -174,7 +174,7 @@ def test_assert_deprecated_matches_any_warning
|
||||
ActiveSupport::Deprecation.warn 'abc'
|
||||
ActiveSupport::Deprecation.warn 'def'
|
||||
end
|
||||
rescue MiniTest::Assertion
|
||||
rescue Minitest::Assertion
|
||||
flunk 'assert_deprecated should match any warning in block, not just the last one'
|
||||
end
|
||||
|
||||
|
@ -21,10 +21,10 @@ def test_assert_not
|
||||
assert_equal true, assert_not(nil)
|
||||
assert_equal true, assert_not(false)
|
||||
|
||||
e = assert_raises(MiniTest::Assertion) { assert_not true }
|
||||
e = assert_raises(Minitest::Assertion) { assert_not true }
|
||||
assert_equal 'Expected true to be nil or false', e.message
|
||||
|
||||
e = assert_raises(MiniTest::Assertion) { assert_not true, 'custom' }
|
||||
e = assert_raises(Minitest::Assertion) { assert_not true, 'custom' }
|
||||
assert_equal 'custom', e.message
|
||||
end
|
||||
|
||||
@ -73,7 +73,7 @@ def test_array_of_expressions
|
||||
end
|
||||
|
||||
def test_array_of_expressions_identify_failure
|
||||
assert_raises(MiniTest::Assertion) do
|
||||
assert_raises(Minitest::Assertion) do
|
||||
assert_difference ['@object.num', '1 + 1'] do
|
||||
@object.increment
|
||||
end
|
||||
@ -81,7 +81,7 @@ def test_array_of_expressions_identify_failure
|
||||
end
|
||||
|
||||
def test_array_of_expressions_identify_failure_when_message_provided
|
||||
assert_raises(MiniTest::Assertion) do
|
||||
assert_raises(Minitest::Assertion) do
|
||||
assert_difference ['@object.num', '1 + 1'], 1, 'something went wrong' do
|
||||
@object.increment
|
||||
end
|
||||
|
@ -29,7 +29,7 @@ def index
|
||||
require 'minitest/autorun'
|
||||
require 'rack/test'
|
||||
|
||||
class BugTest < MiniTest::Unit::TestCase
|
||||
class BugTest < Minitest::Unit::TestCase
|
||||
include Rack::Test::Methods
|
||||
|
||||
def test_returns_success
|
||||
|
@ -25,7 +25,7 @@ class Comment < ActiveRecord::Base
|
||||
belongs_to :post
|
||||
end
|
||||
|
||||
class BugTest < MiniTest::Unit::TestCase
|
||||
class BugTest < Minitest::Unit::TestCase
|
||||
def test_association_stuff
|
||||
post = Post.create!
|
||||
post.comments << Comment.create!
|
||||
|
@ -11,7 +11,7 @@
|
||||
# Config Rails backtrace in tests.
|
||||
require 'rails/backtrace_cleaner'
|
||||
if ENV["BACKTRACE"].nil?
|
||||
MiniTest.backtrace_filter = Rails.backtrace_cleaner
|
||||
Minitest.backtrace_filter = Rails.backtrace_cleaner
|
||||
end
|
||||
|
||||
if defined?(ActiveRecord::Base)
|
||||
|
@ -39,7 +39,7 @@ def test_order
|
||||
@stack.swap :foo
|
||||
@stack.delete :foo
|
||||
|
||||
mock = MiniTest::Mock.new
|
||||
mock = Minitest::Mock.new
|
||||
mock.expect :send, nil, [:swap, :foo]
|
||||
mock.expect :send, nil, [:delete, :foo]
|
||||
|
||||
@ -50,7 +50,7 @@ def test_order
|
||||
private
|
||||
|
||||
def assert_playback(msg_name, args)
|
||||
mock = MiniTest::Mock.new
|
||||
mock = Minitest::Mock.new
|
||||
mock.expect :send, nil, [msg_name, args]
|
||||
@stack.merge_into(mock)
|
||||
mock.verify
|
||||
|
Loading…
Reference in New Issue
Block a user