Sha256: b948ac3d6843d9bebc66792cfda4ff19917d737f6400b08b8f21271167f57b9e

Contents?: true

Size: 562 Bytes

Versions: 31

Compression:

Stored size: 562 Bytes

Contents

require 'test/unit'
require 'test_helper'

class UtilTest < Test::Unit::TestCase

  def test_stringify
    assert_equal "", Rubber::Util::stringify(nil)
    assert_equal "hi", Rubber::Util::stringify("hi")
    assert_equal "1", Rubber::Util::stringify(1)
    assert_equal "3.4", Rubber::Util::stringify(3.4)
    assert_equal ["1", "2", "r"], Rubber::Util::stringify([1, 2, "r"])
    assert_equal({"1" => "2", "three" => "four"}, Rubber::Util::stringify({1 => 2, :three => "four"}))
    assert_equal [{"3" => "4"}], Rubber::Util::stringify([{3 => 4}])
  end

end

Version data entries

31 entries across 31 versions & 5 rubygems

Version Path
sml-rubber-0.9.1 test/util_test.rb
sml-rubber-0.9.10 test/util_test.rb
sml-rubber-0.9.11 test/util_test.rb
sml-rubber-0.9.13 test/util_test.rb
sml-rubber-0.9.3 test/util_test.rb
sml-rubber-0.9.4 test/util_test.rb
sml-rubber-0.9.5 test/util_test.rb
sml-rubber-0.9.6 test/util_test.rb
sml-rubber-0.9.7 test/util_test.rb
sml-rubber-0.9.8 test/util_test.rb
sml-rubber-0.9.9 test/util_test.rb
wr0ngway-rubber-1.0.0 test/util_test.rb
wr0ngway-rubber-1.0.1 test/util_test.rb
axtro-rubber-1.0.2.8 test/util_test.rb
axtro-rubber-1.0.2.7 test/util_test.rb
nirvdrum-rubber-1.1.7 test/util_test.rb
rubber-1.1.7 test/util_test.rb
rubber-1.1.6 test/util_test.rb
rubber-1.1.5 test/util_test.rb
rubber-1.1.4 test/util_test.rb