Sha256: d9f915a5578d54319ebe26590382b4bb9a46eaab9ad52eb51d6d1b353b55c8ba

Contents?: true

Size: 599 Bytes

Versions: 23

Compression:

Stored size: 599 Bytes

Contents

require "rake"

shared_context "rake" do
  let(:rake)      { Rake::Application.new }
  let(:task_name) { self.class.top_level_description }
  let(:task_path) { "lib/tasks/#{task_name.split(":").first}" }
  subject         { rake[task_name] }

  def loaded_files_excluding_current_rake_file
$".reject {|file| file == Rails.root.join("#{task_path}.rake").to_s }
  end

  before do
    Rake.application = rake
    require 'pry'
    binding.pry
    Rake.application.rake_require(task_path, [Rails.root.to_s], loaded_files_excluding_current_rake_file)

    Rake::Task.define_task(:environment)
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
krikri-0.13.2 spec/support/shared_contexts/rake.rb~
krikri-0.13.1 spec/support/shared_contexts/rake.rb~
krikri-0.13.0 spec/support/shared_contexts/rake.rb~
krikri-0.12.4 spec/support/shared_contexts/rake.rb~
krikri-0.11.2 spec/support/shared_contexts/rake.rb~
krikri-0.11.1 spec/support/shared_contexts/rake.rb~
krikri-0.11.0 spec/support/shared_contexts/rake.rb~
krikri-0.10.1 spec/support/shared_contexts/rake.rb~
krikri-0.8.9 spec/support/shared_contexts/rake.rb~
krikri-0.8.8 spec/support/shared_contexts/rake.rb~
krikri-0.8.7 spec/support/shared_contexts/rake.rb~
krikri-0.8.6 spec/support/shared_contexts/rake.rb~
krikri-0.8.5 spec/support/shared_contexts/rake.rb~
krikri-0.8.4 spec/support/shared_contexts/rake.rb~
krikri-0.8.2 spec/support/shared_contexts/rake.rb~
krikri-0.8.0 spec/support/shared_contexts/rake.rb~
krikri-0.7.3 spec/support/shared_contexts/rake.rb~
krikri-0.7.2 spec/support/shared_contexts/rake.rb~
krikri-0.7.1 spec/support/shared_contexts/rake.rb~
krikri-0.6.0 spec/support/shared_contexts/rake.rb~