diff --git a/CHANGELOG.md b/CHANGELOG.md index 3c5e7d8..129c8f1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fix usage of `be ===` and `be =~` [#34](https://github.com/icy-arctic-fox/spectator/issues/34) - Better handling of the `be(nil)` when used with value types. [#37](https://github.com/icy-arctic-fox/spectator/issues/37) - Fix missing arguments for stubbed top-level methods (`system`, `exit`, etc.). [#36](https://github.com/icy-arctic-fox/spectator/issues/36) +- Fix outdated naming when using `expect_any_instance_of`. ### Changed - Elegantly handle missing/undefined methods with `have_attributes` matcher. diff --git a/src/spectator/mocks/expect_any_instance.cr b/src/spectator/mocks/expect_any_instance.cr index 607c425..fcf7eec 100644 --- a/src/spectator/mocks/expect_any_instance.cr +++ b/src/spectator/mocks/expect_any_instance.cr @@ -10,8 +10,8 @@ module Spectator::Mocks Harness.current.mocks.expect(T, stub) value = Value.new(stub.name, stub.to_s) matcher = Matchers::ReceiveTypeMatcher.new(value, stub.arguments?) - partial = Expectations::ExpectationPartial.new(actual, @location) - partial.to_eventually(matcher) + target = Expectation::Target.new(actual, @location) + target.to_eventually(matcher) end def to(stubs : Enumerable(MethodStub)) : Nil