Sha256: 5321bc0337400425359b7ed00b68f2a75a86869e2bed64e9be0b06777cc4a959

Contents?: true

Size: 725 Bytes

Versions: 8

Compression:

Stored size: 725 Bytes

Contents

require_relative '../../test_helper'

DuckPuncher.punch! :String

class StringTest < MiniTest::Test
  def test_pluralize
    assert_equal 'hour'.pluralize(1), 'hour'
    assert_equal 'hour'.pluralize(0), 'hours'
    assert_equal 'hour'.pluralize(2), 'hours'
  end

  def test_underscore
    assert_equal 'MiniTest'.underscore, 'mini_test'
    assert_equal 'MiniTestDoItToIt'.underscore, 'mini_test_do_it_to_it'
    assert_equal 'MiniTest::Helper'.underscore, 'mini_test/helper'
    assert_equal 'MiniTest::Helper::Expectations'.underscore, 'mini_test/helper/expectations'
    assert_equal 'mini_test.rb', 'mini_test.rb'.underscore
    assert_equal 'duck_puncher/json_storage', 'DuckPuncher::JSONStorage'.underscore
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
duck_puncher-2.14.0 test/lib/duck_puncher/string_test.rb
duck_puncher-2.13.0 test/lib/duck_puncher/string_test.rb
duck_puncher-2.12.1 test/lib/duck_puncher/string_test.rb
duck_puncher-2.12.0 test/lib/duck_puncher/string_test.rb
duck_puncher-2.11.0 test/lib/duck_puncher/string_test.rb
duck_puncher-2.10.2 test/lib/duck_puncher/string_test.rb
duck_puncher-2.10.1 test/lib/duck_puncher/string_test.rb
duck_puncher-2.10.0 test/lib/duck_puncher/string_test.rb