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-0.17.4 test/unit/lock_test.rb
foreman-tasks-0.17.3 test/unit/lock_test.rb
foreman-tasks-0.17.2 test/unit/lock_test.rb
foreman-tasks-0.16.3 test/unit/lock_test.rb
foreman-tasks-0.17.1 test/unit/lock_test.rb
foreman-tasks-0.15.11 test/unit/lock_test.rb
foreman-tasks-0.16.2 test/unit/lock_test.rb
foreman-tasks-0.15.10 test/unit/lock_test.rb
foreman-tasks-0.16.1 test/unit/lock_test.rb
foreman-tasks-0.17.0 test/unit/lock_test.rb
foreman-tasks-0.15.9 test/unit/lock_test.rb
foreman-tasks-0.15.8 test/unit/lock_test.rb
foreman-tasks-0.14.6 test/unit/lock_test.rb
foreman-tasks-0.15.7 test/unit/lock_test.rb
foreman-tasks-0.16.0 test/unit/lock_test.rb
foreman-tasks-0.15.6 test/unit/lock_test.rb
foreman-tasks-0.15.5 test/unit/lock_test.rb
foreman-tasks-0.15.4 test/unit/lock_test.rb
foreman-tasks-0.15.3 test/unit/lock_test.rb
foreman-tasks-0.15.2 test/unit/lock_test.rb