Sha256: 89601f31ca60cf5dc5de1d7da2b9817e652db2afcd24002ceafa15303b37a08f

Contents?: true

Size: 651 Bytes

Versions: 61

Compression:

Stored size: 651 Bytes

Contents

require 'ostruct'
require 'foreman_tasks_test_helper'

module ForemanTasks
  class LockTest < ::ActiveSupport::TestCase
    describe ::ForemanTasks::Lock::LockConflict do
      class FakeLockConflict < ForemanTasks::Lock::LockConflict
        def _(val)
          val.freeze
        end
      end

      it 'does not modify frozen strings' do
        required_lock = OpenStruct.new(:name => 'my_lock')
        # Before #21770 the next line would raise
        #   RuntimeError: can't modify frozen String
        conflict = FakeLockConflict.new(required_lock, [])
        assert conflict._('this should be frozen').frozen?
      end
    end
  end
end

Version data entries

61 entries across 61 versions & 1 rubygems

Version Path
foreman-tasks-3.0.6 test/unit/lock_test.rb
foreman-tasks-3.0.5 test/unit/lock_test.rb
foreman-tasks-3.0.4 test/unit/lock_test.rb
foreman-tasks-2.0.3 test/unit/lock_test.rb
foreman-tasks-3.0.3 test/unit/lock_test.rb
foreman-tasks-3.0.2 test/unit/lock_test.rb
foreman-tasks-3.0.1 test/unit/lock_test.rb
foreman-tasks-3.0.0 test/unit/lock_test.rb
foreman-tasks-2.0.2 test/unit/lock_test.rb
foreman-tasks-1.1.3 test/unit/lock_test.rb
foreman-tasks-1.1.2 test/unit/lock_test.rb
foreman-tasks-2.0.1 test/unit/lock_test.rb
foreman-tasks-2.0.0 test/unit/lock_test.rb
foreman-tasks-1.2.0 test/unit/lock_test.rb
foreman-tasks-1.1.1 test/unit/lock_test.rb
foreman-tasks-1.1.0 test/unit/lock_test.rb
foreman-tasks-0.17.6 test/unit/lock_test.rb
foreman-tasks-1.0.1 test/unit/lock_test.rb
foreman-tasks-1.0.0 test/unit/lock_test.rb
foreman-tasks-0.17.5 test/unit/lock_test.rb