Support multiple block arguments in sample block

https://github.com/icy-arctic-fox/spectator/issues/41#issuecomment-1010192486
This commit is contained in:
Michael Miller 2022-01-11 15:53:53 -07:00
parent c1841526d4
commit 4057089c20
No known key found for this signature in database
GPG key ID: AC78B32D30CE34A2
4 changed files with 30 additions and 11 deletions

View file

@ -16,4 +16,14 @@ Spectator.describe "Spec metadata" do
expect(example.name).to eq("works with #{string}")
end
end
def self.a_hash
{"foo" => 42, "bar" => 123, "baz" => 7}
end
sample a_hash do |key, value|
it "works with #{key} = #{value}" do |example|
expect(example.name).to eq("works with #{key} = #{value}")
end
end
end