diff --git a/lib/hola.rb b/lib/hola.rb index 11183c3..b07421d 100644 --- a/lib/hola.rb +++ b/lib/hola.rb @@ -1,3 +1,5 @@ +# encoding: UTF-8 + class Hola def self.hi(language) translator = Translator.new(language) diff --git a/lib/hola/translator.rb b/lib/hola/translator.rb index a33abe6..8dce55d 100644 --- a/lib/hola/translator.rb +++ b/lib/hola/translator.rb @@ -1,3 +1,5 @@ +# encoding: UTF-8 + class Hola::Translator def initialize(language = "english") @language = language @@ -9,6 +11,8 @@ def hi "hola mundo" when "korean" "anyoung ha se yo" + when "polish" + "witaj świecie" else "hello world" end diff --git a/test/test_hola.rb b/test/test_hola.rb index 54d1b20..8250329 100644 --- a/test/test_hola.rb +++ b/test/test_hola.rb @@ -1,3 +1,5 @@ +# encoding: UTF-8 + require 'test/unit' require 'hola' @@ -13,4 +15,8 @@ def test_any_hello def test_spanish_hello assert_equal "hola mundo", Hola.hi("spanish") end + + def test_polish_hello + assert_equal "witaj świecie", Hola.hi("polish") + end end