gitlab-org--gitlab-foss/spec/support/helpers/rake_helpers.rb
Rémy Coutable 023d4f6f2f
Move spec helpers/matchers/shared examples/contexts to their relevant folder
Signed-off-by: Rémy Coutable <remy@rymai.me>
2018-04-23 12:20:30 +02:00

19 lines
459 B
Ruby

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
allow(main_object).to receive(:warn_user_is_not_gitlab)
end
def silence_output
allow(main_object).to receive(:puts)
allow(main_object).to receive(:print)
end
def main_object
@main_object ||= TOPLEVEL_BINDING.eval('self')
end
end