cucumber 0.1.8 → 0.1.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (155) hide show
  1. data/History.txt +86 -3
  2. data/Manifest.txt +93 -44
  3. data/Rakefile +5 -1
  4. data/bin/cucumber +1 -0
  5. data/cucumber.yml +1 -1
  6. data/examples/calculator_ruby_features/features/{steps → step_definitons}/calculator_steps.rb +0 -0
  7. data/examples/cs/features/{steps → step_definitons}/hello_steps.rb +0 -0
  8. data/examples/cs/features/{steps → step_definitons}/tree_steps.rb +0 -0
  9. data/examples/i18n/README.textile +18 -0
  10. data/examples/i18n/Rakefile +16 -0
  11. data/examples/i18n/ar/Rakefile +6 -0
  12. data/examples/i18n/ar/features/addition.feature +17 -0
  13. data/examples/i18n/ar/features/step_definitons/calculator_steps.rb +31 -0
  14. data/examples/i18n/ar/lib/calculator.rb +10 -0
  15. data/examples/i18n/da/Rakefile +6 -0
  16. data/examples/{danish_calculator/features/steps → i18n/da/features/step_definitons}/kalkulator_steps.rb +0 -0
  17. data/examples/{danish_calculator → i18n/da}/features/summering.feature +1 -1
  18. data/examples/{danish_calculator → i18n/da}/lib/kalkulator.rb +0 -0
  19. data/examples/{swedish_calculator → i18n/en}/Rakefile +1 -1
  20. data/examples/{calculator → i18n/en}/features/addition.feature +0 -0
  21. data/examples/{calculator → i18n/en}/features/division.feature +0 -0
  22. data/examples/{calculator/features/steps → i18n/en/features/step_definitons}/calculator_steps.rb +0 -0
  23. data/examples/{calculator → i18n/en}/lib/calculator.rb +0 -2
  24. data/examples/i18n/es/Rakefile +6 -0
  25. data/examples/{spanish_calculator → i18n/es}/features/adicion.feature +1 -1
  26. data/examples/{spanish_calculator/features/steps → i18n/es/features/step_definitons}/calculador_steps.rb +0 -0
  27. data/examples/{spanish_calculator/lib/Calculador.rb → i18n/es/lib/calculador.rb} +0 -0
  28. data/examples/i18n/et/Rakefile +6 -0
  29. data/examples/i18n/et/features/liitmine.feature +17 -0
  30. data/examples/{estonian_calculator/features → i18n/et/features/step_definitions}/kalkulaator_steps.rb +2 -11
  31. data/examples/i18n/et/lib/kalkulaator.rb +10 -0
  32. data/examples/i18n/fr/Rakefile +6 -0
  33. data/examples/{calculatrice_francaise_avec_soit_scenario → i18n/fr}/features/addition.feature +0 -0
  34. data/examples/{calculatrice_francaise_avec_soit_scenario/features → i18n/fr/features/step_definitions}/calculatrice_steps.rb +2 -11
  35. data/examples/i18n/fr/lib/calculatrice.rb +10 -0
  36. data/examples/i18n/id/Rakefile +6 -0
  37. data/examples/i18n/id/features/addition.feature +17 -0
  38. data/examples/i18n/id/features/division.feature +10 -0
  39. data/examples/i18n/id/features/step_definitons/calculator_steps.rb +31 -0
  40. data/examples/i18n/id/lib/calculator.rb +14 -0
  41. data/examples/i18n/it/Rakefile +6 -0
  42. data/examples/i18n/it/features/somma.feature +10 -0
  43. data/examples/i18n/it/features/step_definitons/calcolatrice_steps.rb +22 -0
  44. data/examples/i18n/it/lib/calcolatrice.rb +11 -0
  45. data/examples/{calculator → i18n/ja}/README.txt +0 -0
  46. data/examples/i18n/ja/Rakefile +6 -0
  47. data/examples/i18n/ja/features/addition.feature +17 -0
  48. data/examples/i18n/ja/features/division.feature +10 -0
  49. data/examples/i18n/ja/features/step_definitons/calculator_steps.rb +30 -0
  50. data/examples/i18n/ja/lib/calculator.rb +14 -0
  51. data/examples/i18n/no/Rakefile +6 -0
  52. data/examples/{norwegian_calculator/features/steps → i18n/no/features/step_definitons}/kalkulator_steps.rb +0 -0
  53. data/examples/{norwegian_calculator → i18n/no}/features/summering.feature +0 -0
  54. data/examples/{norwegian_calculator → i18n/no}/lib/kalkulator.rb +0 -0
  55. data/examples/i18n/pt/Rakefile +6 -0
  56. data/examples/{portuguese_calculator → i18n/pt}/features/adicao.feature +0 -0
  57. data/examples/{portuguese_calculator/features → i18n/pt/features/step_definitions}/calculadora_steps.rb +2 -11
  58. data/examples/i18n/pt/lib/calculadora.rb +10 -0
  59. data/examples/i18n/ro/Rakefile +6 -0
  60. data/examples/i18n/ro/features/step_definitons/calculator_steps.rb +22 -0
  61. data/examples/i18n/ro/features/suma.feature +10 -0
  62. data/examples/i18n/ro/lib/calculator.rb +11 -0
  63. data/examples/i18n/se/Rakefile +6 -0
  64. data/examples/{swedish_calculator/features/steps → i18n/se/features/step_definitons}/kalkulator_steps.rb +0 -0
  65. data/examples/{swedish_calculator → i18n/se}/features/summering.feature +0 -0
  66. data/examples/{swedish_calculator → i18n/se}/lib/kalkulator.rb +0 -0
  67. data/examples/i18n/zh-CN/Rakefile +6 -0
  68. data/examples/{chinese_simplified_calculator → i18n/zh-CN}/features/addition.feature +0 -0
  69. data/examples/{chinese_simplified_calculator/features/steps → i18n/zh-CN/features/step_definitons}/calculator_steps.rb +0 -0
  70. data/examples/{chinese_simplified_calculator → i18n/zh-CN}/lib/calculator.rb +0 -0
  71. data/examples/java/features/{steps → step_definitons}/hello_steps.rb +0 -0
  72. data/examples/java/features/{steps → step_definitons}/tree_steps.rb +0 -0
  73. data/examples/selenium/features/{steps → step_definitons}/stories_steps.rb +0 -0
  74. data/examples/tickets/features/{steps → step_definitons}/tickets_steps.rb +0 -0
  75. data/examples/watir/features/search.feature +2 -2
  76. data/examples/watir/features/{steps → step_definitons}/stories_steps.rb +0 -0
  77. data/gem_tasks/treetop.rake +1 -9
  78. data/lib/autotest/cucumber.rb +6 -0
  79. data/lib/autotest/cucumber_mixin.rb +109 -0
  80. data/lib/autotest/cucumber_rails.rb +6 -0
  81. data/lib/autotest/cucumber_rails_rspec.rb +6 -0
  82. data/lib/autotest/cucumber_rspec.rb +6 -0
  83. data/lib/autotest/discover.rb +9 -0
  84. data/lib/cucumber.rb +4 -0
  85. data/lib/cucumber/broadcaster.rb +20 -0
  86. data/lib/cucumber/cli.rb +139 -48
  87. data/lib/cucumber/core_ext/proc.rb +2 -3
  88. data/lib/cucumber/executor.rb +59 -32
  89. data/lib/cucumber/formatters.rb +1 -1
  90. data/lib/cucumber/formatters/ansicolor.rb +3 -4
  91. data/lib/cucumber/formatters/autotest_formatter.rb +23 -0
  92. data/lib/cucumber/formatters/pretty_formatter.rb +99 -42
  93. data/lib/cucumber/formatters/progress_formatter.rb +21 -5
  94. data/lib/cucumber/languages.yml +125 -10
  95. data/lib/cucumber/rails/world.rb +1 -1
  96. data/lib/cucumber/rake/task.rb +52 -26
  97. data/lib/cucumber/step_mother.rb +7 -1
  98. data/lib/cucumber/tree/feature.rb +8 -6
  99. data/lib/cucumber/tree/scenario.rb +34 -15
  100. data/lib/cucumber/tree/step.rb +3 -1
  101. data/lib/cucumber/treetop_parser/feature.treetop.erb +15 -10
  102. data/lib/cucumber/treetop_parser/feature_ar.rb +1591 -0
  103. data/lib/cucumber/treetop_parser/feature_cy.rb +1591 -0
  104. data/lib/cucumber/treetop_parser/feature_da.rb +238 -240
  105. data/lib/cucumber/treetop_parser/feature_de.rb +238 -240
  106. data/lib/cucumber/treetop_parser/feature_en-tx.rb +1591 -0
  107. data/lib/cucumber/treetop_parser/feature_en.rb +238 -240
  108. data/lib/cucumber/treetop_parser/feature_es.rb +238 -240
  109. data/lib/cucumber/treetop_parser/feature_et.rb +238 -240
  110. data/lib/cucumber/treetop_parser/feature_fr.rb +238 -240
  111. data/lib/cucumber/treetop_parser/feature_id.rb +1591 -0
  112. data/lib/cucumber/treetop_parser/feature_it.rb +1591 -0
  113. data/lib/cucumber/treetop_parser/feature_ja.rb +1591 -0
  114. data/lib/cucumber/treetop_parser/feature_nl.rb +238 -240
  115. data/lib/cucumber/treetop_parser/feature_no.rb +238 -240
  116. data/lib/cucumber/treetop_parser/feature_pl.rb +1591 -0
  117. data/lib/cucumber/treetop_parser/feature_pt.rb +238 -240
  118. data/lib/cucumber/treetop_parser/feature_ro.rb +1591 -0
  119. data/lib/cucumber/treetop_parser/feature_ro2.rb +1591 -0
  120. data/lib/cucumber/treetop_parser/feature_ru.rb +238 -240
  121. data/lib/cucumber/treetop_parser/feature_se.rb +238 -240
  122. data/lib/cucumber/treetop_parser/feature_zh-CN.rb +238 -240
  123. data/lib/cucumber/version.rb +1 -1
  124. data/rails_generators/cucumber/USAGE +11 -0
  125. data/rails_generators/cucumber/cucumber_generator.rb +9 -6
  126. data/rails_generators/cucumber/templates/cucumber +6 -1
  127. data/rails_generators/cucumber/templates/{common_webrat.rb → webrat_steps.rb} +4 -0
  128. data/rails_generators/feature/USAGE +12 -0
  129. data/rails_generators/feature/feature_generator.rb +3 -4
  130. data/spec/cucumber/broadcaster_spec.rb +27 -0
  131. data/spec/cucumber/cli_spec.rb +211 -23
  132. data/spec/cucumber/executor_spec.rb +104 -14
  133. data/spec/cucumber/formatters/ansicolor_spec.rb +9 -1
  134. data/spec/cucumber/formatters/autotest_formatter_spec.rb +26 -0
  135. data/spec/cucumber/formatters/pretty_formatter_spec.rb +119 -26
  136. data/spec/cucumber/formatters/profile_formatter_spec.rb +1 -2
  137. data/spec/cucumber/formatters/progress_formatter_spec.rb +22 -1
  138. data/spec/cucumber/sell_cucumbers.feature +10 -0
  139. data/spec/cucumber/step_mother_spec.rb +21 -0
  140. data/spec/cucumber/tree/row_scenario_spec.rb +25 -0
  141. data/spec/cucumber/tree/scenario_spec.rb +47 -8
  142. data/spec/cucumber/tree/step_spec.rb +19 -0
  143. data/spec/cucumber/treetop_parser/feature_parser_spec.rb +2 -0
  144. data/spec/cucumber/treetop_parser/multiline_steps.feature +7 -3
  145. data/spec/spec_helper.rb +2 -0
  146. metadata +97 -48
  147. data/examples/calculator/Rakefile +0 -5
  148. data/examples/calculatrice_francaise_avec_soit_scenario/Rakefile +0 -6
  149. data/examples/chinese_simplified_calculator/Rakefile +0 -6
  150. data/examples/danish_calculator/Rakefile +0 -6
  151. data/examples/estonian_calculator/Rakefile +0 -6
  152. data/examples/estonian_calculator/features/liitmine.feature +0 -16
  153. data/examples/norwegian_calculator/Rakefile +0 -6
  154. data/examples/portuguese_calculator/Rakefile +0 -6
  155. data/examples/spanish_calculator/Rakefile +0 -6
