Sha256: 9fed97724d0eeb3adc9763746275f13429f451f60c13febcc29472be53aac455

Contents?: true

Size: 805 Bytes

Versions: 25

Compression:

Stored size: 805 Bytes

Contents

require "spec_helper"
require "rake"
require "capistrano/immutable_task"

module Capistrano
  describe ImmutableTask do
    after do
      # Ensure that any tasks we create in these tests don't pollute other tests
      Rake::Task.clear
    end

    it "prints warning and raises when task is enhanced" do
      extend(Rake::DSL)

      load_defaults = Rake::Task.define_task("load:defaults")
      load_defaults.extend(Capistrano::ImmutableTask)

      $stderr.expects(:puts).with do |message|
        message =~ /^ERROR: load:defaults has already been invoked/
      end

      expect do
        namespace :load do
          task :defaults do
            # Never reached since load_defaults is frozen and can't be enhanced
          end
        end
      end.to raise_error(/frozen/i)
    end
  end
end

Version data entries

25 entries across 25 versions & 2 rubygems

Version Path
capistrano-3.19.2 spec/lib/capistrano/immutable_task_spec.rb
capistrano-3.19.1 spec/lib/capistrano/immutable_task_spec.rb
capistrano-3.19.0 spec/lib/capistrano/immutable_task_spec.rb
capistrano-3.18.1 spec/lib/capistrano/immutable_task_spec.rb
honeybadger-5.4.0 vendor/bundle/ruby/3.2.0/gems/capistrano-3.18.0/spec/lib/capistrano/immutable_task_spec.rb
honeybadger-5.3.0 vendor/bundle/ruby/3.2.0/gems/capistrano-3.18.0/spec/lib/capistrano/immutable_task_spec.rb
capistrano-3.18.0 spec/lib/capistrano/immutable_task_spec.rb
capistrano-3.17.3 spec/lib/capistrano/immutable_task_spec.rb
capistrano-3.17.2 spec/lib/capistrano/immutable_task_spec.rb
capistrano-3.17.1 spec/lib/capistrano/immutable_task_spec.rb
capistrano-3.17.0 spec/lib/capistrano/immutable_task_spec.rb
capistrano-3.16.0 spec/lib/capistrano/immutable_task_spec.rb
capistrano-3.15.0 spec/lib/capistrano/immutable_task_spec.rb
capistrano-3.14.1 spec/lib/capistrano/immutable_task_spec.rb
capistrano-3.14.0 spec/lib/capistrano/immutable_task_spec.rb
capistrano-3.13.0 spec/lib/capistrano/immutable_task_spec.rb
capistrano-3.12.1 spec/lib/capistrano/immutable_task_spec.rb
capistrano-3.12.0 spec/lib/capistrano/immutable_task_spec.rb
honeybadger-4.5.3 vendor/bundle/ruby/2.6.0/gems/capistrano-3.11.0/spec/lib/capistrano/immutable_task_spec.rb
capistrano-3.11.2 spec/lib/capistrano/immutable_task_spec.rb