mirror of
https://github.com/Shopify/liquid.git
synced 2026-10-03 09:05:13 -07:00
Update test/unit/static_registers_unit_test.rb
Co-authored-by: Dylan Thacker-Smith <[email protected]>
This commit is contained in:
co-authored by
Dylan Thacker-Smith
parent
f5011365f1
commit
40d75dd283
@@ -15,15 +15,10 @@ class StaticRegistersUnitTest < Minitest::Test
|
|||||||
assert_equal(33, static_register[:c])
|
assert_equal(33, static_register[:c])
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_get
|
def test_get_missing_key
|
||||||
static_register = StaticRegisters.new(a: 1, b: 2)
|
static_register = StaticRegisters.new
|
||||||
static_register[:b] = 22
|
|
||||||
static_register[:c] = 33
|
|
||||||
|
|
||||||
assert_equal(1, static_register[:a])
|
assert_nil(static_register[:missing])
|
||||||
assert_equal(22, static_register[:b])
|
|
||||||
assert_equal(33, static_register[:c])
|
|
||||||
assert_nil(static_register[:d])
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_delete
|
def test_delete
|
||||||
@@ -152,7 +147,6 @@ class StaticRegistersUnitTest < Minitest::Test
|
|||||||
static_register_1.static[:b] = 222
|
static_register_1.static[:b] = 222
|
||||||
static_register_1.static[:c] = 333
|
static_register_1.static[:c] = 333
|
||||||
|
|
||||||
assert_equal(222, static_register_2[:b])
|
assert_same(static_register_1.static, static_register_2.static)
|
||||||
assert_equal(333, static_register_2[:c])
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user