diff options
| author | a14m <[email protected]> | 2020-12-03 13:15:00 +0100 |
|---|---|---|
| committer | a14m <[email protected]> | 2020-12-03 13:15:00 +0100 |
| commit | 05730269d4d2d690d871548ae3930d3ce20cdcad (patch) | |
| tree | 91017414194247100352b76d2288fb5da2aeece4 /CLI/ruby/spec/game_of_life/generators | |
| parent | 187b189044b19482879eac3ed63772f3d8d2e000 (diff) | |
Randomize the order and stub constants used
Diffstat (limited to 'CLI/ruby/spec/game_of_life/generators')
| -rw-r--r-- | CLI/ruby/spec/game_of_life/generators/input_spec.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/CLI/ruby/spec/game_of_life/generators/input_spec.rb b/CLI/ruby/spec/game_of_life/generators/input_spec.rb index cbf3958..e05dbfb 100644 --- a/CLI/ruby/spec/game_of_life/generators/input_spec.rb +++ b/CLI/ruby/spec/game_of_life/generators/input_spec.rb @@ -16,6 +16,8 @@ RSpec.describe GameOfLife::Generators::Input do options = { "input" => "Conway's Game of Life", "width" => 21, "height" => 1 } allow(URI).to receive(:open).and_return(file) allow(file).to receive(:read).and_return(options["input"]) + stub_const("GameOfLife::Cell::LIVE_CELL", "X") + stub_const("GameOfLife::Cell::DEAD_CELL", ".") # Conway's Game of Life expect(described_class.new(options).to_s).to eq "XXXXXX.X.XXXX.XX.XXXX" @@ -25,6 +27,8 @@ RSpec.describe GameOfLife::Generators::Input do options = { "input" => "Conway's Game of Life", "width" => 25, "height" => 2 } allow(URI).to receive(:open).and_return(file) allow(file).to receive(:read).and_return(options["input"]) + stub_const("GameOfLife::Cell::LIVE_CELL", "X") + stub_const("GameOfLife::Cell::DEAD_CELL", ".") # Conway's Game of Life universe = "XXXXXX.X.XXXX.XX.XXXX....\n" \ @@ -37,6 +41,8 @@ RSpec.describe GameOfLife::Generators::Input do options = { "input" => "Conway's Game of Life", "width" => 11, "height" => 3 } allow(URI).to receive(:open).and_return(file) allow(file).to receive(:read).and_return(options["input"]) + stub_const("GameOfLife::Cell::LIVE_CELL", "X") + stub_const("GameOfLife::Cell::DEAD_CELL", ".") # Conway's Ga universe = "XXXXXX.X.XX\n" \ |
