Sha256: b34e300fa7ea323095f1d9329b315f17e0deef8c35e6fe1bee88a3271c98ea25

Contents?: true

Size: 1.07 KB

Versions: 4

Compression:

Stored size: 1.07 KB

Contents

module Tests
  module Shared
    module Properties
      def self.included(base)
        base.setup_with do |c|
          c.p1 = 'CONFIGURED P1'
          c.p2 = 2
          c.p3.p4 = 'CONFIGURED P3P4'
          c.p3.p5.p6 = %w(P3 P5 P6)
          c.p3.p5.p7 = { config: 'hash' }
          c.class = :class
          c.module = ->(a) { a }
          c.puts = Class
        end
      end

      def test_property
        assert_equal 'CONFIGURED P1', @configuration.p1
      end

      def test_nested_property
        assert_equal 'CONFIGURED P3P4', @configuration.p3.p4
      end

      def test_nested_hash_property
        assert_equal({ config: 'hash' }, @configuration.p3.p5.p7)
      end

      def test_keyword_property
        assert_equal :class, @configuration.class
      end

      def test_kernel_method_property
        assert_equal Class, @configuration.puts
      end

      def test_respond_to_property
        assert_respond_to @configuration, :p1
      end

      def test_respond_to_nested_property
        assert_respond_to @configuration.p3, :p4
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

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