Sha256: bde464eab83ce067663e5ef36443a50679bfda656eb92d78e9768c1004205125

Contents?: true

Size: 1.01 KB

Versions: 31

Compression:

Stored size: 1.01 KB

Contents

# frozen_string_literal: true
namespace :active_mocker do
  desc("Rebuild mocks.")
  task build: :environment do
    ActiveMocker.configure do |c|
      c.single_model_path             = ENV["MODEL"] if ENV["MODEL"]
      c.model_dir                     = ENV["MODEL_DIR"] if ENV["MODEL_DIR"]
      c.mock_dir                      = ENV["MOCK_DIR"] if ENV["MOCK_DIR"]
      c.progress_bar                  = false if ENV["MUTE_PROGRESS_BAR"]
      c.error_verbosity               = ENV["ERROR_VERBOSITY"].to_i if ENV["ERROR_VERBOSITY"]
      c.disable_modules_and_constants = false
    end.create_mocks
  end

  desc("Run all tests tagged   active_mocker")
  task :test do
    sh "rspec --tag active_mocker"
  end

  desc("Run all tests tagged active_mocker and rails_compatible and will disable model stubbing")
  task :rails_compatible do
    sh "RUN_WITH_RAILS=1 rspec --tag rails_compatible"
  end
end

["db:migrate", "db:rollback"].each do |task|
  Rake::Task[task].enhance do
    Rake::Task["active_mocker:build"].invoke
  end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
active_mocker-2.6.2 lib/active_mocker/task.rake
active_mocker-2.6.1.beta2 lib/active_mocker/task.rake
active_mocker-2.6.1.beta lib/active_mocker/task.rake
active_mocker-2.6.0 lib/active_mocker/task.rake
active_mocker-2.5.4 lib/active_mocker/task.rake
active_mocker-2.5.3 lib/active_mocker/task.rake
active_mocker-2.5.2 lib/active_mocker/task.rake
active_mocker-2.5.1 lib/active_mocker/task.rake
active_mocker-2.5.1.pre lib/active_mocker/task.rake
active_mocker-2.5.0 lib/active_mocker/task.rake
active_mocker-2.4.4 lib/active_mocker/task.rake
active_mocker-2.4.3 lib/active_mocker/task.rake
active_mocker-2.4.2 lib/active_mocker/task.rake
active_mocker-2.4.1 lib/active_mocker/task.rake
active_mocker-2.4.0 lib/active_mocker/task.rake
active_mocker-2.4.0.pre5 lib/active_mocker/task.rake
active_mocker-2.3.4 lib/active_mocker/task.rake
active_mocker-2.4.0.pre4 lib/active_mocker/task.rake
active_mocker-2.4.0.pre3 lib/active_mocker/task.rake
active_mocker-2.4.0.pre2 lib/active_mocker/task.rake