@@ -0,0 +1,10 @@
1
+ class Calculator
2
+ def push(n)
3
+ @args ||= []
4
+ @args << n
5
+ end
6
+
7
+ def جمع
8
+ @args.inject(0){|n,sum| sum+=n}
9
+ end
10
+ end
@@ -0,0 +1,6 @@
1
+ $:.unshift(File.dirname(__FILE__) + '/../../../lib')
2
+ require 'cucumber/rake/task'
3
+
4
+ Cucumber::Rake::Task.new do |t|
5
+ t.cucumber_opts = "--language da"
6
+ end
@@ -14,4 +14,4 @@ Egenskab: Summering
14
14
  Og at jeg har indtastet 7
15
15
  Og at jeg har indtastet 1
16
16
  Når jeg summerer
17
- Så skal resultatet være 14
17
+ Så skal resultatet være 13
@@ -1,5 +1,5 @@
1
+ $:.unshift(File.dirname(__FILE__) + '/../../../lib')
1
2
  require 'cucumber/rake/task'
2
3
 
3
4
  Cucumber::Rake::Task.new do |t|
4
- t.cucumber_opts = "--format pretty --language se"
5
5
  end
@@ -1,7 +1,5 @@
1
1
  class Calculator
2
2
  def push(n)
3
- n += 2 if n == 0 # a really stupid bug
4
-
5
3
  @args ||= []
