Skip to content

Commit 8e96443

Browse files
committed
Improved run_described_fastlane_action to reduce logs during tests
cc @mokagio
1 parent 135fdb1 commit 8e96443

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

spec/spec_helper.rb

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,17 +70,19 @@ def expect_shell_command(*command, exitstatus: 0, output: '')
7070
# If the `described_class` of a spec is a `Fastlane::Action` subclass, it runs
7171
# it with the given parameters.
7272
#
73-
def run_described_fastlane_action(parameters, lane_name = 'test')
74-
expect(described_class).to be < Fastlane::Action, "Only call `#{__callee__}` from a spec describing a `Fastlane::Action` subclass."
73+
def run_described_fastlane_action(parameters)
74+
raise "Only call `#{__callee__}` from a spec describing a `Fastlane::Action` subclass." unless Fastlane::Actions.is_class_action?(described_class)
7575

76+
# Avoid logging messages about deprecated actions while running tests on them
77+
allow(Fastlane::Actions).to receive(:is_deprecated?).and_return(false)
7678
lane = <<~LANE
77-
lane :#{lane_name} do
79+
lane :test do
7880
#{described_class.action_name}(
7981
#{parameters.inspect}
8082
)
8183
end
8284
LANE
83-
Fastlane::FastFile.new.parse(lane).runner.execute(lane_name.to_sym)
85+
Fastlane::FastFile.new.parse(lane).runner.execute(:test)
8486
end
8587

8688
# Executes the given block within an ad hoc temporary directory.

0 commit comments

Comments
 (0)