/vendor/gems/facets-2.4.5/test/core/array/test_stackable.rb

https://bitbucket.org/mediashelf/fedora-migrator · Ruby · 22 lines · 14 code · 7 blank · 1 comment · 0 complexity · f258a301133b77498a789e9a06521fbc MD5 · raw file

  1. # Test facets/array/stackable.rb
  2. require 'facets/array/stackable.rb'
  3. require 'test/unit'
  4. class TestArray < Test::Unit::TestCase
  5. def test_poke
  6. a = [2,3]
  7. assert_equal( [1,2,3], a.poke(1) )
  8. assert_equal( [4,1,2,3], a.poke(4) )
  9. end
  10. def test_pull
  11. a = [1,2,3]
  12. assert_equal( 1, a.pull )
  13. assert_equal( [2,3], a )
  14. end
  15. end