Created
November 26, 2023 11:27
-
-
Save PragTob/95a22ffcc9a3ff8c0813e90804e906a5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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