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.15.1 test/unit/lock_test.rb
foreman-tasks-0.15.0 test/unit/lock_test.rb
foreman-tasks-0.14.5 test/unit/lock_test.rb
foreman-tasks-0.14.4 test/unit/lock_test.rb
foreman-tasks-0.14.3 test/unit/lock_test.rb
foreman-tasks-0.14.2 test/unit/lock_test.rb
foreman-tasks-0.14.1 test/unit/lock_test.rb
foreman-tasks-0.11.3 test/unit/lock_test.rb
foreman-tasks-0.14.0 test/unit/lock_test.rb
foreman-tasks-0.13.4 test/unit/lock_test.rb
foreman-tasks-0.13.3 test/unit/lock_test.rb
foreman-tasks-0.13.2 test/unit/lock_test.rb
foreman-tasks-0.13.1 test/unit/lock_test.rb
foreman-tasks-0.13.0 test/unit/lock_test.rb
foreman-tasks-0.12.2 test/unit/lock_test.rb
foreman-tasks-0.11.2 test/unit/lock_test.rb
foreman-tasks-0.12.1 test/unit/lock_test.rb
foreman-tasks-0.12.0 test/unit/lock_test.rb
foreman-tasks-0.11.1 test/unit/lock_test.rb
foreman-tasks-0.10.9 test/unit/lock_test.rb