A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.gitlab.com/development/testing_guide/testing_rake_tasks/ below:

Testing Rake tasks | GitLab Docs

Help us learn about your current experience with the documentation.

Take the survey

.

Testing Rake tasks

To make testing Rake tasks a little easier:

By doing so, RakeHelpers is included which exposes a run_rake_task(<task>) method to make executing tasks possible.

See spec/support/helpers/rake_helpers.rb for all available methods.

$stdout can be redirected by adding :silence_stdout.

Example:

require 'spec_helper'

describe 'gitlab:shell rake tasks', :silence_stdout do
  before do
    Rake.application.rake_require 'tasks/gitlab/shell'

    stub_warn_user_is_not_gitlab
  end

 describe 'install task' do
    it 'invokes create_hooks task' do
      expect(Rake::Task['gitlab:shell:create_hooks']).to receive(:invoke)

      run_rake_task('gitlab:shell:install')
    end
  end
end

Return to Testing documentation


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4