From 4609d82944b060c09c27f5368be975fafdead7f2 Mon Sep 17 00:00:00 2001 From: David Siaw Date: Mon, 1 Apr 2024 19:41:28 +0900 Subject: [PATCH] fixxx --- lib/kaiser/cli.rb | 2 +- lib/kaiser/cmds/shutdown.rb | 2 +- spec/cli_spec.rb | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/kaiser/cli.rb b/lib/kaiser/cli.rb index 4f616c1f..d7db189a 100644 --- a/lib/kaiser/cli.rb +++ b/lib/kaiser/cli.rb @@ -598,7 +598,7 @@ def network def container_dead?(container) x = JSON.parse(`docker inspect #{container} 2>/dev/null`) - return true if x.empty? || x[0]['State']['Running'] == false + x.empty? || x[0]['State']['Running'] == false end def if_container_dead(container) diff --git a/lib/kaiser/cmds/shutdown.rb b/lib/kaiser/cmds/shutdown.rb index a1cb9174..49fcd194 100644 --- a/lib/kaiser/cmds/shutdown.rb +++ b/lib/kaiser/cmds/shutdown.rb @@ -14,7 +14,7 @@ def usage end def execute(_opts) - Config.config[:shared_names].each do |_, container_name| + Config.config[:shared_names].each_value do |container_name| killrm container_name end diff --git a/spec/cli_spec.rb b/spec/cli_spec.rb index 799a3fdf..8012064b 100644 --- a/spec/cli_spec.rb +++ b/spec/cli_spec.rb @@ -51,19 +51,19 @@ it 'for x86 machines returns normal selenium' do cli = Kaiser::Cli.new stub_const('RUBY_PLATFORM', 'x86_64-linux') - expect(cli.selenium_node_image).to eq('selenium/standalone-chrome-debug') + expect(cli.send(:selenium_node_image)).to eq('selenium/standalone-chrome-debug') end it 'for arm machines on mac' do cli = Kaiser::Cli.new stub_const('RUBY_PLATFORM', 'arm64-darwin23') - expect(cli.selenium_node_image).to eq('seleniarm/standalone-chromium') + expect(cli.send(:selenium_node_image)).to eq('seleniarm/standalone-chromium') end it 'for arm machines on linux' do cli = Kaiser::Cli.new stub_const('RUBY_PLATFORM', 'arch64-linux') - expect(cli.selenium_node_image).to eq('seleniarm/standalone-chromium') + expect(cli.send(:selenium_node_image)).to eq('seleniarm/standalone-chromium') end end end