Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failing test for options hash / kwarg compat #20

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions test/safe/of_next_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down