Module: Deep::Etest

Defined in:
lib/vex/base/enumerable/deep.rb

Instance Method Summary collapse

Instance Method Details

#test_camelized_keysObject


84
85
86
87
88
# File 'lib/vex/base/enumerable/deep.rb', line 84

def test_camelized_keys
  h = { :a => "a", :b_c => { :d => "dd", :video_test => "video_test "}}
  expected = { "A"=>"a", "BC" => { "VideoTest" => "video_test ", "D" => "dd" }}
  assert_equal(expected, h.camelize)
end

#test_missin_blockObject


90
91
92
93
94
# File 'lib/vex/base/enumerable/deep.rb', line 90

def test_missin_block
  assert_raise(LocalJumpError) {
    Deep.reject(%w(1 2), 3)
  }
end

#test_reject_blanksObject


78
79
80
81
82
# File 'lib/vex/base/enumerable/deep.rb', line 78

def test_reject_blanks
  h = { :a => "a", :b_c => { :d => nil, :video_test => "video_test "}, "x" => nil, "y" => [] }
  expected = { :a=>"a", :b_c => { :video_test => "video_test " }}
  assert_equal(expected, h.reject_blanks)
end