diff --git a/CHANGELOG.md b/CHANGELOG.md index 50d9198..ba9fa7c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +### Fixed +- Fix `expect().to receive()` syntax not implicitly stubbing the method. +- Avoid calling `NoReturn` methods from stubs. [#29](https://github.com/icy-arctic-fox/spectator/issues/29) + ### Added - Added support for `with(no_args)` for method stubs. [#28](https://github.com/icy-arctic-fox/spectator/issues/28) - Allow creation of doubles without definition block. [#30](https://github.com/icy-arctic-fox/spectator/issues/30) diff --git a/spec/issues/github_issue_29_spec.cr b/spec/issues/github_issue_29_spec.cr new file mode 100644 index 0000000..6cedf58 --- /dev/null +++ b/spec/issues/github_issue_29_spec.cr @@ -0,0 +1,20 @@ +require "../spec_helper" + +Spectator.describe "GitHub Issue #29" do + class SomeClass + def goodbye + exit 0 + end + end + + mock SomeClass do + stub exit(code) + end + + describe SomeClass do + it "captures exit" do + expect(subject).to receive(:exit).with(0) + subject.goodbye + end + end +end