6
4
  @args << n
7
5
  end
@@ -0,0 +1,6 @@
1
+ $:.unshift(File.dirname(__FILE__) + '/../../../lib')
2
+ require 'cucumber/rake/task'
3
+
4
+ Cucumber::Rake::Task.new do |t|
5
+ t.cucumber_opts = "--language es"
6
+ end
@@ -14,4 +14,4 @@ Característica: adición
14
14
  Y he introducido 7
15
15
  Y he introducido 1
16
16
  Cuando añado
17
- Entonces el resultado debe ser 14
17
+ Entonces el resultado debe ser 13
@@ -0,0 +1,6 @@
1
+ $:.unshift(File.dirname(__FILE__) + '/../../../lib')
2
+ require 'cucumber/rake/task'
3
+
4
+ Cucumber::Rake::Task.new do |t|
5
+ t.cucumber_opts = "--language et"
6
+ 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
+ Stsenaarium: Liida kaks numbrit
7
+ Eeldades et olen sisestanud kalkulaatorisse numbri 50
8
+ Ja olen sisestanud kalkulaatorisse numbri 70
9
+ Kui ma vajutan liida
10
+ Siis vastuseks peab ekraanil kuvatama 120
11
+ Ja vastuseklass peab olema tüüpi Fixnum
12
+
13
+ More Examples:
14
+ | input_1 | input_2 | button | output | class |
15
+ | 20 | 30 | liida | 50 | Fixnum |
16
+ | 2 | 5 | liida | 7 | Fixnum |
17
+ | 0 | 40 | liida | 40 | Fixnum |
@@ -1,15 +1,6 @@
1
1
  require 'spec'
