Sha256: fd2aeeba8f45b033a00d68add02769c29465660af8ab706529dd37da1bfd233a

Contents?: true

Size: 715 Bytes

Versions: 17

Compression:

Stored size: 715 Bytes

Contents

require_relative '../test_helper'

module Generator
  class UnderscoreTest < MiniTest::Test
    using Underscore

    # at present, we're downcasing everything, including TLAs
    def test_mixed_case
      assert_equal 'A string with TLA'.underscore, 'a_string_with_tla'
    end

    def test_hyphenated_text
      assert_equal 'large distance in off-by-one strand'.underscore, 'large_distance_in_off_by_one_strand'
    end

    def test_question_mark
      assert_equal(
        'Unreadable but correctly sized inputs return ?'.underscore,
        'unreadable_but_correctly_sized_inputs_return_?'
      )
    end

    def test_fixnum_underscore
      assert_equal '1_000_000', 1000000.underscore
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
trackler-2.1.0.36 tracks/ruby/test/generator/underscore_test.rb
trackler-2.1.0.34 tracks/ruby/test/generator/underscore_test.rb
trackler-2.1.0.33 tracks/ruby/test/generator/underscore_test.rb
trackler-2.1.0.32 tracks/ruby/test/generator/underscore_test.rb
trackler-2.1.0.31 tracks/ruby/test/generator/underscore_test.rb
trackler-2.1.0.30 tracks/ruby/test/generator/underscore_test.rb
trackler-2.1.0.29 tracks/ruby/test/generator/underscore_test.rb
trackler-2.1.0.28 tracks/ruby/test/generator/underscore_test.rb
trackler-2.1.0.27 tracks/ruby/test/generator/underscore_test.rb
trackler-2.1.0.26 tracks/ruby/test/generator/underscore_test.rb
trackler-2.1.0.25 tracks/ruby/test/generator/underscore_test.rb
trackler-2.1.0.24 tracks/ruby/test/generator/underscore_test.rb
trackler-2.1.0.23 tracks/ruby/test/generator/underscore_test.rb
trackler-2.1.0.22 tracks/ruby/test/generator/underscore_test.rb
trackler-2.1.0.21 tracks/ruby/test/generator/underscore_test.rb
trackler-2.1.0.20 tracks/ruby/test/generator/underscore_test.rb
trackler-2.1.0.19 tracks/ruby/test/generator/underscore_test.rb