Commit ea2424d3 authored by KOBAYASHI Shuji's avatar KOBAYASHI Shuji

Drop test dependency from `mruby-hash-ext` to `mruby-enumerator`

parent 1cc0180a
......@@ -4,5 +4,4 @@ MRuby::Gem::Specification.new('mruby-hash-ext') do |spec|
spec.summary = 'Hash class extension'
spec.add_dependency 'mruby-enum-ext', core: 'mruby-enum-ext'
spec.add_dependency 'mruby-array-ext', core: 'mruby-array-ext'
spec.add_test_dependency 'mruby-enumerator', core: 'mruby-enumerator'
end
......@@ -269,10 +269,8 @@ assert("Hash#transform_keys") do
h.transform_keys{|k| k+"!"})
assert_equal({1 => 100, 2 => 200},
h.transform_keys{|k|k.to_i})
assert_equal({"1.0" => 100, "2.1" => 200},
h.transform_keys.with_index{|k, i| "#{k}.#{i}"})
assert_equal(h, h.transform_keys!{|k|k.to_i})
assert_equal(h, {1 => 100, 2 => 200})
assert_same(h, h.transform_keys!{|k|k.to_i})
assert_equal({1 => 100, 2 => 200}, h)
end
assert("Hash#transform_values") do
......@@ -281,9 +279,7 @@ assert("Hash#transform_values") do
h.transform_values{|v| v * v + 1})
assert_equal({a: "1", b: "2", c: "3"},
h.transform_values{|v|v.to_s})
assert_equal({a: "1.0", b: "2.1", c: "3.2"},
h.transform_values.with_index{|v, i| "#{v}.#{i}"})
assert_equal(h, h.transform_values!{|v|v.to_s})
assert_same(h, h.transform_values!{|v|v.to_s})
assert_equal({a: "1", b: "2", c: "3"}, h)
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment