Skip to content

Commit

Permalink
test: fix specs
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelgomesxyz committed Nov 17, 2023
1 parent e56e33f commit 626ef95
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions lib/cpl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,9 @@ def self.all_base_commands
private

def show_info_header(config)
# We don't want to show the header when running rspec
return if ENV["RACK_ENV"] == "test"

rows = {}
rows["ORG"] = config.org || "NOT PROVIDED!"
rows["APP"] = config.app || "NOT PROVIDED!"
Expand Down
2 changes: 1 addition & 1 deletion spec/cpl_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
args = [option_key_name, option_value]
end

allow(Config).to receive(:new).with([], { option[:name].to_sym => option_value }).and_call_original
allow(Config).to receive(:new).with([], { option[:name].to_sym => option_value }, []).and_call_original

allow_any_instance_of(Config).to receive(:find_app_config_file).and_return("spec/fixtures/config.yml") # rubocop:disable RSpec/AnyInstance
expect_any_instance_of(Command::Test).to receive(:call) # rubocop:disable RSpec/AnyInstance
Expand Down
2 changes: 2 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
require "timecop"
require "vcr"

ENV["RACK_ENV"] = "test"

SimpleCov.start do
enable_coverage :branch
end
Expand Down

0 comments on commit 626ef95

Please sign in to comment.