2
-
3
- class Kalkulaator
4
- def push(n)
5
- @args ||= []
6
- @args << n
7
- end
8
-
9
- def liida
10
- @args.inject(0) {|n,sum| sum+n}
11
- end
12
- end
2
+ $:.unshift(File.dirname(__FILE__) + '/../../lib')
3
+ require 'kalkulaator'
13
4
 
14
5
  Before do
15
6
  @calc = Kalkulaator.new
@@ -0,0 +1,10 @@
1
+ class Kalkulaator
2
+ def push(n)
3
+ @args ||= []
4
+ @args << n
5
+ end
6
+
7
+ def liida
8
+ @args.inject(0) {|n,sum| sum+n}
9
+ end
10
+ end
@@ -0,0 +1,6 @@
1
+ $:.unshift(File.dirname(__FILE__) + '/../../../lib')
2
+ require 'cucumber/rake/task'
3
+
4
+ Cucumber::Rake::Task.new do |t|
5
+ t.cucumber_opts = "--language fr"
6
+ end
@@ -1,15 +1,6 @@
1
1
  require 'spec'
2
-
3
- class Calulatrice
4
- def push(n)
5
- @args ||= []
6
- @args << n
7
- end
8
-
9
- def additionner
10
- @args.inject(0){|n,sum| sum+=n}
11
- end
12
- end
2
+ $:.unshift(File.dirname(__FILE__) + '/../../lib')
3
+ require 'calculatrice'
13
4
 
14
5
  Before do
15
6
  @calc = Calulatrice.new
