-
-
Notifications
You must be signed in to change notification settings - Fork 695
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of git://github.com/tavon/cucumber
- Loading branch information
Showing
7 changed files
with
88 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
features.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
28
examples/i18n/ko/features/step_definitons/calculator_steps.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters