Sha256: 17cfc875fb6c0de2a00c7d1aef89af84d2feabd702c341b75e6fd30d9b279e5b

Contents?: true

Size: 604 Bytes

Versions: 4

Compression:

Stored size: 604 Bytes

Contents

require 'test_helper'

class TestStrictTypesWithBlocks < ConfigurationsTest
  shares_tests :properties, :properties_outside_block, :kernel_methods
  setup_with :strict_types_with_blocks

  def test_blocks
    @configuration.p2 = -2
    assert_equal 2, @configuration.p2
  end

  def test_blocks_come_after_typecheck
    assert_raises Configurations::ConfigurationError do
      @configuration.p3.p5.p6 = nil
    end
  end

  def test_set_nested_property_outside_block
    @configuration.p3.p5.p6 = %w(OUTSIDE BLOCK P3 P5 P6)
    assert_equal %w(P6 P5 P3 BLOCK OUTSIDE), @configuration.p3.p5.p6
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
configurations-2.2.2 test/configurations/strict_types_with_blocks/test.rb
configurations-2.2.1 test/configurations/strict_types_with_blocks/test.rb
configurations-2.2.0 test/configurations/strict_types_with_blocks/test.rb
configurations-2.0.0 test/configurations/strict_types_with_blocks/test.rb