debian-mirror-gitlab/spec/support/helpers/rake_helpers.rb

21 lines
514 B
Ruby
Raw Permalink Normal View History

2019-10-12 21:52:04 +05:30
# frozen_string_literal: true
2017-08-17 22:00:37 +05:30
module RakeHelpers
def run_rake_task(task_name, *args)
Rake::Task[task_name].reenable
Rake.application.invoke_task("#{task_name}[#{args.join(',')}]")
end
def stub_warn_user_is_not_gitlab
2018-03-17 18:26:18 +05:30
allow(main_object).to receive(:warn_user_is_not_gitlab)
2017-08-17 22:00:37 +05:30
end
2017-09-10 17:25:29 +05:30
2018-11-08 19:23:39 +05:30
def silence_progress_bar
2019-03-02 22:35:43 +05:30
allow_any_instance_of(ProgressBar::Output).to receive(:stream).and_return(double.as_null_object)
2018-11-08 19:23:39 +05:30
end
2018-03-17 18:26:18 +05:30
def main_object
@main_object ||= TOPLEVEL_BINDING.eval('self')
2017-09-10 17:25:29 +05:30
end
2017-08-17 22:00:37 +05:30
end