PageRenderTime 40ms CodeModel.GetById 1ms RepoModel.GetById 0ms app.codeStats 0ms

/vendor/gems/facets-2.4.5/test/core/kernel/test_tap.rb

https://bitbucket.org/mediashelf/fedora-migrator
Ruby | 19 lines | 15 code | 4 blank | 0 comment | 0 complexity | d9bd0274555d62cac16296dda145d953 MD5 | raw file
Possible License(s): GPL-3.0, GPL-2.0, IPL-1.0, AGPL-1.0, LGPL-3.0
  1. require 'facets/kernel/tap'
  2. require 'test/unit'
  3. class TestKernelTap < Test::Unit::TestCase
  4. def test_tap
  5. x = "foo"
  6. r = ("foobar".tap{ gsub!(/bar/, '') })
  7. assert_equal(x, r)
  8. end
  9. def test_tap_array
  10. x = [1,2,3]
  11. x.tap{ |a|
  12. assert_equal(x, a)
  13. }
  14. end
  15. end