Skip to content

Commit

Permalink
reinstate 1.8.7 troublemakers in the regular test suite. hat tip [if …
Browse files Browse the repository at this point in the history
…it works] to nathan sutton.
  • Loading branch information
rsl committed Nov 28, 2012
1 parent 99f56df commit 5f9c979
Showing 1 changed file with 7 additions and 21 deletions.
28 changes: 7 additions & 21 deletions test/string_extensions_test.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# encoding: UTF-8
$KCODE = "U"

require "test/unit"

Expand Down Expand Up @@ -87,32 +88,17 @@ def test_to_url
"either-or",
"La Maison d`Uliva" =>
"la-maison-duliva",
"カッページ・テラスに日系カフェ&バー、店内にDJブースも - シンガポール経済新聞" =>
"katupeziterasuniri-xi-kahue-and-ba-dian-nei-nidjbusumo-singaporujing-ji-xin-wen",
"AVアンプ、ホームシアターシステム、スピーカーシステム等" =>
"avanpu-homusiatasisutemu-supikasisutemudeng",
"У лукоморья дуб зеленый" =>
"u-lukomoria-dub-zielienyi"
}.each do |html, plain|
assert_equal plain, html.to_url
end
end

def tests_that_only_pass_on_travis_for_1_9
if RUBY_VERSION.include?('1.9')
{
"カッページ・テラスに日系カフェ&バー、店内にDJブースも - シンガポール経済新聞" =>
"katupeziterasuniri-xi-kahue-and-ba-dian-nei-nidjbusumo-singaporujing-ji-xin-wen",
"AVアンプ、ホームシアターシステム、スピーカーシステム等" =>
"avanpu-homusiatasisutemu-supikasisutemudeng",
"У лукоморья дуб зеленый" =>
"u-lukomoria-dub-zielienyi"
}.each do |html, plain|
assert_equal plain, html.to_url
end
else
message = "\n-----\n"
message << "Skipping a few transliteration tests that for some reason fail on Travis-CI for the latest 1.8.7, which I cannot install for some reason on my Mac. "
message << "If you can run these tests AND they fail for you AND you care to help debug what the problem is, please let me know at sconds@gmail.com. Thanks."
message << "\n-----"
puts message
end
end

def test_to_url_with_excludes
assert_equal "So Fucking Special", "So Fucking Special".to_url(:exclude => "So Fucking Special")
end
Expand Down

0 comments on commit 5f9c979

Please sign in to comment.