@@ -0,0 +1,10 @@
1
+ class Calulatrice
2
+ def push(n)
3
+ @args ||= []
4
+ @args << n
5
+ end
6
+
7
+ def additionner
8
+ @args.inject(0){|n,sum| sum+=n}
9
+ end
10
+ end
@@ -0,0 +1,6 @@
1
+ $:.unshift(File.dirname(__FILE__) + '/../../../lib')
2
+ require 'cucumber/rake/task'
3
+
4
+ Cucumber::Rake::Task.new do |t|
5
+ t.cucumber_opts = "--language id"
6
+ end
@@ -0,0 +1,17 @@
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: Menjumlahkan dua bilangan
7
+ Dengan aku sudah masukkan 50 ke kalkulator
8
+ Dan aku sudah masukkan 70 ke kalkulator
9
+ Ketika aku tekan add
10
+ Maka hasilnya harus 120 di layar
11
+ Dan class hasilnya harus Fixnum
12
+
13
+ Contoh Tambahan:
14
+ | input_1 | input_2 | button | output | class |
15
+ | 20 | 30 | add | 50 | Fixnum |
16
+ | 2 | 5 | add | 7 | Fixnum |
17
+ | 0 | 40 | add | 40 | Fixnum |
@@ -0,0 +1,10 @@
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
10
+ Dan class hasilnya harus Float
@@ -0,0 +1,31 @@
1
+ require 'spec'
2
+ $:.unshift(File.dirname(__FILE__) + '/../../lib')
3
+ require 'calculator'
4
+
5
+ Before do
6
+ @calc = Calculator.new
7
+ end
8
+
9
+ After do
10
+ end
11
+
12
+ Given "aku sudah masukkan $n ke kalkulator" do |n|
13
+ @calc.push n.to_i
14
+ end
15
+
16
+ When /aku tekan (\w+)/ do |op|
17
+ @result = @calc.send op
18
+ end
19
+
20
+ Then /hasilnya harus (.*) di layar/ do |result|
21
+ @result.should == result.to_f
22
+ end
23
+
24
+ Then /class hasilnya harus (\w*)/ do |class_name|
25
+ @result.class.name.should == class_name
26
+ end
27
+
28
+ Given /it should rain on (\w+)/ do |day|
29
+ @calc.rain?(day).should == true
30
+ end
31
+
@@ -0,0 +1,14 @@
1
+ class Calculator
2
+ def push(n)
3
+ @args ||= []
4
+ @args << n
5
+ end
6
+
7
+ def add
8
+ @args.inject(0){|n,sum| sum+=n}
9
+ end
10
+
11
+ def divide
12
+ @args[0].to_f / @args[1].to_f
13
+ end
14
+ end
@@ -0,0 +1,6 @@
1
+ $:.unshift(File.dirname(__FILE__) + '/../../../lib')
2
+ require 'cucumber/rake/task'
3
+
4
+ Cucumber::Rake::Task.new do |t|
5
+ t.cucumber_opts = "--language it"
6
+ end
@@ -0,0 +1,10 @@
1
+ Funzionalità: somma
2
+ Per evitare di fare errori stupidi
3
+ Come utente
4
+ Voglio sapere la somma di due numeri
5
+
6
+ Scenario: la somma di due numeri
7
+ Dato che ho inserito 5
8
+ E che ho inserito 7
9
+ Quando premo somma
10
+ Allora il risultato deve essere 12
@@ -0,0 +1,22 @@
1
+ require 'spec'
2
+ $:.unshift(File.dirname(__FILE__) + '/../../lib')
3
+ require 'calcolatrice'
4
+
5
+ Before do
6
+ @calc = Calcolatrice.new
7
+ end
8
+
9
+ After do
10
+ end
11
+
12
+ Given /che ho inserito (\d+)/ do |n|
13
+ @calc.push n.to_i
14
+ end
15
+
16
+ When 'premo somma' do
17
+ @result = @calc.add
18
+ end
19
+
20
+ Then /il risultato deve essere (\d*)/ do |result|
21
+ @result.should == result.to_i
22
+ end
@@ -0,0 +1,11 @@
1
+ class Calcolatrice
2
+ def push(n)
3
+ @args ||= []
4
+ @args << n
5
+ end
6
+
7
+ def add
8
+ #@args[0] + @args[1]
9
+ @args.inject(0){|n,sum| sum+=n}
10
+ end
11
+ end
@@ -0,0 +1,6 @@
1
+ $:.unshift(File.dirname(__FILE__) + '/../../../lib')
2
+ require 'cucumber/rake/task'
3
+
4
+ Cucumber::Rake::Task.new do |t|
5
+ t.cucumber_opts = "--language ja"
6
+ end
@@ -0,0 +1,17 @@
1
+ フィーチャ: 加算
2
+ バカな間違いを避けるために
3
+ 数学オンチとして
4
+ 2つの数の合計を知りたい
5
+
6
+ シナリオ: 2つの数の加算について
7
+ 前提 50 を入力
8
+ かつ 70 を入力
9
+ もし add ボタンを押した
10
+ ならば 結果は 120 を表示
11
+ かつ 結果のクラスは Fixnum
12
+
13
+ 他のサンプル:
14
+ | 入力1 | 入力2 | 実行 | 表示 | クラス |
15
+ | 20 | 30 | add | 50 | Fixnum |
16
+ | 2 | 5 | add | 7 | Fixnum |
17
+ | 0 | 40 | add | 40 | Fixnum |
@@ -0,0 +1,10 @@
1
+ フィーチャ: 除算
2
+ バカな間違いを避けるために
3
+ 有理数も計算できること
4
+
5
+ シナリオ: ふつうの数値
6
+ 前提 3 を入力
7
+ かつ 2 を入力
8
+ もし divide ボタンを押した
9
+ ならば 結果は 1.5 を表示
10
+ かつ 結果のクラスは Float
@@ -0,0 +1,30 @@
1
+ require 'spec'
2
+ $:.unshift(File.dirname(__FILE__) + '/../../lib')
3
+ require 'calculator'
4
+
5
+ Before do
6
+ @calc = Calculator.new
7
+ end
8
+
9
+ After do
10
+ end
11
+
12
+ Given "$n を入力" do |n|
13
+ @calc.push n.to_i
14
+ end
15
+
16
+ When /(\w+) ボタンを押した/ do |op|
17
+ @result = @calc.send op
18
+ end
19
+
20
+ Then /結果は (.*) を表示/ do |result|
21
+ @result.should == result.to_f
22
+ end
23
+
24
+ Then /結果のクラスは (\w*)/ do |class_name|
25
+ @result.class.name.should == class_name
26
+ end
27
+
28
+ Given /it should rain on (\w+)/ do |day|
29
+ @calc.rain?(day).should == true
30
+ end
@@ -0,0 +1,14 @@
1
+ class Calculator
2
+ def push(n)
3
+ @args ||= []
4
+ @args << n
5
+ end
6
+
7
+ def add
8
+ @args.inject(0){|n,sum| sum+=n}
9
+ end
10
+
11
+ def divide
12
+ @args[0].to_f / @args[1].to_f
13
+ end
14
+ end
@@ -0,0 +1,6 @@
1
+ $:.unshift(File.dirname(__FILE__) + '/../../../lib')
2
+ require 'cucumber/rake/task'
3
+
4
+ Cucumber::Rake::Task.new do |t|
5
+ t.cucumber_opts = "--language no"
6
+ end
@@ -0,0 +1,6 @@
1
+ $:.unshift(File.dirname(__FILE__) + '/../../../lib')
2
+ require 'cucumber/rake/task'
3
+
4
+ Cucumber::Rake::Task.new do |t|
5
+ t.cucumber_opts = "--language pt"
6
+ end
@@ -1,15 +1,6 @@
1
1
  require 'spec'
2
-
3
- class Calculadora
4
- def push(n)
5
- @args ||= []
6
- @args << n
7
- end
8
-
9
- def soma
10
- @args.inject(0) {|n,sum| sum+n}
11
- end
12
- end
2
+ $:.unshift(File.dirname(__FILE__) + '/../../lib')
3
+ require 'calculadora'
13
4
 
14
5
  Before do
15
6
  @calc = Calculadora.new
@@ -0,0 +1,10 @@
1
+ class Calculadora
2
+ def push(n)
3
+ @args ||= []
4
+ @args << n
5
+ end
6
+
7
+ def soma
8
+ @args.inject(0) {|n,sum| sum+n}
9
+ end
10
+ end