diff --git a/test/safe/of_next_test.rb b/test/safe/of_next_test.rb index e356e61..5a510de 100644 --- a/test/safe/of_next_test.rb +++ b/test/safe/of_next_test.rb @@ -19,6 +19,12 @@ def initialize(a, b:) end end + class OptionsHash + def initialize(opts = {}) + raise "options hash required!" + end + end + def test_of_next neato_mocktail = Mocktail.of_next(Neato) next_neato = Neato.new @@ -52,6 +58,12 @@ def test_of_next_multiples_then_returns_to_replaced_version assert Neato.new.to_s.include?("Mocktail") end + def test_options_hash_initializer + thing = Mocktail.of_next(OptionsHash) + + assert_equal thing, OptionsHash.new(item: "hello") + end + module AModule end