Skip to content

Instantly share code, notes, and snippets.

@PragTob
Created November 26, 2023 11:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PragTob/95a22ffcc9a3ff8c0813e90804e906a5 to your computer and use it in GitHub Desktop.
Save PragTob/95a22ffcc9a3ff8c0813e90804e906a5 to your computer and use it in GitHub Desktop.
context "with Zazz into the equation" do
zazz_rules = [
FizzBuzz::Rule.new("Fizz", 3),
FizzBuzz::Rule.new("Buzz", 5),
FizzBuzz::Rule.new("Zazz", 7)
]
expected = {
1 => 1,
3 => "Fizz",
5 => "Buzz",
7 => "Zazz",
15 => "FizzBuzz",
21 => "FizzZazz",
35 => "BuzzZazz",
105 => "FizzBuzzZazz"
}
expected.each do |input, output|
it "for #{input} expect #{output}" do
expect(described_class.fizz_buzz(input, zazz_rules)).to eq output
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment