Skip to content

Commit

Permalink
Merge branch 'master' of git://github.com/tavon/cucumber
Browse files Browse the repository at this point in the history
  • Loading branch information
aslakhellesoy committed Jan 5, 2009
2 parents 40b49e1 + 84f6547 commit 114fe56
Show file tree
Hide file tree
Showing 7 changed files with 88 additions and 0 deletions.
1 change: 1 addition & 0 deletions examples/i18n/ko/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
features.html
6 changes: 6 additions & 0 deletions examples/i18n/ko/Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
$:.unshift(File.dirname(__FILE__) + '/../../../lib')
require 'cucumber/rake/task'

Cucumber::Rake::Task.new do |t|
t.cucumber_opts = "--language ko"
end
17 changes: 17 additions & 0 deletions examples/i18n/ko/features/addition.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
기능: 덧셈
어이없는 실수을 방지하기 위해
수학을 잘 못하는 사람으로써
두숫자의 합을 알고 싶다

: 두 숫자를 더하기
조건 계산기에 50을 입력했음
그리고 계산기에 70을 입력했음
만일 내가 add를 누루면
그러면 화면에 출력된 결과는 120이다
그리고 결과의 class는 Fixnum이다

다른 예:
| 입력1 | 입력2 | 버튼 | 결과 | class |
| 20 | 30 | add | 50 | Fixnum |
| 2 | 5 | add | 7 | Fixnum |
| 0 | 40 | add | 40 | Fixnum |
11 changes: 11 additions & 0 deletions examples/i18n/ko/features/division.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
기능: 나눗셈
어이없는 실수을 방지하기 위해
분수를 계산 능력 요구한다

: 보통 숫자
조건 계산기에 3을 입력했음
그리고 계산기에 2을 입력했음
만일 내가 divide를 누루면
그러면 화면에 출력된 결과는 1.5이다
그리고 결과의 class는 Float이다

28 changes: 28 additions & 0 deletions examples/i18n/ko/features/step_definitons/calculator_steps.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# encoding: utf-8
require 'spec/expectations'
$:.unshift(File.dirname(__FILE__) + '/../../lib')
require 'cucumber/formatters/unicode'
require 'calculator'

Before do
@calc = Calculator.new
end

After do
end

Given /^계산기에 (.*)을 입력했음$/ do |n|
@calc.push n.to_i
end

When /^내가 (.*)를 누루면$/ do |op|
@result = @calc.send op
end

Then /^화면에 출력된 결과는 (.*)이다$/ do |result|
@result.should == result.to_f
end

Then /^결과의 class는 (.*)이다$/ do |class_name|
@result.class.name.should == class_name
end
14 changes: 14 additions & 0 deletions examples/i18n/ko/lib/calculator.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
class Calculator
def push(n)
@args ||= []
@args << n
end

def add
@args.inject(0){|n,sum| sum+=n}
end

def divide
@args[0].to_f / @args[1].to_f
end
end
11 changes: 11 additions & 0 deletions lib/cucumber/languages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -258,3 +258,14 @@
then: 那么
and: 而且
but: 但是
# Korean
"ko":
feature: 기능
scenario:
more_examples: 다른 예
given_scenario: 주어진 예
given: 조건
when: 만일
then: 그러면
and: 그리고
but: 하지만

0 comments on commit 114fe56

Please sign in to comment.