Skip to content

Commit

Permalink
test for base case
Browse files Browse the repository at this point in the history
  • Loading branch information
phoebejhhong committed May 31, 2015
1 parent ec8c38c commit a934b7e
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .rspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
--color
--require spec_helper
21 changes: 21 additions & 0 deletions spec/kana_hangul_app_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
require './app/app'

RSpec.describe KanaHangulApp, "#furigana" do
context "with kana bases" do
it "converts base kanas to furigana" do
app = KanaHangulApp.new
string = "色は匂へど 散りぬるを 我が世誰ぞ 常ならむ 有為の奥山 今日越えて 浅き夢見じ 酔ひもせず"
converted_string = app.convert_to_furigana(string)
expected_string = "しょくはにおへど ちりぬるを わがよだれぞ つねならむ ゆういのおくやま きょうこえて あさきゆめみじ すいひもせず"
expect(converted_string).to eq expected_string
end

it "converts base kanas to hangul" do
app = KanaHangulApp.new
string = "色は匂へど 散りぬるを 我が世誰ぞ 常ならむ 有為の奥山 今日越えて 浅き夢見じ 酔ひもせず"
converted_string = app.convert_kana_to_hangul(string)
expected_string = "쇼쿠하니오헤도 치리누루오 와가요다레조 츠네나라무 유우이노오쿠야마 쿄우코에테 아사키유메미지 스이히모세즈"
expect(converted_string).to eq expected_string
end
end
end
11 changes: 11 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

RSpec.configure do |config|
config.expect_with :rspec do |expectations|
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
end

config.mock_with :rspec do |mocks|
mocks.verify_partial_doubles = true
end

end

0 comments on commit a934b7e

Please sign in to comment.