Sha256: 108adffe5bd6efd65b8fd5fe746a0ba724552c5a1b53b3753702a81d30be6e53

Contents?: true

Size: 929 Bytes

Versions: 1

Compression:

Stored size: 929 Bytes

Contents

require File.expand_path('../test_helper', __FILE__)

module Loquor
  class RepresenationTest < Minitest::Test
    def test_is_accessible_as_a_hash
      representation = Representation.new({foo: "bar"})
      assert_equal "bar", representation[:foo]
    end

    def test_hash_symbol_keys_are_accessible_as_strings
      representation = Representation.new({foo: "bar"})
      assert_equal "bar", representation["foo"]
    end

    def test_hash_string_keys_are_accessible_as_symbols
      representation = Representation.new({"foo" => "bar"})
      assert_equal "bar", representation[:foo]
    end

    def test_hash_keys_are_accessible_as_orignals
      representation = Representation.new({1 => "bar"})
      assert_equal "bar", representation[1]
    end

    def test_hash_keys_are_accessible_via_methods
      representation = Representation.new({foo: "bar"})
      assert_equal "bar", representation.foo
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
loquor-0.2.0 test/representation_test.rb