1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Merge pull request #11932 from gaurish/skip-encoding-convertor

[JRuby] Skip few of the ActiveSupport's inflector test cases

Conflicts:
	activesupport/test/abstract_unit.rb
This commit is contained in:
Rafael Mendonça França 2013-08-21 14:49:03 -03:00
commit 7a31388682
2 changed files with 16 additions and 0 deletions

View file

@ -25,6 +25,12 @@ Thread.abort_on_exception = true
# Show backtraces for deprecated behavior for quicker cleanup. # Show backtraces for deprecated behavior for quicker cleanup.
ActiveSupport::Deprecation.debug = true ActiveSupport::Deprecation.debug = true
# Skips the current run on Rubinius using Minitest::Assertions#skip
def rubinius_skip(message = '') def rubinius_skip(message = '')
skip message if RUBY_ENGINE == 'rbx' skip message if RUBY_ENGINE == 'rbx'
end end
# Skips the current run on JRuby using Minitest::Assertions#skip
def jruby_skip(message = '')
skip message if RUBY_ENGINE == 'jruby'
end

View file

@ -230,25 +230,35 @@ class InflectorTest < ActiveSupport::TestCase
end end
end end
# FIXME: get following tests to pass on jruby, currently skipped
#
# Currently this fails because ActiveSupport::Multibyte::Unicode#tidy_bytes
# required a specific Encoding::Converter(UTF-8 to UTF8-MAC) which unavailable on JRuby
# causing our tests to error out.
# related bug http://jira.codehaus.org/browse/JRUBY-7194
def test_parameterize def test_parameterize
jruby_skip "UTF-8 to UTF8-MAC Converter is unavailable"
StringToParameterized.each do |some_string, parameterized_string| StringToParameterized.each do |some_string, parameterized_string|
assert_equal(parameterized_string, ActiveSupport::Inflector.parameterize(some_string)) assert_equal(parameterized_string, ActiveSupport::Inflector.parameterize(some_string))
end end
end end
def test_parameterize_and_normalize def test_parameterize_and_normalize
jruby_skip "UTF-8 to UTF8-MAC Converter is unavailable"
StringToParameterizedAndNormalized.each do |some_string, parameterized_string| StringToParameterizedAndNormalized.each do |some_string, parameterized_string|
assert_equal(parameterized_string, ActiveSupport::Inflector.parameterize(some_string)) assert_equal(parameterized_string, ActiveSupport::Inflector.parameterize(some_string))
end end
end end
def test_parameterize_with_custom_separator def test_parameterize_with_custom_separator
jruby_skip "UTF-8 to UTF8-MAC Converter is unavailable"
StringToParameterizeWithUnderscore.each do |some_string, parameterized_string| StringToParameterizeWithUnderscore.each do |some_string, parameterized_string|
assert_equal(parameterized_string, ActiveSupport::Inflector.parameterize(some_string, '_')) assert_equal(parameterized_string, ActiveSupport::Inflector.parameterize(some_string, '_'))
end end
end end
def test_parameterize_with_multi_character_separator def test_parameterize_with_multi_character_separator
jruby_skip "UTF-8 to UTF8-MAC Converter is unavailable"
StringToParameterized.each do |some_string, parameterized_string| StringToParameterized.each do |some_string, parameterized_string|
assert_equal(parameterized_string.gsub('-', '__sep__'), ActiveSupport::Inflector.parameterize(some_string, '__sep__')) assert_equal(parameterized_string.gsub('-', '__sep__'), ActiveSupport::Inflector.parameterize(some_string, '__sep__'))
end end