Sha256: 26936788d9bdaf2cec41cc73205deef52f96ba9e0e5dd39024daaafd434b7738

Contents?: true

Size: 690 Bytes

Versions: 12

Compression:

Stored size: 690 Bytes

Contents

# encoding: utf-8

require 'spec_helper'
require 'ice_nine/support/recursion_guard'

describe IceNine::RecursionGuard::Frozen, '#guard' do
  subject { object.guard(object_arg) { return_value } }

  let(:object)       { IceNine::RecursionGuard::Frozen.new }
  let(:object_arg)   { Object.new                          }
  let(:return_value) { double('return_value')              }

  context 'when the object_arg is not frozen' do
    it 'returns the expected value' do
      should be(return_value)
    end
  end

  context 'when the object_arg is frozen' do
    before do
      object_arg.freeze
    end

    it 'returns the expected value' do
      should be(object_arg)
    end
  end
end

Version data entries

12 entries across 10 versions & 4 rubygems

Version Path
cm-admin-1.5.22 vendor/bundle/ruby/3.3.0/gems/ice_nine-0.11.2/spec/unit/ice_nine/recursion_guard/frozen/guard_spec.rb
cm-admin-1.5.21 vendor/bundle/ruby/3.3.0/gems/ice_nine-0.11.2/spec/unit/ice_nine/recursion_guard/frozen/guard_spec.rb
cm-admin-1.5.20 vendor/bundle/ruby/3.3.0/gems/ice_nine-0.11.2/spec/unit/ice_nine/recursion_guard/frozen/guard_spec.rb
grape-extra_validators-2.0.0 vendor/bundle/ruby/2.6.0/gems/ice_nine-0.11.2/spec/unit/ice_nine/recursion_guard/frozen/guard_spec.rb
grape-extra_validators-1.0.0 vendor/bundle/ruby/2.4.0/gems/ice_nine-0.11.2/spec/unit/ice_nine/recursion_guard/frozen/guard_spec.rb
config_gems_initialization_aim-0.1.4 vendor/bundle/ruby/2.5.0/gems/ice_nine-0.11.2/spec/unit/ice_nine/recursion_guard/frozen/guard_spec.rb
config_gems_initialization_aim-0.1.4 vendor/bundle/ruby/2.5.0/gems/config_gems_initialization_aim-0.1.1/vendor/bundle/ruby/2.5.0/gems/ice_nine-0.11.2/spec/unit/ice_nine/recursion_guard/frozen/guard_spec.rb
config_gems_initialization_aim-0.1.3 vendor/bundle/ruby/2.5.0/gems/ice_nine-0.11.2/spec/unit/ice_nine/recursion_guard/frozen/guard_spec.rb
config_gems_initialization_aim-0.1.3 vendor/bundle/ruby/2.5.0/gems/config_gems_initialization_aim-0.1.1/vendor/bundle/ruby/2.5.0/gems/ice_nine-0.11.2/spec/unit/ice_nine/recursion_guard/frozen/guard_spec.rb
ice_nine-0.11.2 spec/unit/ice_nine/recursion_guard/frozen/guard_spec.rb
ice_nine-0.11.1 spec/unit/ice_nine/recursion_guard/frozen/guard_spec.rb
ice_nine-0.11.0 spec/unit/ice_nine/recursion_guard/frozen/guard_spec.rb