aslakhellesoy-cucumber 0.1.99.4 → 0.1.99.5
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +4 -1
- data/Manifest.txt +2 -10
- data/cucumber.yml +1 -0
- data/examples/cs/README.textile +1 -0
- data/examples/cs/Rakefile +12 -0
- data/examples/cs/compile.bat +1 -0
- data/examples/cs/features/addition.feature +16 -0
- data/examples/cs/features/step_definitons/calculator_steps.rb +19 -0
- data/examples/cs/src/demo/Calculator.cs +20 -0
- data/examples/dos_line_endings/Rakefile +6 -0
- data/examples/dos_line_endings/features/dos_line_endings.feature +9 -0
- data/examples/i18n/README.textile +18 -0
- data/examples/i18n/Rakefile +32 -0
- data/examples/i18n/ar/Rakefile +6 -0
- data/examples/i18n/ar/features/addition.feature +17 -0
- data/examples/i18n/ar/features/step_definitons/calculator_steps.rb +28 -0
- data/examples/i18n/ar/lib/calculator.rb +10 -0
- data/examples/i18n/da/Rakefile +6 -0
- data/examples/i18n/da/features/step_definitons/kalkulator_steps.rb +24 -0
- data/examples/i18n/da/features/summering.feature +17 -0
- data/examples/i18n/da/lib/kalkulator.rb +11 -0
- data/examples/i18n/de/Rakefile +6 -0
- data/examples/i18n/de/features/addition.feature +16 -0
- data/examples/i18n/de/features/division.feature +9 -0
- data/examples/i18n/de/features/step_definitons/calculator_steps.rb +24 -0
- data/examples/i18n/de/lib/calculator.rb +14 -0
- data/examples/i18n/en/Rakefile +6 -0
- data/examples/i18n/en/features/addition.feature +16 -0
- data/examples/i18n/en/features/division.feature +9 -0
- data/examples/i18n/en/features/step_definitons/calculator_steps.rb +24 -0
- data/examples/i18n/en/lib/calculator.rb +14 -0
- data/examples/i18n/es/Rakefile +6 -0
- data/examples/i18n/es/features/adicion.feature +17 -0
- data/examples/i18n/es/features/step_definitons/calculador_steps.rb +24 -0
- data/examples/i18n/es/lib/calculador.rb +11 -0
- data/examples/i18n/et/Rakefile +6 -0
- data/examples/i18n/et/features/liitmine.feature +17 -0
- data/examples/i18n/et/features/step_definitions/kalkulaator_steps.rb +24 -0
- data/examples/i18n/et/lib/kalkulaator.rb +10 -0
- data/examples/i18n/fi/Rakefile +6 -0
- data/examples/i18n/fi/features/jakolasku.feature +9 -0
- data/examples/i18n/fi/features/step_definitons/laskin_steps.rb +24 -0
- data/examples/i18n/fi/features/yhteenlasku.feature +16 -0
- data/examples/i18n/fi/lib/laskin.rb +14 -0
- data/examples/i18n/fr/Rakefile +6 -0
- data/examples/i18n/fr/features/addition.feature +15 -0
- data/examples/i18n/fr/features/step_definitions/calculatrice_steps.rb +27 -0
- data/examples/i18n/fr/lib/calculatrice.rb +10 -0
- data/examples/i18n/id/Rakefile +6 -0
- data/examples/i18n/id/features/addition.feature +16 -0
- data/examples/i18n/id/features/division.feature +9 -0
- data/examples/i18n/id/features/step_definitons/calculator_steps.rb +24 -0
- data/examples/i18n/id/lib/calculator.rb +14 -0
- data/examples/i18n/it/Rakefile +6 -0
- data/examples/i18n/it/features/somma.feature +10 -0
- data/examples/i18n/it/features/step_definitons/calcolatrice_steps.rb +24 -0
- data/examples/i18n/it/lib/calcolatrice.rb +11 -0
- data/examples/i18n/ja/README.txt +5 -0
- data/examples/i18n/ja/Rakefile +6 -0
- data/examples/i18n/ja/features/addition.feature +16 -0
- data/examples/i18n/ja/features/division.feature +9 -0
- data/examples/i18n/ja/features/step_definitons/calculator_steps.rb +24 -0
- data/examples/i18n/ja/lib/calculator.rb +14 -0
- data/examples/i18n/ko/Rakefile +6 -0
- data/examples/i18n/ko/features/addition.feature +16 -0
- data/examples/i18n/ko/features/division.feature +10 -0
- data/examples/i18n/ko/features/step_definitons/calculator_steps.rb +24 -0
- data/examples/i18n/ko/lib/calculator.rb +14 -0
- data/examples/i18n/lt/Rakefile +6 -0
- data/examples/i18n/lt/features/addition.feature +17 -0
- data/examples/i18n/lt/features/division.feature +9 -0
- data/examples/i18n/lt/features/step_definitons/calculator_steps.rb +24 -0
- data/examples/i18n/lt/lib/calculator.rb +14 -0
- data/examples/i18n/no/Rakefile +6 -0
- data/examples/i18n/no/features/step_definitons/kalkulator_steps.rb +24 -0
- data/examples/i18n/no/features/summering.feature +18 -0
- data/examples/i18n/no/lib/kalkulator.rb +11 -0
- data/examples/i18n/pt/Rakefile +6 -0
- data/examples/i18n/pt/features/adicao.feature +10 -0
- data/examples/i18n/pt/features/step_definitions/calculadora_steps.rb +24 -0
- data/examples/i18n/pt/lib/calculadora.rb +10 -0
- data/examples/i18n/ro/Rakefile +6 -0
- data/examples/i18n/ro/features/step_definitons/calculator_steps.rb +24 -0
- data/examples/i18n/ro/features/suma.feature +10 -0
- data/examples/i18n/ro/lib/calculator.rb +11 -0
- data/examples/i18n/se/Rakefile +6 -0
- data/examples/i18n/se/features/step_definitons/kalkulator_steps.rb +24 -0
- data/examples/i18n/se/features/summering.feature +17 -0
- data/examples/i18n/se/lib/kalkulator.rb +11 -0
- data/examples/i18n/zh-CN/Rakefile +6 -0
- data/examples/i18n/zh-CN/features/addition.feature +17 -0
- data/examples/i18n/zh-CN/features/step_definitons/calculator_steps.rb +26 -0
- data/examples/i18n/zh-CN/lib/calculator.rb +10 -0
- data/examples/java/README.textile +22 -0
- data/examples/java/Rakefile +12 -0
- data/examples/java/features/hello.feature +11 -0
- data/examples/java/features/step_definitons/hello_steps.rb +25 -0
- data/examples/java/features/step_definitons/tree_steps.rb +14 -0
- data/examples/java/features/tree.feature +9 -0
- data/examples/java/src/cucumber/demo/Hello.java +16 -0
- data/examples/jbehave/README.textile +17 -0
- data/examples/jbehave/features/support/env.rb +7 -0
- data/examples/jbehave/features/trading.feature +24 -0
- data/examples/jbehave/pom.xml +48 -0
- data/examples/jbehave/src/main/java/cukes/jbehave/examples/trader/converters/TraderConverter.java +32 -0
- data/examples/jbehave/src/main/java/cukes/jbehave/examples/trader/model/Stock.java +42 -0
- data/examples/jbehave/src/main/java/cukes/jbehave/examples/trader/model/Trader.java +29 -0
- data/examples/jbehave/src/main/java/cukes/jbehave/examples/trader/persistence/TraderPersister.java +22 -0
- data/examples/jbehave/src/main/java/cukes/jbehave/examples/trader/scenarios/TraderSteps.java +65 -0
- data/examples/selenium/Rakefile +6 -0
- data/examples/selenium/features/search.feature +9 -0
- data/examples/selenium/features/step_definitons/stories_steps.rb +40 -0
- data/examples/self_test/README.textile +6 -0
- data/examples/self_test/features/call_undefined_step_from_step_def.feature +7 -0
- data/examples/self_test/features/lots_of_undefined.feature +8 -0
- data/examples/self_test/features/outline_sample.feature +15 -0
- data/examples/self_test/features/sample.feature +16 -0
- data/examples/self_test/features/step_definitions/sample_steps.rb +25 -0
- data/examples/test_unit/Rakefile +6 -0
- data/examples/test_unit/features/step_definitions/test_unit_steps.rb +26 -0
- data/examples/test_unit/features/test_unit.feature +9 -0
- data/examples/tickets/Rakefile +11 -0
- data/examples/tickets/cucumber.yml +2 -0
- data/examples/tickets/features/lib/eatting_machine.rb +18 -0
- data/examples/tickets/features/lib/pantry.rb +20 -0
- data/examples/tickets/features/scenario_outline.feature +95 -0
- data/examples/tickets/features/step_definitons/scenario_outline_steps.rb +42 -0
- data/examples/tickets/features/step_definitons/tickets_steps.rb +60 -0
- data/examples/tickets/features/tickets.feature +28 -0
- data/examples/watir/README.textile +16 -0
- data/examples/watir/Rakefile +6 -0
- data/examples/watir/features/search.feature +9 -0
- data/examples/watir/features/step_definitons/search_steps.rb +24 -0
- data/examples/watir/features/support/env.rb +32 -0
- data/features/cucumber_cli.feature +331 -0
- data/features/cucumber_cli_outlines.feature +90 -0
- data/features/report_called_undefined_steps.feature +32 -0
- data/features/step_definitions/cucumber_steps.rb +31 -0
- data/features/step_definitions/extra_steps.rb +2 -0
- data/features/support/env.rb +7 -0
- data/gem_tasks/deployment.rake +11 -0
- data/gem_tasks/environment.rake +7 -0
- data/gem_tasks/features.rake +6 -0
- data/gem_tasks/fix_cr_lf.rake +10 -0
- data/gem_tasks/flog.rake +4 -0
- data/gem_tasks/gemspec.rake +10 -0
- data/gem_tasks/rspec.rake +35 -0
- data/gem_tasks/yard.rake +8 -0
- data/lib/autotest/cucumber.rb +6 -0
- data/lib/autotest/cucumber_mixin.rb +124 -0
- data/lib/autotest/cucumber_rails.rb +6 -0
- data/lib/autotest/cucumber_rails_rspec.rb +6 -0
- data/lib/autotest/cucumber_rspec.rb +6 -0
- data/lib/autotest/discover.rb +9 -0
- data/lib/cucumber.rb +72 -0
- data/lib/cucumber/ast.rb +27 -0
- data/lib/cucumber/ast/comment.rb +26 -0
- data/lib/cucumber/ast/examples.rb +22 -0
- data/lib/cucumber/ast/feature.rb +60 -0
- data/lib/cucumber/ast/features.rb +39 -0
- data/lib/cucumber/ast/filter.rb +22 -0
- data/lib/cucumber/ast/outline_table.rb +49 -0
- data/lib/cucumber/ast/py_string.rb +52 -0
- data/lib/cucumber/ast/scenario.rb +95 -0
- data/lib/cucumber/ast/scenario_outline.rb +83 -0
- data/lib/cucumber/ast/step.rb +139 -0
- data/lib/cucumber/ast/table.rb +214 -0
- data/lib/cucumber/ast/tags.rb +33 -0
- data/lib/cucumber/ast/visitor.rb +93 -0
- data/lib/cucumber/broadcaster.rb +15 -0
- data/lib/cucumber/cli.rb +414 -0
- data/lib/cucumber/core_ext/exception.rb +53 -0
- data/lib/cucumber/core_ext/instance_exec.rb +54 -0
- data/lib/cucumber/core_ext/proc.rb +33 -0
- data/lib/cucumber/core_ext/string.rb +48 -0
- data/lib/cucumber/formatter.rb +1 -0
- data/lib/cucumber/formatter/ansicolor.rb +106 -0
- data/lib/cucumber/formatter/console.rb +116 -0
- data/lib/cucumber/formatter/pretty.rb +158 -0
- data/lib/cucumber/formatter/profile.rb +77 -0
- data/lib/cucumber/formatter/progress.rb +68 -0
- data/lib/cucumber/formatter/rerun.rb +35 -0
- data/lib/cucumber/formatters/unicode.rb +2 -0
- data/lib/cucumber/jbehave.rb +104 -0
- data/lib/cucumber/languages.yml +314 -0
- data/lib/cucumber/parser.rb +24 -0
- data/lib/cucumber/parser/basic.rb +0 -0
- data/lib/cucumber/parser/feature.rb +1351 -0
- data/lib/cucumber/parser/feature.tt +160 -0
- data/lib/cucumber/parser/i18n.tt +27 -0
- data/lib/cucumber/parser/table.rb +396 -0
- data/lib/cucumber/parser/table.tt +53 -0
- data/lib/cucumber/parser/treetop_ext.rb +67 -0
- data/lib/cucumber/platform.rb +18 -0
- data/lib/cucumber/rails/rspec.rb +5 -0
- data/lib/cucumber/rails/world.rb +73 -0
- data/lib/cucumber/rake/task.rb +106 -0
- data/lib/cucumber/step_definition.rb +87 -0
- data/lib/cucumber/step_mother.rb +164 -0
- data/lib/cucumber/version.rb +10 -0
- data/pretty.txt +486 -0
- data/rails_generators/cucumber/USAGE +11 -0
- data/rails_generators/cucumber/cucumber_generator.rb +31 -0
- data/rails_generators/cucumber/templates/cucumber +8 -0
- data/rails_generators/cucumber/templates/cucumber.rake +7 -0
- data/rails_generators/cucumber/templates/env.rb +16 -0
- data/rails_generators/cucumber/templates/paths.rb +12 -0
- data/rails_generators/cucumber/templates/webrat_steps.rb +99 -0
- data/rails_generators/feature/USAGE +12 -0
- data/rails_generators/feature/feature_generator.rb +36 -0
- data/rails_generators/feature/templates/feature.erb +31 -0
- data/rails_generators/feature/templates/steps.erb +24 -0
- data/spec/cucumber/ast/feature_factory.rb +54 -0
- data/spec/cucumber/ast/feature_spec.rb +60 -0
- data/spec/cucumber/ast/py_string_spec.rb +40 -0
- data/spec/cucumber/ast/scenario_outline_spec.rb +64 -0
- data/spec/cucumber/ast/scenario_spec.rb +82 -0
- data/spec/cucumber/ast/step_spec.rb +45 -0
- data/spec/cucumber/ast/table_spec.rb +81 -0
- data/spec/cucumber/broadcaster_spec.rb +14 -0
- data/spec/cucumber/cli_spec.rb +416 -0
- data/spec/cucumber/core_ext/proc_spec.rb +37 -0
- data/spec/cucumber/core_ext/string_spec.rb +42 -0
- data/spec/cucumber/formatter/ansicolor_spec.rb +35 -0
- data/spec/cucumber/formatter/html/cucumber.css +37 -0
- data/spec/cucumber/formatter/html/cucumber.js +13 -0
- data/spec/cucumber/formatter/html/index.html +45 -0
- data/spec/cucumber/formatter/html/jquery-1.3.min.js +19 -0
- data/spec/cucumber/formatter/html/jquery.uitableedit.js +100 -0
- data/spec/cucumber/formatters/profile_formatter_spec.rb +198 -0
- data/spec/cucumber/parser/feature_parser_spec.rb +247 -0
- data/spec/cucumber/parser/table_parser_spec.rb +48 -0
- data/spec/cucumber/rails/stubs/mini_rails.rb +18 -0
- data/spec/cucumber/rails/stubs/test_help.rb +1 -0
- data/spec/cucumber/rails/world_spec.rb +11 -0
- data/spec/cucumber/sell_cucumbers.feature +19 -0
- data/spec/cucumber/step_definition_spec.rb +62 -0
- data/spec/cucumber/treetop_parser/empty_feature.feature +4 -0
- data/spec/cucumber/treetop_parser/empty_scenario.feature +9 -0
- data/spec/cucumber/treetop_parser/empty_scenario_outline.feature +3 -0
- data/spec/cucumber/treetop_parser/fit_scenario.feature +8 -0
- data/spec/cucumber/treetop_parser/given_scenario.feature +9 -0
- data/spec/cucumber/treetop_parser/invalid_scenario_outlines.feature +7 -0
- data/spec/cucumber/treetop_parser/multiline_steps.feature +17 -0
- data/spec/cucumber/treetop_parser/multiple_tables.feature +27 -0
- data/spec/cucumber/treetop_parser/scenario_outline.feature +16 -0
- data/spec/cucumber/treetop_parser/spaces.feature +12 -0
- data/spec/cucumber/treetop_parser/test_dos.feature +25 -0
- data/spec/cucumber/treetop_parser/with_comments.feature +10 -0
- data/spec/cucumber/treetop_parser/with_tags.feature +18 -0
- data/spec/cucumber/world/pending_spec.rb +47 -0
- data/spec/spec.opts +2 -0
- data/spec/spec_helper.rb +21 -0
- metadata +7 -1
@@ -0,0 +1,9 @@
|
|
1
|
+
Feature: Division
|
2
|
+
In order to avoid silly mistakes
|
3
|
+
Cashiers must be able to calculate a fraction
|
4
|
+
|
5
|
+
Scenario: Regular numbers
|
6
|
+
Given I have entered 3 into the calculator
|
7
|
+
And I have entered 2 into the calculator
|
8
|
+
When I press divide
|
9
|
+
Then the result should be 1.5 on the screen
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
require 'spec/expectations'
|
3
|
+
$:.unshift(File.dirname(__FILE__) + '/../../lib') # This line is not needed in your own project
|
4
|
+
require 'cucumber/formatters/unicode'
|
5
|
+
require 'calculator'
|
6
|
+
|
7
|
+
Before do
|
8
|
+
@calc = Calculator.new
|
9
|
+
end
|
10
|
+
|
11
|
+
After do
|
12
|
+
end
|
13
|
+
|
14
|
+
Given /I have entered (\d+) into the calculator/ do |n|
|
15
|
+
@calc.push n.to_i
|
16
|
+
end
|
17
|
+
|
18
|
+
When /I press (\w+)/ do |op|
|
19
|
+
@result = @calc.send op
|
20
|
+
end
|
21
|
+
|
22
|
+
Then /the result should be (.*) on the screen/ do |result|
|
23
|
+
@result.should == result.to_f
|
24
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
Característica: adición
|
2
|
+
Para evitar hacer errores tontos
|
3
|
+
Como contador
|
4
|
+
Quiero saber la suma de los números
|
5
|
+
|
6
|
+
Escenario: dos números
|
7
|
+
Dado que he introducido 5
|
8
|
+
Y he introducido 7
|
9
|
+
Cuando añado
|
10
|
+
Entonces el resultado debe ser 12
|
11
|
+
|
12
|
+
Escenario: tres números
|
13
|
+
Dado que he introducido 5
|
14
|
+
Y he introducido 7
|
15
|
+
Y he introducido 1
|
16
|
+
Cuando añado
|
17
|
+
Entonces el resultado debe ser 13
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
require 'spec/expectations'
|
3
|
+
$:.unshift(File.dirname(__FILE__) + '/../../lib') # This line is not needed in your own project
|
4
|
+
require 'cucumber/formatters/unicode'
|
5
|
+
require 'calculador'
|
6
|
+
|
7
|
+
Before do
|
8
|
+
@calc = Calculador.new
|
9
|
+
end
|
10
|
+
|
11
|
+
After do
|
12
|
+
end
|
13
|
+
|
14
|
+
Given /he introducido (\d+)/ do |n|
|
15
|
+
@calc.push n.to_i
|
16
|
+
end
|
17
|
+
|
18
|
+
When 'añado' do
|
19
|
+
@result = @calc.add
|
20
|
+
end
|
21
|
+
|
22
|
+
Then /el resultado debe ser (\d*)/ do |result|
|
23
|
+
@result.should == result.to_i
|
24
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
Omadus: Liitmine
|
2
|
+
Selleks et vältida rumalaid vigu
|
3
|
+
Olles matemaatika-puupea
|
4
|
+
Tahan et mulle öeldaks kahe numbri summa
|
5
|
+
|
6
|
+
# Someone please translate this in languages.yml
|
7
|
+
Scenario Outline: Liida kaks numbrit
|
8
|
+
Eeldades et olen sisestanud kalkulaatorisse numbri <input_1>
|
9
|
+
Ja olen sisestanud kalkulaatorisse numbri <input_2>
|
10
|
+
Kui ma vajutan <button>
|
11
|
+
Siis vastuseks peab ekraanil kuvatama <output>
|
12
|
+
|
13
|
+
Examples:
|
14
|
+
| input_1 | input_2 | button | output |
|
15
|
+
| 20 | 30 | liida | 50 |
|
16
|
+
| 2 | 5 | liida | 7 |
|
17
|
+
| 0 | 40 | liida | 40 |
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
require 'spec/expectations'
|
3
|
+
$:.unshift(File.dirname(__FILE__) + '/../../lib') # This line is not needed in your own project
|
4
|
+
require 'cucumber/formatters/unicode'
|
5
|
+
require 'kalkulaator'
|
6
|
+
|
7
|
+
Before do
|
8
|
+
@calc = Kalkulaator.new
|
9
|
+
end
|
10
|
+
|
11
|
+
After do
|
12
|
+
end
|
13
|
+
|
14
|
+
Given /olen sisestanud kalkulaatorisse numbri (\d+)/ do |n|
|
15
|
+
@calc.push n.to_i
|
16
|
+
end
|
17
|
+
|
18
|
+
When /ma vajutan (.*)/ do |op|
|
19
|
+
@result = @calc.send op
|
20
|
+
end
|
21
|
+
|
22
|
+
Then /vastuseks peab ekraanil kuvatama (\d*)/ do |result|
|
23
|
+
@result.should == result.to_i
|
24
|
+
end
|
@@ -0,0 +1,9 @@
|
|
1
|
+
Ominaisuus: Jakolasku
|
2
|
+
Välttyäkseen hölmöiltä virheiltä
|
3
|
+
Kassanhoitajan on voitava laskea osamäärä
|
4
|
+
|
5
|
+
Tapaus: Kokonaislukujen jakolasku
|
6
|
+
Oletetaan että olen syöttänyt laskimeen luvun 3
|
7
|
+
Ja että olen syöttänyt laskimeen luvun 2
|
8
|
+
Kun painan "jaa"
|
9
|
+
Niin laskimen ruudulla pitäisi näkyä tulos 1.5
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
require 'spec/expectations'
|
3
|
+
$:.unshift(File.dirname(__FILE__) + '/../../lib')
|
4
|
+
require 'cucumber/formatters/unicode'
|
5
|
+
require 'laskin'
|
6
|
+
|
7
|
+
Before do
|
8
|
+
@laskin = Laskin.new
|
9
|
+
end
|
10
|
+
|
11
|
+
After do
|
12
|
+
end
|
13
|
+
|
14
|
+
Given /että olen syöttänyt laskimeen luvun (\d+)/ do |n|
|
15
|
+
@laskin.pinoa n.to_i
|
16
|
+
end
|
17
|
+
|
18
|
+
When /painan "(\w+)"/ do |op|
|
19
|
+
@tulos = @laskin.send op
|
20
|
+
end
|
21
|
+
|
22
|
+
Then /laskimen ruudulla pitäisi näkyä tulos (.*)/ do |tulos|
|
23
|
+
@tulos.should == tulos.to_f
|
24
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
Ominaisuus: Yhteenlasku
|
2
|
+
Välttyäkseni hölmöiltä virheiltä
|
3
|
+
Koska olen laskutaidoton
|
4
|
+
Haluan että yhteenlaskut lasketaan puolestani
|
5
|
+
|
6
|
+
Tapausaihio: Kahden luvun summa
|
7
|
+
Oletetaan että olen syöttänyt laskimeen luvun 50
|
8
|
+
Ja että olen syöttänyt laskimeen luvun 70
|
9
|
+
Kun painan "summaa"
|
10
|
+
Niin laskimen ruudulla pitäisi näkyä tulos 120
|
11
|
+
|
12
|
+
Tapaukset:
|
13
|
+
| luku_1 | luku_2 | nappi | tulos |
|
14
|
+
| 20 | 30 | summaa | 50 |
|
15
|
+
| 2 | 5 | summaa | 7 |
|
16
|
+
| 0 | 40 | summaa | 40 |
|
@@ -0,0 +1,15 @@
|
|
1
|
+
Fonctionnalité: Addition
|
2
|
+
Afin de financer mon bonus avec l'argent des pigeons
|
3
|
+
En tant que trader
|
4
|
+
Je souhaite pouvoir additionner 2 chiffres
|
5
|
+
|
6
|
+
Scénario esquisse: Addition de produits dérivés
|
7
|
+
Etant donné que je tape 2
|
8
|
+
Et que je tape 1
|
9
|
+
Lorsque je tape additionner
|
10
|
+
Alors le résultat doit être 3
|
11
|
+
|
12
|
+
Exemples:
|
13
|
+
| a | b | sum |
|
14
|
+
| 2 | 2 | 4 |
|
15
|
+
| 2 | 3 | 5 |
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
require 'spec/expectations'
|
3
|
+
$:.unshift(File.dirname(__FILE__) + '/../../lib') # This line is not needed in your own project
|
4
|
+
require 'cucumber/formatters/unicode'
|
5
|
+
require 'calculatrice'
|
6
|
+
|
7
|
+
Before do
|
8
|
+
@calc = Calulatrice.new
|
9
|
+
end
|
10
|
+
|
11
|
+
After do
|
12
|
+
end
|
13
|
+
|
14
|
+
# Etant donné que je tape ...
|
15
|
+
Given /que je tape (\d+)/ do |n|
|
16
|
+
@calc.push n.to_i
|
17
|
+
end
|
18
|
+
|
19
|
+
# Lorsque je tape additionner
|
20
|
+
When 'je tape additionner' do
|
21
|
+
@result = @calc.additionner
|
22
|
+
end
|
23
|
+
|
24
|
+
# Alors le résultat doit être ...
|
25
|
+
Then /le résultat doit être (\d*)/ do |result|
|
26
|
+
@result.should == result.to_i
|
27
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
Fitur: Addition
|
2
|
+
Untuk menghindari kesalahan konyol
|
3
|
+
Sebagai orang yang gak bisa matematika
|
4
|
+
Aku ingin diberi tahu jumlah dua bilangan
|
5
|
+
|
6
|
+
Skenario konsep: Menjumlahkan dua bilangan
|
7
|
+
Dengan aku sudah masukkan <input_1> ke kalkulator
|
8
|
+
Dan aku sudah masukkan <input_2> ke kalkulator
|
9
|
+
Ketika aku tekan <button>
|
10
|
+
Maka hasilnya harus <output> di layar
|
11
|
+
|
12
|
+
Contoh:
|
13
|
+
| input_1 | input_2 | button | output |
|
14
|
+
| 20 | 30 | add | 50 |
|
15
|
+
| 2 | 5 | add | 7 |
|
16
|
+
| 0 | 40 | add | 40 |
|
@@ -0,0 +1,9 @@
|
|
1
|
+
Fitur: Division
|
2
|
+
Untuk hindari kesalahan konyol
|
3
|
+
Kasir harus dapat menghitung pembagian
|
4
|
+
|
5
|
+
Skenario: bilangan biasa
|
6
|
+
Dengan aku sudah masukkan 3 ke kalkulator
|
7
|
+
Dan aku sudah masukkan 2 ke kalkulator
|
8
|
+
Ketika aku tekan divide
|
9
|
+
Maka hasilnya harus 1.5 di layar
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
require 'spec/expectations'
|
3
|
+
$:.unshift(File.dirname(__FILE__) + '/../../lib') # This line is not needed in your own project
|
4
|
+
require 'cucumber/formatters/unicode'
|
5
|
+
require 'calculator'
|
6
|
+
|
7
|
+
Before do
|
8
|
+
@calc = Calculator.new
|
9
|
+
end
|
10
|
+
|
11
|
+
After do
|
12
|
+
end
|
13
|
+
|
14
|
+
Given /aku sudah masukkan (\d+) ke kalkulator/ do |n|
|
15
|
+
@calc.push n.to_i
|
16
|
+
end
|
17
|
+
|
18
|
+
When /aku tekan (\w+)/ do |op|
|
19
|
+
@result = @calc.send op
|
20
|
+
end
|
21
|
+
|
22
|
+
Then /hasilnya harus (.*) di layar/ do |result|
|
23
|
+
@result.should == result.to_f
|
24
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
require 'spec/expectations'
|
3
|
+
$:.unshift(File.dirname(__FILE__) + '/../../lib') # This line is not needed in your own project
|
4
|
+
require 'cucumber/formatters/unicode'
|
5
|
+
require 'calcolatrice'
|
6
|
+
|
7
|
+
Before do
|
8
|
+
@calc = Calcolatrice.new
|
9
|
+
end
|
10
|
+
|
11
|
+
After do
|
12
|
+
end
|
13
|
+
|
14
|
+
Given /che ho inserito (\d+)/ do |n|
|
15
|
+
@calc.push n.to_i
|
16
|
+
end
|
17
|
+
|
18
|
+
When 'premo somma' do
|
19
|
+
@result = @calc.add
|
20
|
+
end
|
21
|
+
|
22
|
+
Then /il risultato deve essere (\d*)/ do |result|
|
23
|
+
@result.should == result.to_i
|
24
|
+
end
|