From 81921690c1c090976f4f31262e8a8e7fb010e2db Mon Sep 17 00:00:00 2001 From: a14m Date: Wed, 2 Dec 2020 14:47:04 +0100 Subject: Use x,y coordinates instead of pos_x (and disable rubocop warning) --- CLI/ruby/spec/game_of_life/cell_spec.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'CLI/ruby/spec') 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 -- cgit v1.2.3