diff options
author | utilum <oz@utilum.com> | 2018-07-19 11:48:05 +0300 |
---|---|---|
committer | utilum <oz@utilum.com> | 2018-07-22 08:38:56 +0300 |
commit | 82e42c1bd890bbd1e3b718b1273ef3cd9a5b5623 (patch) | |
tree | aa3ed02a915bdbf1c2153b512ad1a1e00875fdc8 /railties/exe/rails | |
parent | d89937505867eac91830d34a97d55b08d48573fc (diff) | |
download | rails-82e42c1bd890bbd1e3b718b1273ef3cd9a5b5623.tar.gz rails-82e42c1bd890bbd1e3b718b1273ef3cd9a5b5623.tar.bz2 rails-82e42c1bd890bbd1e3b718b1273ef3cd9a5b5623.zip |
Replace permissive Mocha expectations
Step 6 in #33162
When using Mocha like this:
`ActiveRecord::Base.expects(:establish_connection).with(some_args)`,
the expectations created look something like this:
```
@expectations=
[#<Expectation:0x561350d968e0 expected exactly once, not yet invoked: ActiveRecord::Base.establish_connection("adapter" => "mysql2", "database" => nil) >,
#<Expectation:0x561350dab8f8 allowed any number of times, not yet invoked: ActiveRecord::Base.establish_connection(any_parameters) >,
#<Expectation:0x561350dc30c0 allowed any number of times, not yet invoked: ActiveRecord::Base.connection(any_parameters) >]
```
Minitest mocking (and the way we use it in `MethodCallAssertions`)
expressly refuses to facilitate such permissiive expectations, insisting
that all calls be specified in the actual expected order.
This patch replaces such calls to `Mocha#expects` with
`ActiveSupport::Testing::MethodCallAssertions` and specifies all
expected calls in the epxected order.
Diffstat (limited to 'railties/exe/rails')
0 files changed, 0 insertions, 0 deletions