diff options
| author | a14m <[email protected]> | 2020-12-02 14:47:04 +0100 |
|---|---|---|
| committer | a14m <[email protected]> | 2020-12-02 14:51:33 +0100 |
| commit | 81921690c1c090976f4f31262e8a8e7fb010e2db (patch) | |
| tree | cab90688144d1c5cdd3e36527763b4032f0e0422 /CLI/ruby/spec | |
| parent | beef1220ecae3d4b3faec49059b131488bc8d016 (diff) | |
Use x,y coordinates instead of pos_x (and disable rubocop warning)
Diffstat (limited to 'CLI/ruby/spec')
| -rw-r--r-- | CLI/ruby/spec/game_of_life/cell_spec.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/CLI/ruby/spec/game_of_life/cell_spec.rb b/CLI/ruby/spec/game_of_life/cell_spec.rb index e2fa7a4..063fd06 100644 --- a/CLI/ruby/spec/game_of_life/cell_spec.rb +++ b/CLI/ruby/spec/game_of_life/cell_spec.rb @@ -1,8 +1,8 @@ # frozen_string_literal: true RSpec.describe GameOfLife::Cell do - subject(:living_cell) { described_class.new(pos_x: nil, pos_y: nil, alive: true) } - subject(:dead_cell) { described_class.new(pos_x: nil, pos_y: nil, alive: false) } + subject(:living_cell) { described_class.new(x: nil, y: nil, alive: true) } + subject(:dead_cell) { described_class.new(x: nil, y: nil, alive: false) } describe "#to_s" do before(:all) do @@ -90,8 +90,8 @@ RSpec.describe GameOfLife::Cell do describe "#living_neighbors" do subject(:cell) { [living_cell, dead_cell].sample } - let(:living_neighbors) { (0...rand(100)).map { described_class.new(pos_x: nil, pos_y: nil, alive: true) } } - let(:dead_neighbors) { (0...rand(100)).map { described_class.new(pos_x: nil, pos_y: nil, alive: false) } } + let(:living_neighbors) { (0...rand(100)).map { described_class.new(x: nil, y: nil, alive: true) } } + let(:dead_neighbors) { (0...rand(100)).map { described_class.new(x: nil, y: nil, alive: false) } } let(:neighbors) { (living_neighbors + dead_neighbors).shuffle } it "returns the count of living neighbors cells" do |
