Sha256: 6aba9fdc1a7233fd93b975da5f7f6dce1ea2b44492db66f7283a0a3bc3dee417

Contents?: true

Size: 658 Bytes

Versions: 12

Compression:

Stored size: 658 Bytes

Contents

require "rake"

# From https://robots.thoughtbot.com/test-rake-tasks-like-a-boss
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 == Pathname.new(RSpec.project_root).join("#{task_path}.rake").to_s }
  end

  before do
    Rake.application = rake
    Rake.application.rake_require(task_path, [RSpec.project_root], loaded_files_excluding_current_rake_file)
    Rake::Task.define_task(:environment)
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
cloudinary-1.13.0 spec/support/shared_contexts/rake.rb
cloudinary-1.12.0 spec/support/shared_contexts/rake.rb
cloudinary-1.11.1 spec/support/shared_contexts/rake.rb
cloudinary-1.11.0 spec/support/shared_contexts/rake.rb
cloudinary-1.10.1.pre.rc spec/support/shared_contexts/rake.rb
cloudinary-1.10.0 spec/support/shared_contexts/rake.rb
cloudinary-1.9.1 spec/support/shared_contexts/rake.rb
cloudinary-1.9.0 spec/support/shared_contexts/rake.rb
cloudinary-1.8.3 spec/support/shared_contexts/rake.rb
cloudinary-1.8.2 spec/support/shared_contexts/rake.rb
cloudinary-1.8.1 spec/support/shared_contexts/rake.rb
cloudinary-1.8.0 spec/support/shared_contexts/rake.rb