Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added rspec and cucumber and all that testing gubbins

  • Loading branch information...
commit 0e204acdb601f1e4b567f40155c92ed6b5759fc8 1 parent b30ec32
@rahoulb rahoulb authored
Showing with 44,437 additions and 0 deletions.
  1. +1 −0  config/environment.rb
  2. +95 −0 features/step_definitions/webrat_steps.rb
  3. +8 −0 features/support/env.rb
  4. +7 −0 lib/tasks/cucumber.rake
  5. +153 −0 lib/tasks/rspec.rake
  6. +5 −0 script/autospec
  7. +7 −0 script/cucumber
  8. +5 −0 script/spec
  9. +116 −0 script/spec_server
  10. +2 −0  spec/rcov.opts
  11. +4 −0 spec/spec.opts
  12. +47 −0 spec/spec_helper.rb
  13. +1 −0  vendor/plugins/cucumber/.gitattributes
  14. +10 −0 vendor/plugins/cucumber/.gitignore
  15. +262 −0 vendor/plugins/cucumber/History.txt
  16. +20 −0 vendor/plugins/cucumber/License.txt
  17. +241 −0 vendor/plugins/cucumber/Manifest.txt
  18. +41 −0 vendor/plugins/cucumber/README.txt
  19. +9 −0 vendor/plugins/cucumber/Rakefile
  20. +26 −0 vendor/plugins/cucumber/TODO.txt
  21. +6 −0 vendor/plugins/cucumber/bin/cucumber
  22. +70 −0 vendor/plugins/cucumber/config/hoe.rb
  23. +15 −0 vendor/plugins/cucumber/config/requirements.rb
  24. +46 −0 vendor/plugins/cucumber/cucumber.gemspec
  25. +1 −0  vendor/plugins/cucumber/cucumber.yml
  26. +6 −0 vendor/plugins/cucumber/examples/calculator_ruby_features/Rakefile
  27. +23 −0 vendor/plugins/cucumber/examples/calculator_ruby_features/features/addition.rb
  28. +43 −0 vendor/plugins/cucumber/examples/calculator_ruby_features/features/step_definitons/calculator_steps.rb
  29. +22 −0 vendor/plugins/cucumber/examples/cs/README.textile
  30. +12 −0 vendor/plugins/cucumber/examples/cs/Rakefile
  31. +11 −0 vendor/plugins/cucumber/examples/cs/features/hello.feature
  32. +25 −0 vendor/plugins/cucumber/examples/cs/features/step_definitons/hello_steps.rb
  33. +14 −0 vendor/plugins/cucumber/examples/cs/features/step_definitons/tree_steps.rb
  34. +9 −0 vendor/plugins/cucumber/examples/cs/features/tree.feature
  35. +1 −0  vendor/plugins/cucumber/examples/cs/src/.gitignore
  36. +18 −0 vendor/plugins/cucumber/examples/cs/src/Hello.cs
  37. +6 −0 vendor/plugins/cucumber/examples/dos_line_endings/Rakefile
  38. +9 −0 vendor/plugins/cucumber/examples/dos_line_endings/features/dos_line_endings.feature
  39. +18 −0 vendor/plugins/cucumber/examples/i18n/README.textile
  40. +16 −0 vendor/plugins/cucumber/examples/i18n/Rakefile
  41. +6 −0 vendor/plugins/cucumber/examples/i18n/ar/Rakefile
  42. +17 −0 vendor/plugins/cucumber/examples/i18n/ar/features/addition.feature
  43. +32 −0 vendor/plugins/cucumber/examples/i18n/ar/features/step_definitons/calculator_steps.rb
  44. +10 −0 vendor/plugins/cucumber/examples/i18n/ar/lib/calculator.rb
  45. +6 −0 vendor/plugins/cucumber/examples/i18n/da/Rakefile
  46. +22 −0 vendor/plugins/cucumber/examples/i18n/da/features/step_definitons/kalkulator_steps.rb
  47. +17 −0 vendor/plugins/cucumber/examples/i18n/da/features/summering.feature
  48. +11 −0 vendor/plugins/cucumber/examples/i18n/da/lib/kalkulator.rb
  49. +1 −0  vendor/plugins/cucumber/examples/i18n/de/.gitignore
  50. +6 −0 vendor/plugins/cucumber/examples/i18n/de/Rakefile
  51. +17 −0 vendor/plugins/cucumber/examples/i18n/de/features/addition.feature
  52. +10 −0 vendor/plugins/cucumber/examples/i18n/de/features/division.feature
  53. +30 −0 vendor/plugins/cucumber/examples/i18n/de/features/step_definitons/calculator_steps.rb
  54. +14 −0 vendor/plugins/cucumber/examples/i18n/de/lib/calculator.rb
  55. +1 −0  vendor/plugins/cucumber/examples/i18n/en/.gitignore
  56. +6 −0 vendor/plugins/cucumber/examples/i18n/en/Rakefile
  57. +17 −0 vendor/plugins/cucumber/examples/i18n/en/features/addition.feature
  58. +10 −0 vendor/plugins/cucumber/examples/i18n/en/features/division.feature
  59. +31 −0 vendor/plugins/cucumber/examples/i18n/en/features/step_definitons/calculator_steps.rb
  60. +14 −0 vendor/plugins/cucumber/examples/i18n/en/lib/calculator.rb
  61. +6 −0 vendor/plugins/cucumber/examples/i18n/es/Rakefile
  62. +17 −0 vendor/plugins/cucumber/examples/i18n/es/features/adicion.feature
  63. +22 −0 vendor/plugins/cucumber/examples/i18n/es/features/step_definitons/calculador_steps.rb
  64. +11 −0 vendor/plugins/cucumber/examples/i18n/es/lib/calculador.rb
  65. +6 −0 vendor/plugins/cucumber/examples/i18n/et/Rakefile
  66. +17 −0 vendor/plugins/cucumber/examples/i18n/et/features/liitmine.feature
  67. +26 −0 vendor/plugins/cucumber/examples/i18n/et/features/step_definitions/kalkulaator_steps.rb
  68. +10 −0 vendor/plugins/cucumber/examples/i18n/et/lib/kalkulaator.rb
  69. +6 −0 vendor/plugins/cucumber/examples/i18n/fr/Rakefile
  70. +13 −0 vendor/plugins/cucumber/examples/i18n/fr/features/addition.feature
  71. +22 −0 vendor/plugins/cucumber/examples/i18n/fr/features/step_definitions/calculatrice_steps.rb
  72. +10 −0 vendor/plugins/cucumber/examples/i18n/fr/lib/calculatrice.rb
  73. +1 −0  vendor/plugins/cucumber/examples/i18n/id/.gitignore
  74. +6 −0 vendor/plugins/cucumber/examples/i18n/id/Rakefile
  75. +17 −0 vendor/plugins/cucumber/examples/i18n/id/features/addition.feature
  76. +10 −0 vendor/plugins/cucumber/examples/i18n/id/features/division.feature
  77. +31 −0 vendor/plugins/cucumber/examples/i18n/id/features/step_definitons/calculator_steps.rb
  78. +14 −0 vendor/plugins/cucumber/examples/i18n/id/lib/calculator.rb
  79. +6 −0 vendor/plugins/cucumber/examples/i18n/it/Rakefile
  80. +10 −0 vendor/plugins/cucumber/examples/i18n/it/features/somma.feature
  81. +22 −0 vendor/plugins/cucumber/examples/i18n/it/features/step_definitons/calcolatrice_steps.rb
  82. +11 −0 vendor/plugins/cucumber/examples/i18n/it/lib/calcolatrice.rb
  83. +1 −0  vendor/plugins/cucumber/examples/i18n/ja/.gitignore
  84. +5 −0 vendor/plugins/cucumber/examples/i18n/ja/README.txt
  85. +6 −0 vendor/plugins/cucumber/examples/i18n/ja/Rakefile
  86. +17 −0 vendor/plugins/cucumber/examples/i18n/ja/features/addition.feature
  87. +10 −0 vendor/plugins/cucumber/examples/i18n/ja/features/division.feature
  88. +30 −0 vendor/plugins/cucumber/examples/i18n/ja/features/step_definitons/calculator_steps.rb
  89. +14 −0 vendor/plugins/cucumber/examples/i18n/ja/lib/calculator.rb
  90. +1 −0  vendor/plugins/cucumber/examples/i18n/lt/.gitignore
  91. +6 −0 vendor/plugins/cucumber/examples/i18n/lt/Rakefile
  92. +17 −0 vendor/plugins/cucumber/examples/i18n/lt/features/addition.feature
  93. +10 −0 vendor/plugins/cucumber/examples/i18n/lt/features/division.feature
  94. +31 −0 vendor/plugins/cucumber/examples/i18n/lt/features/step_definitons/calculator_steps.rb
  95. +14 −0 vendor/plugins/cucumber/examples/i18n/lt/lib/calculator.rb
  96. +6 −0 vendor/plugins/cucumber/examples/i18n/no/Rakefile
  97. +22 −0 vendor/plugins/cucumber/examples/i18n/no/features/step_definitons/kalkulator_steps.rb
  98. +17 −0 vendor/plugins/cucumber/examples/i18n/no/features/summering.feature
  99. +11 −0 vendor/plugins/cucumber/examples/i18n/no/lib/kalkulator.rb
  100. +6 −0 vendor/plugins/cucumber/examples/i18n/pt/Rakefile
  101. +10 −0 vendor/plugins/cucumber/examples/i18n/pt/features/adicao.feature
  102. +22 −0 vendor/plugins/cucumber/examples/i18n/pt/features/step_definitions/calculadora_steps.rb
  103. +10 −0 vendor/plugins/cucumber/examples/i18n/pt/lib/calculadora.rb
  104. +6 −0 vendor/plugins/cucumber/examples/i18n/ro/Rakefile
  105. +22 −0 vendor/plugins/cucumber/examples/i18n/ro/features/step_definitons/calculator_steps.rb
  106. +10 −0 vendor/plugins/cucumber/examples/i18n/ro/features/suma.feature
  107. +11 −0 vendor/plugins/cucumber/examples/i18n/ro/lib/calculator.rb
  108. +6 −0 vendor/plugins/cucumber/examples/i18n/se/Rakefile
  109. +22 −0 vendor/plugins/cucumber/examples/i18n/se/features/step_definitons/kalkulator_steps.rb
  110. +17 −0 vendor/plugins/cucumber/examples/i18n/se/features/summering.feature
  111. +11 −0 vendor/plugins/cucumber/examples/i18n/se/lib/kalkulator.rb
  112. +6 −0 vendor/plugins/cucumber/examples/i18n/zh-CN/Rakefile
  113. +17 −0 vendor/plugins/cucumber/examples/i18n/zh-CN/features/addition.feature
  114. +24 −0 vendor/plugins/cucumber/examples/i18n/zh-CN/features/step_definitons/calculator_steps.rb
  115. +10 −0 vendor/plugins/cucumber/examples/i18n/zh-CN/lib/calculator.rb
  116. +22 −0 vendor/plugins/cucumber/examples/java/README.textile
  117. +12 −0 vendor/plugins/cucumber/examples/java/Rakefile
  118. +11 −0 vendor/plugins/cucumber/examples/java/features/hello.feature
  119. +25 −0 vendor/plugins/cucumber/examples/java/features/step_definitons/hello_steps.rb
  120. +14 −0 vendor/plugins/cucumber/examples/java/features/step_definitons/tree_steps.rb
  121. +9 −0 vendor/plugins/cucumber/examples/java/features/tree.feature
  122. +1 −0  vendor/plugins/cucumber/examples/java/src/.gitignore
  123. +1 −0  vendor/plugins/cucumber/examples/java/src/cucumber/demo/.gitignore
  124. +16 −0 vendor/plugins/cucumber/examples/java/src/cucumber/demo/Hello.java
  125. +6 −0 vendor/plugins/cucumber/examples/selenium/Rakefile
  126. +9 −0 vendor/plugins/cucumber/examples/selenium/features/search.feature
  127. +41 −0 vendor/plugins/cucumber/examples/selenium/features/step_definitons/stories_steps.rb
  128. +6 −0 vendor/plugins/cucumber/examples/test_unit/Rakefile
  129. +26 −0 vendor/plugins/cucumber/examples/test_unit/features/step_definitions/test_unit_steps.rb
  130. +9 −0 vendor/plugins/cucumber/examples/test_unit/features/test_unit.feature
  131. +11 −0 vendor/plugins/cucumber/examples/tickets/Rakefile
  132. +2 −0  vendor/plugins/cucumber/examples/tickets/cucumber.yml
  133. +32 −0 vendor/plugins/cucumber/examples/tickets/features/step_definitons/tickets_steps.rb
  134. +24 −0 vendor/plugins/cucumber/examples/tickets/features/tickets.feature
  135. +6 −0 vendor/plugins/cucumber/examples/watir/Rakefile
  136. +9 −0 vendor/plugins/cucumber/examples/watir/features/search.feature
  137. +51 −0 vendor/plugins/cucumber/examples/watir/features/step_definitons/stories_steps.rb
  138. +8 −0 vendor/plugins/cucumber/features/see_features.feature
  139. +9 −0 vendor/plugins/cucumber/features/steps/features_steps.rb
  140. +34 −0 vendor/plugins/cucumber/gem_tasks/deployment.rake
  141. +7 −0 vendor/plugins/cucumber/gem_tasks/environment.rake
  142. +6 −0 vendor/plugins/cucumber/gem_tasks/features.rake
  143. +10 −0 vendor/plugins/cucumber/gem_tasks/fix_cr_lf.rake
  144. +4 −0 vendor/plugins/cucumber/gem_tasks/flog.rake
  145. +6 −0 vendor/plugins/cucumber/gem_tasks/gemspec.rake
  146. +21 −0 vendor/plugins/cucumber/gem_tasks/rspec.rake
  147. +41 −0 vendor/plugins/cucumber/gem_tasks/treetop.rake
  148. +6 −0 vendor/plugins/cucumber/lib/autotest/cucumber.rb
  149. +109 −0 vendor/plugins/cucumber/lib/autotest/cucumber_mixin.rb
  150. +6 −0 vendor/plugins/cucumber/lib/autotest/cucumber_rails.rb
  151. +6 −0 vendor/plugins/cucumber/lib/autotest/cucumber_rails_rspec.rb
  152. +6 −0 vendor/plugins/cucumber/lib/autotest/cucumber_rspec.rb
  153. +9 −0 vendor/plugins/cucumber/lib/autotest/discover.rb
  154. +38 −0 vendor/plugins/cucumber/lib/cucumber.rb
  155. +20 −0 vendor/plugins/cucumber/lib/cucumber/broadcaster.rb
  156. +303 −0 vendor/plugins/cucumber/lib/cucumber/cli.rb
  157. +69 −0 vendor/plugins/cucumber/lib/cucumber/core_ext/proc.rb
  158. +28 −0 vendor/plugins/cucumber/lib/cucumber/core_ext/string.rb
  159. +190 −0 vendor/plugins/cucumber/lib/cucumber/executor.rb
  160. +1 −0  vendor/plugins/cucumber/lib/cucumber/formatters.rb
  161. +109 −0 vendor/plugins/cucumber/lib/cucumber/formatters/ansicolor.rb
  162. +23 −0 vendor/plugins/cucumber/lib/cucumber/formatters/autotest_formatter.rb
  163. +132 −0 vendor/plugins/cucumber/lib/cucumber/formatters/cucumber.css
  164. +11 −0 vendor/plugins/cucumber/lib/cucumber/formatters/cucumber.js
  165. +128 −0 vendor/plugins/cucumber/lib/cucumber/formatters/html_formatter.rb
  166. +32 −0 vendor/plugins/cucumber/lib/cucumber/formatters/jquery.js
  167. +234 −0 vendor/plugins/cucumber/lib/cucumber/formatters/pretty_formatter.rb
  168. +92 −0 vendor/plugins/cucumber/lib/cucumber/formatters/profile_formatter.rb
  169. +58 −0 vendor/plugins/cucumber/lib/cucumber/formatters/progress_formatter.rb
  170. +258 −0 vendor/plugins/cucumber/lib/cucumber/languages.yml
  171. +1 −0  vendor/plugins/cucumber/lib/cucumber/model.rb
  172. +28 −0 vendor/plugins/cucumber/lib/cucumber/model/table.rb
  173. +12 −0 vendor/plugins/cucumber/lib/cucumber/platform.rb
  174. +12 −0 vendor/plugins/cucumber/lib/cucumber/rails/rspec.rb
  175. +73 −0 vendor/plugins/cucumber/lib/cucumber/rails/world.rb
  176. +101 −0 vendor/plugins/cucumber/lib/cucumber/rake/task.rb
  177. +49 −0 vendor/plugins/cucumber/lib/cucumber/step_methods.rb
  178. +95 −0 vendor/plugins/cucumber/lib/cucumber/step_mother.rb
  179. +18 −0 vendor/plugins/cucumber/lib/cucumber/tree.rb
  180. +63 −0 vendor/plugins/cucumber/lib/cucumber/tree/feature.rb
  181. +21 −0 vendor/plugins/cucumber/lib/cucumber/tree/features.rb
  182. +13 −0 vendor/plugins/cucumber/lib/cucumber/tree/given_scenario.rb
  183. +174 −0 vendor/plugins/cucumber/lib/cucumber/tree/scenario.rb
  184. +134 −0 vendor/plugins/cucumber/lib/cucumber/tree/step.rb
  185. +26 −0 vendor/plugins/cucumber/lib/cucumber/tree/table.rb
  186. +23 −0 vendor/plugins/cucumber/lib/cucumber/tree/top_down_visitor.rb
  187. +206 −0 vendor/plugins/cucumber/lib/cucumber/treetop_parser/feature.treetop.erb
  188. +1,591 −0 vendor/plugins/cucumber/lib/cucumber/treetop_parser/feature_ar.rb
  189. +1,591 −0 vendor/plugins/cucumber/lib/cucumber/treetop_parser/feature_cy.rb
  190. +1,591 −0 vendor/plugins/cucumber/lib/cucumber/treetop_parser/feature_da.rb
  191. +1,591 −0 vendor/plugins/cucumber/lib/cucumber/treetop_parser/feature_de.rb
  192. +1,591 −0 vendor/plugins/cucumber/lib/cucumber/treetop_parser/feature_en-lol.rb
  193. +1,591 −0 vendor/plugins/cucumber/lib/cucumber/treetop_parser/feature_en-tx.rb
  194. +1,591 −0 vendor/plugins/cucumber/lib/cucumber/treetop_parser/feature_en.rb
  195. +1,591 −0 vendor/plugins/cucumber/lib/cucumber/treetop_parser/feature_es.rb
  196. +1,591 −0 vendor/plugins/cucumber/lib/cucumber/treetop_parser/feature_et.rb
  197. +1,591 −0 vendor/plugins/cucumber/lib/cucumber/treetop_parser/feature_fr.rb
  198. +1,591 −0 vendor/plugins/cucumber/lib/cucumber/treetop_parser/feature_id.rb
  199. +1,591 −0 vendor/plugins/cucumber/lib/cucumber/treetop_parser/feature_it.rb
  200. +1,591 −0 vendor/plugins/cucumber/lib/cucumber/treetop_parser/feature_ja.rb
  201. +1,591 −0 vendor/plugins/cucumber/lib/cucumber/treetop_parser/feature_lt.rb
  202. +1,591 −0 vendor/plugins/cucumber/lib/cucumber/treetop_parser/feature_nl.rb
  203. +1,591 −0 vendor/plugins/cucumber/lib/cucumber/treetop_parser/feature_no.rb
  204. +34 −0 vendor/plugins/cucumber/lib/cucumber/treetop_parser/feature_parser.rb
  205. +1,591 −0 vendor/plugins/cucumber/lib/cucumber/treetop_parser/feature_pl.rb
  206. +1,591 −0 vendor/plugins/cucumber/lib/cucumber/treetop_parser/feature_pt.rb
  207. +1,591 −0 vendor/plugins/cucumber/lib/cucumber/treetop_parser/feature_ro.rb
  208. +1,591 −0 vendor/plugins/cucumber/lib/cucumber/treetop_parser/feature_ro2.rb
  209. +1,591 −0 vendor/plugins/cucumber/lib/cucumber/treetop_parser/feature_ru.rb
  210. +1,591 −0 vendor/plugins/cucumber/lib/cucumber/treetop_parser/feature_se.rb
  211. +1,591 −0 vendor/plugins/cucumber/lib/cucumber/treetop_parser/feature_zh-CN.rb
  212. +9 −0 vendor/plugins/cucumber/lib/cucumber/version.rb
  213. +11 −0 vendor/plugins/cucumber/rails_generators/cucumber/USAGE
  214. +30 −0 vendor/plugins/cucumber/rails_generators/cucumber/cucumber_generator.rb
  215. +7 −0 vendor/plugins/cucumber/rails_generators/cucumber/templates/cucumber
  216. +7 −0 vendor/plugins/cucumber/rails_generators/cucumber/templates/cucumber.rake
  217. +8 −0 vendor/plugins/cucumber/rails_generators/cucumber/templates/env.rb
  218. +95 −0 vendor/plugins/cucumber/rails_generators/cucumber/templates/webrat_steps.rb
  219. +12 −0 vendor/plugins/cucumber/rails_generators/feature/USAGE
  220. +16 −0 vendor/plugins/cucumber/rails_generators/feature/feature_generator.rb
  221. +28 −0 vendor/plugins/cucumber/rails_generators/feature/templates/feature.erb
  222. +22 −0 vendor/plugins/cucumber/rails_generators/feature/templates/steps.erb
  223. +10 −0 vendor/plugins/cucumber/script/console
  224. +1 −0  vendor/plugins/cucumber/script/console.cmd
  225. +14 −0 vendor/plugins/cucumber/script/destroy
  226. +1 −0  vendor/plugins/cucumber/script/destroy.cmd
  227. +14 −0 vendor/plugins/cucumber/script/generate
  228. +1 −0  vendor/plugins/cucumber/script/generate.cmd
  229. +74 −0 vendor/plugins/cucumber/script/txt2html
  230. +1 −0  vendor/plugins/cucumber/script/txt2html.cmd
  231. +1,585 −0 vendor/plugins/cucumber/setup.rb
  232. +27 −0 vendor/plugins/cucumber/spec/cucumber/broadcaster_spec.rb
Sorry, we could not display the entire diff because too many files (846) changed.
View
1  config/environment.rb
@@ -27,6 +27,7 @@
config.gem "ferret"
config.gem "mislav-will_paginate", :lib => 'will_paginate', :source => 'http://gems.github.com/'
config.gem "recaptcha", :source => 'http://www.loonsoft.com/recaptcha/pkg/'
+ config.gem 'rahoulb-rujitsu', :lib => 'rujitsu', :source => 'http://gems.github.com/'
# Only load the plugins named here, in the order given. By default, all plugins
# in vendor/plugins are loaded in alphabetical order.
View
95 features/step_definitions/webrat_steps.rb
@@ -0,0 +1,95 @@
+# Commonly used webrat steps
+# http://github.com/brynary/webrat
+
+require 'webrat' if !defined?(Webrat) # Because some people have it installed as a Gem
+
+When /^I press "(.*)"$/ do |button|
+ clicks_button(button)
+end
+
+When /^I follow "(.*)"$/ do |link|
+ clicks_link(link)
+end
+
+When /^I fill in "(.*)" with "(.*)"$/ do |field, value|
+ fills_in(field, :with => value)
+end
+
+When /^I select "(.*)" from "(.*)"$/ do |value, field|
+ selects(value, :from => field)
+end
+
+# Use this step in conjunction with Rail's datetime_select helper. For example:
+# When I select "December 25, 2008 10:00" as the date and time
+When /^I select "(.*)" as the date and time$/ do |time|
+ selects_datetime(time)
+end
+
+# Use this step when using multiple datetime_select helpers on a page or
+# you want to specify which datetime to select. Given the following view:
+# <%= f.label :preferred %><br />
+# <%= f.datetime_select :preferred %>
+# <%= f.label :alternative %><br />
+# <%= f.datetime_select :alternative %>
+# The following steps would fill out the form:
+# When I select "November 23, 2004 11:20" as the "Preferred" data and time
+# And I select "November 25, 2004 10:30" as the "Alternative" data and time
+When /^I select "(.*)" as the "(.*)" date and time$/ do |datetime, datetime_label|
+ selects_datetime(datetime, :from => datetime_label)
+end
+
+# Use this step in conjuction with Rail's time_select helper. For example:
+# When I select "2:20PM" as the time
+# Note: Rail's default time helper provides 24-hour time-- not 12 hour time. Webrat
+# will convert the 2:20PM to 14:20 and then select it.
+When /^I select "(.*)" as the time$/ do |time|
+ selects_time(time)
+end
+
+# Use this step when using multiple time_select helpers on a page or you want to
+# specify the name of the time on the form. For example:
+# When I select "7:30AM" as the "Gym" time
+When /^I select "(.*)" as the "(.*)" time$/ do |time, time_label|
+ selects_time(time, :from => time_label)
+end
+
+# Use this step in conjuction with Rail's date_select helper. For example:
+# When I select "February 20, 1981" as the date
+When /^I select "(.*)" as the date$/ do |date|
+ selects_date(date)
+end
+
+# Use this step when using multiple date_select helpers on one page or
+# you want to specify the name of the date on the form. For example:
+# When I select "April 26, 1982" as the "Date of Birth" date
+When /^I select "(.*)" as the "(.*)" date$/ do |date, date_label|
+ selects_date(date, :from => date_label)
+end
+
+When /^I check "(.*)"$/ do |field|
+ checks(field)
+end
+
+When /^I uncheck "(.*)"$/ do |field|
+ unchecks(field)
+end
+
+When /^I choose "(.*)"$/ do |field|
+ chooses(field)
+end
+
+When /^I attach the file at "(.*)" to "(.*)" $/ do |path, field|
+ attaches_file(field, path)
+end
+
+Then /^I should see "(.*)"$/ do |text|
+ response.body.should =~ /#{text}/m
+end
+
+Then /^I should not see "(.*)"$/ do |text|
+ response.body.should_not =~ /#{text}/m
+end
+
+Then /^the "(.*)" checkbox should be checked$/ do |label|
+ field_labeled(label).should be_checked
+end
View
8 features/support/env.rb
@@ -0,0 +1,8 @@
+# Sets up the Rails environment for Cucumber
+ENV["RAILS_ENV"] = "test"
+require File.expand_path(File.dirname(__FILE__) + '/../../config/environment')
+require 'cucumber/rails/world'
+Cucumber::Rails.use_transactional_fixtures
+
+# Comment out the next line if you're not using RSpec's matchers (should / should_not) in your steps.
+require 'cucumber/rails/rspec'
View
7 lib/tasks/cucumber.rake
@@ -0,0 +1,7 @@
+$:.unshift(RAILS_ROOT + '/vendor/plugins/cucumber/lib')
+require 'cucumber/rake/task'
+
+Cucumber::Rake::Task.new(:features) do |t|
+ t.cucumber_opts = "--format pretty"
+end
+task :features => 'db:test:prepare'
View
153 lib/tasks/rspec.rake
@@ -0,0 +1,153 @@
+raise "To avoid rake task loading problems: run 'rake clobber' in vendor/plugins/rspec" if File.directory?(File.join(File.dirname(__FILE__), *%w[.. .. vendor plugins rspec pkg]))
+raise "To avoid rake task loading problems: run 'rake clobber' in vendor/plugins/rspec-rails" if File.directory?(File.join(File.dirname(__FILE__), *%w[.. .. vendor plugins rspec-rails pkg]))
+
+# In rails 1.2, plugins aren't available in the path until they're loaded.
+# Check to see if the rspec plugin is installed first and require
+# it if it is. If not, use the gem version.
+rspec_base = File.expand_path(File.dirname(__FILE__) + '/../../vendor/plugins/rspec/lib')
+$LOAD_PATH.unshift(rspec_base) if File.exist?(rspec_base)
+
+begin
+ require 'spec/rake/spectask'
+ Rake.application.instance_variable_get('@tasks').delete('default')
+
+ spec_prereq = File.exist?(File.join(RAILS_ROOT, 'config', 'database.yml')) ? "db:test:prepare" : :noop
+ task :noop do
+ end
+
+ task :default => :spec
+ task :stats => "spec:statsetup"
+
+ desc "Run all specs in spec directory (excluding plugin specs)"
+ Spec::Rake::SpecTask.new(:spec => spec_prereq) do |t|
+ t.spec_opts = ['--options', "\"#{RAILS_ROOT}/spec/spec.opts\""]
+ t.spec_files = FileList['spec/**/*_spec.rb']
+ end
+
+ namespace :spec do
+ desc "Run all specs in spec directory with RCov (excluding plugin specs)"
+ Spec::Rake::SpecTask.new(:rcov) do |t|
+ t.spec_opts = ['--options', "\"#{RAILS_ROOT}/spec/spec.opts\""]
+ t.spec_files = FileList['spec/**/*_spec.rb']
+ t.rcov = true
+ t.rcov_opts = lambda do
+ IO.readlines("#{RAILS_ROOT}/spec/rcov.opts").map {|l| l.chomp.split " "}.flatten
+ end
+ end
+
+ desc "Print Specdoc for all specs (excluding plugin specs)"
+ Spec::Rake::SpecTask.new(:doc) do |t|
+ t.spec_opts = ["--format", "specdoc", "--dry-run"]
+ t.spec_files = FileList['spec/**/*_spec.rb']
+ end
+
+ desc "Print Specdoc for all plugin examples"
+ Spec::Rake::SpecTask.new(:plugin_doc) do |t|
+ t.spec_opts = ["--format", "specdoc", "--dry-run"]
+ t.spec_files = FileList['vendor/plugins/**/spec/**/*_spec.rb'].exclude('vendor/plugins/rspec/*')
+ end
+
+ [:models, :controllers, :views, :helpers, :lib].each do |sub|
+ desc "Run the code examples in spec/#{sub}"
+ Spec::Rake::SpecTask.new(sub => spec_prereq) do |t|
+ t.spec_opts = ['--options', "\"#{RAILS_ROOT}/spec/spec.opts\""]
+ t.spec_files = FileList["spec/#{sub}/**/*_spec.rb"]
+ end
+ end
+
+ desc "Run the code examples in vendor/plugins (except RSpec's own)"
+ Spec::Rake::SpecTask.new(:plugins => spec_prereq) do |t|
+ t.spec_opts = ['--options', "\"#{RAILS_ROOT}/spec/spec.opts\""]
+ t.spec_files = FileList['vendor/plugins/**/spec/**/*_spec.rb'].exclude('vendor/plugins/rspec/*').exclude("vendor/plugins/rspec-rails/*")
+ end
+
+ namespace :plugins do
+ desc "Runs the examples for rspec_on_rails"
+ Spec::Rake::SpecTask.new(:rspec_on_rails) do |t|
+ t.spec_opts = ['--options', "\"#{RAILS_ROOT}/spec/spec.opts\""]
+ t.spec_files = FileList['vendor/plugins/rspec-rails/spec/**/*_spec.rb']
+ end
+ end
+
+ # Setup specs for stats
+ task :statsetup do
+ require 'code_statistics'
+ ::STATS_DIRECTORIES << %w(Model\ specs spec/models) if File.exist?('spec/models')
+ ::STATS_DIRECTORIES << %w(View\ specs spec/views) if File.exist?('spec/views')
+ ::STATS_DIRECTORIES << %w(Controller\ specs spec/controllers) if File.exist?('spec/controllers')
+ ::STATS_DIRECTORIES << %w(Helper\ specs spec/helpers) if File.exist?('spec/helpers')
+ ::STATS_DIRECTORIES << %w(Library\ specs spec/lib) if File.exist?('spec/lib')
+ ::CodeStatistics::TEST_TYPES << "Model specs" if File.exist?('spec/models')
+ ::CodeStatistics::TEST_TYPES << "View specs" if File.exist?('spec/views')
+ ::CodeStatistics::TEST_TYPES << "Controller specs" if File.exist?('spec/controllers')
+ ::CodeStatistics::TEST_TYPES << "Helper specs" if File.exist?('spec/helpers')
+ ::CodeStatistics::TEST_TYPES << "Library specs" if File.exist?('spec/lib')
+ ::STATS_DIRECTORIES.delete_if {|a| a[0] =~ /test/}
+ end
+
+ namespace :db do
+ namespace :fixtures do
+ desc "Load fixtures (from spec/fixtures) into the current environment's database. Load specific fixtures using FIXTURES=x,y"
+ task :load => :environment do
+ require 'active_record/fixtures'
+ ActiveRecord::Base.establish_connection(RAILS_ENV.to_sym)
+ (ENV['FIXTURES'] ? ENV['FIXTURES'].split(/,/) : Dir.glob(File.join(RAILS_ROOT, 'spec', 'fixtures', '*.{yml,csv}'))).each do |fixture_file|
+ Fixtures.create_fixtures('spec/fixtures', File.basename(fixture_file, '.*'))
+ end
+ end
+ end
+ end
+
+ namespace :server do
+ daemonized_server_pid = File.expand_path("spec_server.pid", RAILS_ROOT + "/tmp")
+
+ desc "start spec_server."
+ task :start do
+ if File.exist?(daemonized_server_pid)
+ $stderr.puts "spec_server is already running."
+ else
+ $stderr.puts "Starting up spec server."
+ system("ruby", "script/spec_server", "--daemon", "--pid", daemonized_server_pid)
+ end
+ end
+
+ desc "stop spec_server."
+ task :stop do
+ unless File.exist?(daemonized_server_pid)
+ $stderr.puts "No server running."
+ else
+ $stderr.puts "Shutting down spec_server."
+ system("kill", "-s", "TERM", File.read(daemonized_server_pid).strip) &&
+ File.delete(daemonized_server_pid)
+ end
+ end
+
+ desc "reload spec_server."
+ task :restart do
+ unless File.exist?(daemonized_server_pid)
+ $stderr.puts "No server running."
+ else
+ $stderr.puts "Reloading down spec_server."
+ system("kill", "-s", "USR2", File.read(daemonized_server_pid).strip)
+ end
+ end
+ end
+ end
+rescue MissingSourceFile
+ # if rspec-rails is a configured gem, this will output helpful material and exit ...
+ require File.expand_path(File.dirname(__FILE__) + "/../../config/environment")
+
+ # ... otherwise, do this:
+ raise <<-MSG
+
+ You have rspec-rails rake tasks installed in
+ #{__FILE__},
+ but rspec-rails is not configured as a gem in
+ config/environment.rb
+
+ Either remove #{__FILE__}
+ or configure the rspec-rails gem in config/environment.rb.
+
+MSG
+end
+
View
5 script/autospec
@@ -0,0 +1,5 @@
+#!/usr/bin/env ruby
+ENV['RSPEC'] = 'true' # allows autotest to discover rspec
+ENV['AUTOTEST'] = 'true' # allows autotest to run w/ color on linux
+system((RUBY_PLATFORM =~ /mswin|mingw/ ? 'autotest.bat' : 'autotest'), *ARGV) ||
+ $stderr.puts("Unable to find autotest. Please install ZenTest or fix your PATH")
View
7 script/cucumber
@@ -0,0 +1,7 @@
+#!/usr/bin/env ruby
+begin
+ load File.expand_path(File.dirname(__FILE__) + "/../vendor/plugins/cucumber/bin/cucumber")
+rescue LoadError
+ require "rubygems"
+ load File.join(Gem.bindir, "cucumber")
+end
View
5 script/spec
@@ -0,0 +1,5 @@
+#!/usr/bin/env ruby
+$LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__) + "/../vendor/plugins/rspec/lib"))
+require 'rubygems'
+require 'spec'
+exit ::Spec::Runner::CommandLine.run(::Spec::Runner::OptionParser.parse(ARGV, STDERR, STDOUT))
View
116 script/spec_server
@@ -0,0 +1,116 @@
+#!/usr/bin/env ruby
+$LOAD_PATH.unshift File.dirname(__FILE__) + '/../vendor/plugins/rspec/lib' # For rspec installed as plugin
+require 'rubygems'
+require 'drb/drb'
+require 'rbconfig'
+require 'spec'
+require 'optparse'
+
+# This is based on Florian Weber's TDDMate
+module Spec
+ module Runner
+ class RailsSpecServer
+ def run(argv, stderr, stdout)
+ $stdout = stdout
+ $stderr = stderr
+
+ base = ActiveRecord::Base
+ def base.clear_reloadable_connections!
+ active_connections.each do |name, conn|
+ if conn.requires_reloading?
+ conn.disconnect!
+ active_connections.delete(name)
+ end
+ end
+ end
+
+ if ActionController.const_defined?(:Dispatcher)
+ dispatcher = ::ActionController::Dispatcher.new($stdout)
+ dispatcher.cleanup_application
+ elsif ::Dispatcher.respond_to?(:reset_application!)
+ ::Dispatcher.reset_application!
+ else
+ raise "Application reloading failed"
+ end
+ if Object.const_defined?(:Fixtures) && Fixtures.respond_to?(:reset_cache)
+ Fixtures.reset_cache
+ end
+
+ ::Dependencies.mechanism = :load
+ require_dependency('application.rb') unless Object.const_defined?(:ApplicationController)
+ load File.dirname(__FILE__) + '/../spec/spec_helper.rb'
+
+ if in_memory_database?
+ load "#{RAILS_ROOT}/db/schema.rb" # use db agnostic schema by default
+ ActiveRecord::Migrator.up('db/migrate') # use migrations
+ end
+
+ ::Spec::Runner::CommandLine.run(
+ ::Spec::Runner::OptionParser.parse(
+ argv,
+ $stderr,
+ $stdout
+ )
+ )
+ end
+
+ def in_memory_database?
+ ENV["RAILS_ENV"] == "test" and
+ ::ActiveRecord::Base.connection.class.to_s == "ActiveRecord::ConnectionAdapters::SQLite3Adapter" and
+ ::Rails::Configuration.new.database_configuration['test']['database'] == ':memory:'
+ end
+ end
+ end
+end
+puts "Loading Rails environment"
+
+ENV["RAILS_ENV"] = "test"
+require File.expand_path(File.dirname(__FILE__) + "/../config/environment")
+require 'dispatcher'
+
+def restart_test_server
+ puts "restarting"
+ config = ::Config::CONFIG
+ ruby = File::join(config['bindir'], config['ruby_install_name']) + config['EXEEXT']
+ command_line = [ruby, $0, ARGV].flatten.join(' ')
+ exec(command_line)
+end
+
+def daemonize(pid_file = nil)
+ return yield if $DEBUG
+ pid = Process.fork{
+ Process.setsid
+ Dir.chdir(RAILS_ROOT)
+ trap("SIGINT"){ exit! 0 }
+ trap("SIGTERM"){ exit! 0 }
+ trap("SIGHUP"){ restart_test_server }
+ File.open("/dev/null"){|f|
+ STDERR.reopen f
+ STDIN.reopen f
+ STDOUT.reopen f
+ }
+ yield
+ }
+ puts "spec_server launched. (PID: %d)" % pid
+ File.open(pid_file,"w"){|f| f.puts pid } if pid_file
+ exit! 0
+end
+
+options = Hash.new
+opts = OptionParser.new
+opts.on("-d", "--daemon"){|v| options[:daemon] = true }
+opts.on("-p", "--pid PIDFILE"){|v| options[:pid] = v }
+opts.parse!(ARGV)
+
+puts "Ready"
+exec_server = lambda {
+ trap("USR2") { restart_test_server } if Signal.list.has_key?("USR2")
+ DRb.start_service("druby://127.0.0.1:8989", Spec::Runner::RailsSpecServer.new)
+ DRb.thread.join
+}
+
+if options[:daemon]
+ daemonize(options[:pid], &exec_server)
+else
+ exec_server.call
+end
View
2  spec/rcov.opts
@@ -0,0 +1,2 @@
+--exclude "spec/*,gems/*"
+--rails
View
4 spec/spec.opts
@@ -0,0 +1,4 @@
+--colour
+--format progress
+--loadby mtime
+--reverse
View
47 spec/spec_helper.rb
@@ -0,0 +1,47 @@
+# This file is copied to ~/spec when you run 'ruby script/generate rspec'
+# from the project root directory.
+ENV["RAILS_ENV"] = "test"
+require File.expand_path(File.dirname(__FILE__) + "/../config/environment")
+require 'spec'
+require 'spec/rails'
+
+Spec::Runner.configure do |config|
+ # If you're not using ActiveRecord you should remove these
+ # lines, delete config/database.yml and disable :active_record
+ # in your config/boot.rb
+ config.use_transactional_fixtures = true
+ config.use_instantiated_fixtures = false
+ config.fixture_path = RAILS_ROOT + '/spec/fixtures/'
+
+ # == Fixtures
+ #
+ # You can declare fixtures for each example_group like this:
+ # describe "...." do
+ # fixtures :table_a, :table_b
+ #
+ # Alternatively, if you prefer to declare them only once, you can
+ # do so right here. Just uncomment the next line and replace the fixture
+ # names with your fixtures.
+ #
+ # config.global_fixtures = :table_a, :table_b
+ #
+ # If you declare global fixtures, be aware that they will be declared
+ # for all of your examples, even those that don't use them.
+ #
+ # You can also declare which fixtures to use (for example fixtures for test/fixtures):
+ #
+ # config.fixture_path = RAILS_ROOT + '/spec/fixtures/'
+ #
+ # == Mock Framework
+ #
+ # RSpec uses it's own mocking framework by default. If you prefer to
+ # use mocha, flexmock or RR, uncomment the appropriate line:
+ #
+ # config.mock_with :mocha
+ # config.mock_with :flexmock
+ # config.mock_with :rr
+ #
+ # == Notes
+ #
+ # For more information take a look at Spec::Example::Configuration and Spec::Runner
+end
View
1  vendor/plugins/cucumber/.gitattributes
@@ -0,0 +1 @@
+spec/cucumber/treetop_parser/test_dos.feature -crlf
View
10 vendor/plugins/cucumber/.gitignore
@@ -0,0 +1,10 @@
+nbproject
+pkg
+doc
+*.log
+*.pid
+.eprj
+.tmtags
+*~
+.DS_Store
+*.swp
View
262 vendor/plugins/cucumber/History.txt
@@ -0,0 +1,262 @@
+== 0.1.11 (In Git)
+
+== New features
+* CUCUMBER_NO_JCODE environment variable disables jcode. Workaround for http://tinyurl.com/55uu3u (Aslak Hellesøy)
+* CUCUMBR LIKEZ 2 SPEEK WIF KATS. KTHXBAI (Aimee Daniells)
+* Support for dynamically pluggable formatters (#99 Joseph Wilk)
+* --verbose mode to see ruby files and feature files loaded by Cucumber (#106 Joseph Wilk)
+
+== Bugfixes
+
+== Removed features
+
+== 0.1.10 2008-11-25
+
+This release mostly has smaller bugfixes. The most significant new feature is how
+line numbers are specified. You can now run multiple features at specific lines numbers like this:
+
+ cucumber foo.feature:15 bar.feature:6:45:111
+
+This will run foo.feature at line 15 and bar.feature at line 6, 45 and 111.
+
+=== New features
+* Added example showing how to use Cucumber with Test::Unit + Matchy instead of RSpec (Aslak Hellesøy)
+* Yield existing world object to World block (#87 Aslak Hellesøy)
+* AUTOFEATURE=tRue works (case insensitive) (Aslak Hellesøy)
+* Initial support for .NET via IronRuby. (Aslak Hellesøy)
+* Lithuanian translation (sauliusgrigaitis)
+* New webrat step defintions to wrap the new selects_time, selects_date, and selects_datetime methods. (Ben Mabey)
+* Try to load webrat gem if it's not installed as a plugin (Aslak Hellesøy)
+* Support example.feature:20 or example.feature:10:20:30 syntax for running features at specific line number(s). (#88 Joseph Wilk)
+
+=== Bugfixes
+* Windows - all the 'a' characters in the output have gone on strike (#81 Luis Lavena, Joseph Wilk, Aslak Hellesøy)
+* Raise a nice error when encountering step definition without block (#95 Aslak Hellesøy)
+* Features written using Ruby where breaking due to missing a line number (#91 Joseph Wilk)
+* Directly creating a Table meant the scenario table header was never set which was causing a formatter error (#91 Joseph Wilk)
+
+=== Removed features
+* $KCODE='u' is no longer done automatically. Developers should do that explicitly when needed in step definitions or env.rb.
+* Step definition without a block being treated as pending (#64 Joseph Wilk)
+* The --line option has been removed. Use the new file.feature:line format instead.
+
+== 0.1.9 2008-11-12
+
+With this release Cucumber supports 19 (!) natural languages:
+
+* Arabic
+* Chinese Simplified
+* Danish
+* Dutch
+* Estonian
+* French
+* German
+* Italian
+* Japanese
+* Malay
+* Norwegian
+* Polish
+* Portuguese
+* Romanian
+* Russian
+* Spanish
+* Swedish
+* Texan
+* Welsh
+
+Thanks a lot to everyone who has contributed translations. If you don't see your language here, please
+add it: http://github.com/aslakhellesoy/cucumber/wikis/spoken-languages
+
+Main functional changes in this release is "Autotest":http://github.com/aslakhellesoy/cucumber/wikis/autotest-integration
+support and how multiline strings work in feature files:
+
+ # In your .feature file
+ Then I should see
+ """
+ A string
+ that "indents"
+ and spans
+ several lines
+
+ """
+
+ # In your steps.rb file
+ Then 'I should see' do |text|
+ text.should == "A string\n that \"indents\"\nand spans\nseveral lines\n"
+ end
+
+The triple quotes are used to define the start and end of a string, and it also defines what gets stripped away
+in the inside string. If the triple quotes are indented 4 spaces, then the text within will have the 4 first
+spaces removed too.
+
+=== New features
+* Added --[no-]color option to force color on or off (Peter Jaros)
+* Step definition without a block will be treated as pending (#64 Joseph Wilk)
+* Added support for Welsh (improvements welcome) (Joseph Wilk)
+* Added --quiet option to hide all development aid output when using Pretty formatter (#69 Joseph Wilk)
+* Added --no-snippets option to hide snippets for pending steps when using Pretty formatter (#69 Joseph Wilk)
+* Added error messages concerning cucumber.yml. (#70 Ben Mabey)
+* Added Autotest support - work in progress... (Peter Jaros)
+* Added new --exclude option (Bryan Helkamp)
+* Added new --scenario option (Peter Jaros)
+* Renamed common_webrat.rb to webrat_steps.rb (Ben Mabey, Aslak Hellesøy)
+* Added new feature[:feature_path] task (Roman Gonzalez)
+* Added support for Polish (Joseph Wilk)
+* Support specifying multiple formatters and multiple outputs (#47 Joseph Wilk)
+* Added support for Japanese. (Kakutani Shintaro)
+* Added support for Texan (improvements welcome). (Aslak Hellesøy)
+
+=== Bugfixes
+* Pending step snippets should escape special Regexp characters (#82 Joseph Wilk)
+* Scenario without a body shouldn't show up as complete (#63 Josh Knowles)
+* Fixed bug where utf-8 strings where breaking comment alighments. (#79 Joseph Wilk)
+* Fixed next_column_index not resetting after large tables (#60, Barry Mitchelson)
+* The HTML formatter was rendering everything twice. Cannot invoke visit_feature on formatters in executor (#72 Joseph Wilk)
+* Row Scenarios need to support pending? in order for the Profile formatter to work (Joseph Wilk)
+* Snippets are not shown for steps which already have a step definition (#65 Joseph Wilk)
+* Prevent feature/scenario/pending step comments from containing '//' when running features by specifying a directory with a trailing '/' (Joseph Wilk)
+* Scenario tables need spacing after them (#59 Joseph Wilk)
+* Support running scenario table rows when using --line argument (#55 Joseph Wilk)
+* Don't load cucumber.yml unless it exists (Aslak Hellesøy)
+* Fixing bug where specifying line number 1 in a feature which starts with a scenario with a scenario table was raising an error (#56 Joseph Wilk)
+
+=== Removed features
+
+
+== 0.1.8 2008-10-18
+
+This release extends the support for tables. PLEASE NOTE THAT TABLES ARE STILL EXPERIMENTAL.
+In previous releases it has been possible to use tables to define "more examples" of a scenario i
+n a FIT-style column fixture kind of way. Now you can also use tables as arguments to steps.
+
+Tables used to define more examples after a scenario must now be prefixed. In English it looks like this:
+
+ Feature: Addition
+ In order to avoid silly mistakes
+ As a math idiot
+ I want to be told the sum of two numbers
+
+ Scenario: Add two numbers
+ Given I have entered 50 into the calculator
+ And I have entered 70 into the calculator
+ When I press add
+ Then the result should be 120 on the screen
+ And the result class should be Fixnum
+
+ More Examples:
+ | input_1 | input_2 | button | output | class |
+ | 20 | 30 | add | 50 | Fixnum |
+ | 2 | 5 | add | 7 | Fixnum |
+ | 0 | 40 | add | 40 | Fixnum |
+
+Languages that are not updated yet will have to use "More Examples" until we get the translations.
+
+Tables can also be used as arguments to individual steps. In fact, steps now support a single argument
+that can span several lines. This can be a table or a string.
+
+Example:
+
+ Given the following people exist:
+ | name | email | phone |
+ | Aslak | aslak@email.com | 123 |
+ | Joe | joe@email.com | 234 |
+ | Bryan | bryan@email.org | 456 |
+ When I search for email.com
+ Then I should see:
+ | name | email | phone |
+ | Aslak | aslak@email.com | 123 |
+ | Joe | joe@email.com | 234 |
+ And I should see:
+ "Some text
+ on several lines"
+
+The step definitions for such multiline steps must define an extra block argument for the argument:
+
+ Given /the following people exist:/ do |people_table|
+ # people_table is of type Cucumber::Model::Table
+ # See RDoc for more info
+ end
+
+ Then /I should see:/ do |string|
+ # string is a plain old ruby String with leading spaces on each line removed
+ end
+
+=== New features
+* Added profile formatter. (#35, Joseph Wilk)
+* Added support for Chinese Simplified. (Liming Lian)
+* Added support for Dutch. (Sjoerd Tieleman)
+* Multiline steps are now supported. (#4, Aslak Hellesøy)
+* Tables used to define more examples for a scenario must be prefixed "More Examples" (see languages.yml for other languages)
+* Show the file and line number for scenarios as a comment when displaying with the pretty formatter. (#40, Joseph Wilk)
+* Show the file for the feature as a comment when displaying with the pretty formatter. (#40, Joseph Wilk)
+* Show the feature file and line for pending steps as a comment when displaying with the pretty formatter. (#40, Joseph Wilk)
+
+=== Bugfixes
+* Fixed speling errors in Spanish (Daniel Cadenas)
+* ActionMailer delivery_method should not be set to test (#41, Luke Melia)
+* Reverse incorrectly ordered args in webrat select step (#43, David Chelimsky)
+* Support comments above the first scenario (#31, Aslak Hellesøy)
+* Fixed the HTML Formatter to use actual values for FIT table headers (#30, Joseph Wilk)
+
+=== Removed features
+* Removed the /^I go to (.*)$/ step from common_webrat.rb - it's not language agnostic and provides little value.
+
+=== New features
+* Added new --out option to make it easier to specify output from Rake and cucumber.yml
+
+== 0.1.7 2008-10-05
+
+This release fixes a few bugs and adds some new features. The most notable features are:
+
+=== Calling steps from steps
+
+Step definitions are a little bit closer to having regular method semantics.
+You define them, but now you can also call them from other steps. Here is an
+example:
+
+ Given /I am logged in as an (.*) named (.*)$/ do |role, name|
+ Given "I am registered as #{role}, #{name}, secret"
+ When "I log in with #{name}, secret"
+ end
+
+ Given /I am registered as (.*), (.*), (.*)/ do |role, name, password|
+ # (Code removed for brevity)
+ end
+
+ When /I log in with (.*), (.*)/ do |name, password|
+ # (Code removed for brevity)
+ end
+
+This means that steps can be reused in other steps. The GivenScenario feature achieves a similar
+effect (on the scenario level), but this feature is something we're not very happy with, mostly
+because it's not parameterisable. Calling steps from steps is.
+
+GivenScenario will still be working several releases, but the plan is to remove it completely in
+the 0.3.0 release.
+
+=== Seeing where a step is defined
+
+Prior to this release it could be hard to find out where the ruby step definition matching
+a plain text step is defined. Not anymore! Cucumber will now output this:
+
+ Scenario: Regular numbers
+ Given I have entered 3 into the calculator # features/steps/calculator_steps.rb:12
+ And I have entered 2 into the calculator # features/steps/calculator_steps.rb:12
+ When I press divide # features/steps/calculator_steps.rb:16
+ Then the result should be 1.5 on the screen # features/steps/calculator_steps.rb:20
+ And the result class should be Float # features/steps/calculator_steps.rb:24
+
+=== Bugfixes
+* Fixed a bug in the command line args being lost when using --profile (#27, Joseph Wilk)
+* Fixed a bug in Webrat selects (Tim Glen)
+* Fixed parsing of DOS line endings (#2, #28, Aslak Hellesøy)
+
+=== New features
+* Steps can be called from other steps (#3, Bryan Helmkamp, Aslak Hellesøy)
+* Added But keyword to all languages (#21, Aslak Hellesøy)
+* Added --no-source option to display step definition location next to step text (#26, Joseph Wilk, Aslak Hellesøy)
+* Added more Webrat steps (#25, Tim Glen)
+
+== 0.1.6 2008-10-01
+
+First gem release!
View
20 vendor/plugins/cucumber/License.txt
@@ -0,0 +1,20 @@
+Copyright (c) 2008 Aslak Hellesøy
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
View
241 vendor/plugins/cucumber/Manifest.txt
@@ -0,0 +1,241 @@
+History.txt
+License.txt
+Manifest.txt
+README.txt
+Rakefile
+TODO.txt
+bin/cucumber
+config/hoe.rb
+config/requirements.rb
+cucumber.yml
+examples/calculator_ruby_features/Rakefile
+examples/calculator_ruby_features/features/addition.rb
+examples/calculator_ruby_features/features/step_definitons/calculator_steps.rb
+examples/cs/README.textile
+examples/cs/Rakefile
+examples/cs/features/hello.feature
+examples/cs/features/step_definitons/hello_steps.rb
+examples/cs/features/step_definitons/tree_steps.rb
+examples/cs/features/tree.feature
+examples/cs/src/Hello.cs
+examples/dos_line_endings/Rakefile
+examples/dos_line_endings/features/dos_line_endings.feature
+examples/i18n/README.textile
+examples/i18n/Rakefile
+examples/i18n/ar/Rakefile
+examples/i18n/ar/features/addition.feature
+examples/i18n/ar/features/step_definitons/calculator_steps.rb
+examples/i18n/ar/lib/calculator.rb
+examples/i18n/da/Rakefile
+examples/i18n/da/features/step_definitons/kalkulator_steps.rb
+examples/i18n/da/features/summering.feature
+examples/i18n/da/lib/kalkulator.rb
+examples/i18n/de/Rakefile
+examples/i18n/de/features/addition.feature
+examples/i18n/de/features/division.feature
+examples/i18n/de/features/step_definitons/calculator_steps.rb
+examples/i18n/de/lib/calculator.rb
+examples/i18n/en/Rakefile
+examples/i18n/en/features/addition.feature
+examples/i18n/en/features/division.feature
+examples/i18n/en/features/step_definitons/calculator_steps.rb
+examples/i18n/en/lib/calculator.rb
+examples/i18n/es/Rakefile
+examples/i18n/es/features/adicion.feature
+examples/i18n/es/features/step_definitons/calculador_steps.rb
+examples/i18n/es/lib/calculador.rb
+examples/i18n/et/Rakefile
+examples/i18n/et/features/liitmine.feature
+examples/i18n/et/features/step_definitions/kalkulaator_steps.rb
+examples/i18n/et/lib/kalkulaator.rb
+examples/i18n/fr/Rakefile
+examples/i18n/fr/features/addition.feature
+examples/i18n/fr/features/step_definitions/calculatrice_steps.rb
+examples/i18n/fr/lib/calculatrice.rb
+examples/i18n/id/Rakefile
+examples/i18n/id/features/addition.feature
+examples/i18n/id/features/division.feature
+examples/i18n/id/features/step_definitons/calculator_steps.rb
+examples/i18n/id/lib/calculator.rb
+examples/i18n/it/Rakefile
+examples/i18n/it/features/somma.feature
+examples/i18n/it/features/step_definitons/calcolatrice_steps.rb
+examples/i18n/it/lib/calcolatrice.rb
+examples/i18n/ja/README.txt
+examples/i18n/ja/Rakefile
+examples/i18n/ja/features/addition.feature
+examples/i18n/ja/features/division.feature
+examples/i18n/ja/features/step_definitons/calculator_steps.rb
+examples/i18n/ja/lib/calculator.rb
+examples/i18n/lt/Rakefile
+examples/i18n/lt/features/addition.feature
+examples/i18n/lt/features/division.feature
+examples/i18n/lt/features/step_definitons/calculator_steps.rb
+examples/i18n/lt/lib/calculator.rb
+examples/i18n/no/Rakefile
+examples/i18n/no/features/step_definitons/kalkulator_steps.rb
+examples/i18n/no/features/summering.feature
+examples/i18n/no/lib/kalkulator.rb
+examples/i18n/pt/Rakefile
+examples/i18n/pt/features/adicao.feature
+examples/i18n/pt/features/step_definitions/calculadora_steps.rb
+examples/i18n/pt/lib/calculadora.rb
+examples/i18n/ro/Rakefile
+examples/i18n/ro/features/step_definitons/calculator_steps.rb
+examples/i18n/ro/features/suma.feature
+examples/i18n/ro/lib/calculator.rb
+examples/i18n/se/Rakefile
+examples/i18n/se/features/step_definitons/kalkulator_steps.rb
+examples/i18n/se/features/summering.feature
+examples/i18n/se/lib/kalkulator.rb
+examples/i18n/zh-CN/Rakefile
+examples/i18n/zh-CN/features/addition.feature
+examples/i18n/zh-CN/features/step_definitons/calculator_steps.rb
+examples/i18n/zh-CN/lib/calculator.rb
+examples/java/README.textile
+examples/java/Rakefile
+examples/java/features/hello.feature
+examples/java/features/step_definitons/hello_steps.rb
+examples/java/features/step_definitons/tree_steps.rb
+examples/java/features/tree.feature
+examples/java/src/cucumber/demo/Hello.java
+examples/selenium/Rakefile
+examples/selenium/features/search.feature
+examples/selenium/features/step_definitons/stories_steps.rb
+examples/test_unit/Rakefile
+examples/test_unit/features/step_definitions/test_unit_steps.rb
+examples/test_unit/features/test_unit.feature
+examples/tickets/Rakefile
+examples/tickets/cucumber.yml
+examples/tickets/features/step_definitons/tickets_steps.rb
+examples/tickets/features/tickets.feature
+examples/watir/Rakefile
+examples/watir/features/search.feature
+examples/watir/features/step_definitons/stories_steps.rb
+features/see_features.feature
+features/steps/features_steps.rb
+gem_tasks/deployment.rake
+gem_tasks/environment.rake
+gem_tasks/features.rake
+gem_tasks/fix_cr_lf.rake
+gem_tasks/flog.rake
+gem_tasks/gemspec.rake
+gem_tasks/rspec.rake
+gem_tasks/treetop.rake
+lib/autotest/cucumber.rb
+lib/autotest/cucumber_mixin.rb
+lib/autotest/cucumber_rails.rb
+lib/autotest/cucumber_rails_rspec.rb
+lib/autotest/cucumber_rspec.rb
+lib/autotest/discover.rb
+lib/cucumber.rb
+lib/cucumber/broadcaster.rb
+lib/cucumber/cli.rb
+lib/cucumber/core_ext/proc.rb
+lib/cucumber/core_ext/string.rb
+lib/cucumber/executor.rb
+lib/cucumber/formatters.rb
+lib/cucumber/formatters/ansicolor.rb
+lib/cucumber/formatters/autotest_formatter.rb
+lib/cucumber/formatters/cucumber.css
+lib/cucumber/formatters/cucumber.js
+lib/cucumber/formatters/html_formatter.rb
+lib/cucumber/formatters/jquery.js
+lib/cucumber/formatters/pretty_formatter.rb
+lib/cucumber/formatters/profile_formatter.rb
+lib/cucumber/formatters/progress_formatter.rb
+lib/cucumber/languages.yml
+lib/cucumber/model.rb
+lib/cucumber/model/table.rb
+lib/cucumber/platform.rb
+lib/cucumber/rails/rspec.rb
+lib/cucumber/rails/world.rb
+lib/cucumber/rake/task.rb
+lib/cucumber/step_methods.rb
+lib/cucumber/step_mother.rb
+lib/cucumber/tree.rb
+lib/cucumber/tree/feature.rb
+lib/cucumber/tree/features.rb
+lib/cucumber/tree/given_scenario.rb
+lib/cucumber/tree/scenario.rb
+lib/cucumber/tree/step.rb
+lib/cucumber/tree/table.rb
+lib/cucumber/tree/top_down_visitor.rb
+lib/cucumber/treetop_parser/feature.treetop.erb
+lib/cucumber/treetop_parser/feature_ar.rb
+lib/cucumber/treetop_parser/feature_cy.rb
+lib/cucumber/treetop_parser/feature_da.rb
+lib/cucumber/treetop_parser/feature_de.rb
+lib/cucumber/treetop_parser/feature_en-tx.rb
+lib/cucumber/treetop_parser/feature_en.rb
+lib/cucumber/treetop_parser/feature_es.rb
+lib/cucumber/treetop_parser/feature_et.rb
+lib/cucumber/treetop_parser/feature_fr.rb
+lib/cucumber/treetop_parser/feature_id.rb
+lib/cucumber/treetop_parser/feature_it.rb
+lib/cucumber/treetop_parser/feature_ja.rb
+lib/cucumber/treetop_parser/feature_lt.rb
+lib/cucumber/treetop_parser/feature_nl.rb
+lib/cucumber/treetop_parser/feature_no.rb
+lib/cucumber/treetop_parser/feature_parser.rb
+lib/cucumber/treetop_parser/feature_pl.rb
+lib/cucumber/treetop_parser/feature_pt.rb
+lib/cucumber/treetop_parser/feature_ro.rb
+lib/cucumber/treetop_parser/feature_ro2.rb
+lib/cucumber/treetop_parser/feature_ru.rb
+lib/cucumber/treetop_parser/feature_se.rb
+lib/cucumber/treetop_parser/feature_zh-CN.rb
+lib/cucumber/version.rb
+rails_generators/cucumber/USAGE
+rails_generators/cucumber/cucumber_generator.rb
+rails_generators/cucumber/templates/cucumber
+rails_generators/cucumber/templates/cucumber.rake
+rails_generators/cucumber/templates/env.rb
+rails_generators/cucumber/templates/webrat_steps.rb
+rails_generators/feature/USAGE
+rails_generators/feature/feature_generator.rb
+rails_generators/feature/templates/feature.erb
+rails_generators/feature/templates/steps.erb
+script/console
+script/console.cmd
+script/destroy
+script/destroy.cmd
+script/generate
+script/generate.cmd
+script/txt2html
+script/txt2html.cmd
+setup.rb
+spec/cucumber/broadcaster_spec.rb
+spec/cucumber/cli_spec.rb
+spec/cucumber/core_ext/proc_spec.rb
+spec/cucumber/core_ext/string_spec.rb
+spec/cucumber/executor_spec.rb
+spec/cucumber/formatters/ansicolor_spec.rb
+spec/cucumber/formatters/autotest_formatter_spec.rb
+spec/cucumber/formatters/features.html
+spec/cucumber/formatters/html_formatter_spec.rb
+spec/cucumber/formatters/pretty_formatter_spec.rb
+spec/cucumber/formatters/profile_formatter_spec.rb
+spec/cucumber/formatters/progress_formatter_spec.rb
+spec/cucumber/model/table_spec.rb
+spec/cucumber/rails/stubs/mini_rails.rb
+spec/cucumber/rails/stubs/test_help.rb
+spec/cucumber/rails/world_spec.rb
+spec/cucumber/sell_cucumbers.feature
+spec/cucumber/step_mother_spec.rb
+spec/cucumber/tree/feature_spec.rb
+spec/cucumber/tree/row_scenario_spec.rb
+spec/cucumber/tree/scenario_spec.rb
+spec/cucumber/tree/step_spec.rb
+spec/cucumber/treetop_parser/empty_feature.feature
+spec/cucumber/treetop_parser/empty_scenario.feature
+spec/cucumber/treetop_parser/feature_parser_spec.rb
+spec/cucumber/treetop_parser/fit_scenario.feature
+spec/cucumber/treetop_parser/given_scenario.feature
+spec/cucumber/treetop_parser/multiline_steps.feature
+spec/cucumber/treetop_parser/multiple_tables.feature
+spec/cucumber/treetop_parser/spaces.feature
+spec/cucumber/treetop_parser/test_dos.feature
+spec/cucumber/treetop_parser/with_comments.feature
+spec/spec.opts
+spec/spec_helper.rb
View
41 vendor/plugins/cucumber/README.txt
@@ -0,0 +1,41 @@
+= Cucumber
+
+* http://github.com/aslakhellesoy/cucumber
+
+== DESCRIPTION:
+
+Cucumber executes plain text documentation of code against that code.
+Documentation: http://github.com/aslakhellesoy/cucumber/wikis/home
+
+== REQUIREMENTS:
+
+* FIX (list of requirements)
+
+== INSTALL:
+
+* gem install cucumber
+
+== LICENSE:
+
+(The MIT License)
+
+Copyright (c) 2008 Aslak Hellesøy
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
View
9 vendor/plugins/cucumber/Rakefile
@@ -0,0 +1,9 @@
+ENV['NODOT'] = 'true' # We don't want class diagrams in RDoc
+require 'config/requirements'
+require 'config/hoe' # setup Hoe + all gem configuration
+
+Dir['gem_tasks/**/*.rake'].each { |rake| load rake }
+
+# Hoe gives us :default => :test, but we don't have Test::Unit tests.
+Rake::Task[:default].clear_prerequisites
+task :default => [:spec, :features]
View
26 vendor/plugins/cucumber/TODO.txt
@@ -0,0 +1,26 @@
+== FEATURES/PROBLEMS:
+
+* TODO: OK Refactor: Extract explicit node classes with RDoc (for better API doc)
+* TODO: OK Get rid of the compile method. Compile the parser in Rake.
+* TODO: OK Make grammar support \r\n, \r and \n (Add some fixture features for that)
+* TODO: OK Make grammar support indentation
+* TODO: OK Make grammar be totally relaxed about narrative
+* TODO: OK Add a yaml file for different languages
+* TODO: OK Custom nodes for the syntax tree
+* TODO: OK Actually execute the features
+* TODO: Make rake run specs by default
+* TODO: OK Make it work with pure ruby regexen
+* TODO: OK Make it work with string steps
+* TODO: bin/cucumber --require [dir|file|glob]* --language no --format [file]*
+* TODO: OK Pending steps shold print a block of code that can be pasted into code
+* TODO: cucumber --where "Some text from a step" that prints "__FILE__:__LINE__ (STEP PATTERN)"
+* TODO: Customisable trace output (like javascriptlint)
+* TODO: Experiment: Make $variables become @variables
+* TODO: OK GivenScenario
+* TODO: OK PureRuby
+ * Make two trees include accept mixin
+* TODO: Call steps from steps
+* TODO: i18n in ruby too
+* TODO: Don't load any treetop files if no .feature files are found
+* TODO: Summary prints execution time
+* TODO: --nocolor option
View
6 vendor/plugins/cucumber/bin/cucumber
@@ -0,0 +1,6 @@
+#!/usr/bin/env ruby
+# Add '.rb' to work around a bug in IronRuby's File#dirname
+$:.unshift(File.dirname(__FILE__ + '.rb') + '/../lib') unless $:.include?(File.dirname(__FILE__ + '.rb') + '/../lib')
+
+require 'cucumber/cli'
+Cucumber::CLI.execute
View
70 vendor/plugins/cucumber/config/hoe.rb
@@ -0,0 +1,70 @@
+require 'cucumber/version'
+
+AUTHOR = 'Aslak Hellesøy' # can also be an array of Authors
+EMAIL = "aslak.hellesoy@gmail.com"
+DESCRIPTION = "Executable Feature scenarios"
+GEM_NAME = 'cucumber' # what ppl will type to install your gem
+HOMEPATH = "http://github.com/aslakhellesoy/cucumber"
+RUBYFORGE_PROJECT = 'rspec'
+
+@config_file = "~/.rubyforge/user-config.yml"
+@config = nil
+RUBYFORGE_USERNAME = "aslak_hellesoy"
+def rubyforge_username
+ unless @config
+ begin
+ @config = YAML.load(File.read(File.expand_path(@config_file)))
+ rescue
+ puts <<-EOS
+ERROR: No rubyforge config file found: #{@config_file}
+Run 'rubyforge setup' to prepare your env for access to Rubyforge
+ - See http://newgem.rubyforge.org/rubyforge.html for more details
+ EOS
+ exit
+ end
+ end
+ RUBYFORGE_USERNAME.replace @config["username"]
+end
+
+
+REV = nil
+# UNCOMMENT IF REQUIRED:
+# REV = YAML.load(`svn info`)['Revision']
+VERS = Cucumber::VERSION::STRING + (REV ? ".#{REV}" : "")
+RDOC_OPTS = ['--quiet', '--title', 'Cucumber documentation',
+ "--opname", "index.html",
+ "--line-numbers",
+ "--main", "README.textile",
+ "--inline-source"]
+
+class Hoe
+ def extra_deps
+ @extra_deps.reject! { |x| Array(x).first == 'hoe' }
+ @extra_deps
+ end
+end
+
+# Generate all the Rake tasks
+# Run 'rake -T' to see list of generated tasks (from gem root directory)
+$hoe = Hoe.new(GEM_NAME, VERS) do |p|
+ p.developer(AUTHOR, EMAIL)
+ p.description = DESCRIPTION
+ p.summary = DESCRIPTION
+ p.url = HOMEPATH
+ p.rubyforge_name = RUBYFORGE_PROJECT if RUBYFORGE_PROJECT
+ p.clean_globs |= ['**/.*.sw?', '*.gem', '.config', '**/.DS_Store', '**/*.class', '**/*.jar'] #An array of file patterns to delete on clean.
+
+ # == Optional
+ p.changes = p.paragraphs_of("History.txt", 0..1).join("\n\n")
+ #p.extra_deps = [] # An array of rubygem dependencies [name, version], e.g. [ ['active_support', '>= 1.3.1'] ]
+ p.extra_deps = [ ['term-ansicolor', '>= 1.0.3'], ['treetop', '>= 1.2.4'], ['diff-lcs', '>= 1.1.2'] ]
+ p.extra_dev_deps = [ ['rspec', '>= 1.1.11'] ]
+
+ #p.spec_extras = {} # A hash of extra values to set in the gemspec.
+
+end
+
+CHANGES = $hoe.paragraphs_of('History.txt', 0..1).join("\\n\\n")
+PATH = (RUBYFORGE_PROJECT == GEM_NAME) ? RUBYFORGE_PROJECT : "#{RUBYFORGE_PROJECT}/#{GEM_NAME}"
+$hoe.remote_rdoc_dir = File.join(PATH.gsub(/^#{RUBYFORGE_PROJECT}\/?/,''), 'rdoc')
+$hoe.rsync_args = '-av --delete --ignore-errors'
View
15 vendor/plugins/cucumber/config/requirements.rb
@@ -0,0 +1,15 @@
+require 'fileutils'
+include FileUtils
+
+require 'rubygems'
+%w[rake hoe].each do |req_gem|
+ begin
+ require req_gem
+ rescue LoadError
+ puts "This Rakefile requires the '#{req_gem}' RubyGem."
+ puts "Installation: gem install #{req_gem} -y"
+ exit
+ end
+end
+
+$:.unshift(File.join(File.dirname(__FILE__), %w[.. lib]))
View
46 vendor/plugins/cucumber/cucumber.gemspec
@@ -0,0 +1,46 @@
+Gem::Specification.new do |s|
+ s.name = %q{cucumber}
+ s.version = "0.1.10"
+
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
+ s.authors = ["Aslak Helles\303\270y"]
+ s.date = %q{2008-11-25}
+ s.default_executable = %q{cucumber}
+ s.description = %q{Executable Feature scenarios}
+ s.email = ["aslak.hellesoy@gmail.com"]
+ s.executables = ["cucumber"]
+ s.extra_rdoc_files = ["History.txt", "License.txt", "Manifest.txt", "README.txt", "TODO.txt", "examples/i18n/ja/README.txt"]
+ s.files = ["History.txt", "License.txt", "Manifest.txt", "README.txt", "Rakefile", "TODO.txt", "bin/cucumber", "config/hoe.rb", "config/requirements.rb", "cucumber.yml", "examples/calculator_ruby_features/Rakefile", "examples/calculator_ruby_features/features/addition.rb", "examples/calculator_ruby_features/features/step_definitons/calculator_steps.rb", "examples/cs/README.textile", "examples/cs/Rakefile", "examples/cs/features/hello.feature", "examples/cs/features/step_definitons/hello_steps.rb", "examples/cs/features/step_definitons/tree_steps.rb", "examples/cs/features/tree.feature", "examples/cs/src/Hello.cs", "examples/dos_line_endings/Rakefile", "examples/dos_line_endings/features/dos_line_endings.feature", "examples/i18n/README.textile", "examples/i18n/Rakefile", "examples/i18n/ar/Rakefile", "examples/i18n/ar/features/addition.feature", "examples/i18n/ar/features/step_definitons/calculator_steps.rb", "examples/i18n/ar/lib/calculator.rb", "examples/i18n/da/Rakefile", "examples/i18n/da/features/step_definitons/kalkulator_steps.rb", "examples/i18n/da/features/summering.feature", "examples/i18n/da/lib/kalkulator.rb", "examples/i18n/de/Rakefile", "examples/i18n/de/features/addition.feature", "examples/i18n/de/features/division.feature", "examples/i18n/de/features/step_definitons/calculator_steps.rb", "examples/i18n/de/lib/calculator.rb", "examples/i18n/en/Rakefile", "examples/i18n/en/features/addition.feature", "examples/i18n/en/features/division.feature", "examples/i18n/en/features/step_definitons/calculator_steps.rb", "examples/i18n/en/lib/calculator.rb", "examples/i18n/es/Rakefile", "examples/i18n/es/features/adicion.feature", "examples/i18n/es/features/step_definitons/calculador_steps.rb", "examples/i18n/es/lib/calculador.rb", "examples/i18n/et/Rakefile", "examples/i18n/et/features/liitmine.feature", "examples/i18n/et/features/step_definitions/kalkulaator_steps.rb", "examples/i18n/et/lib/kalkulaator.rb", "examples/i18n/fr/Rakefile", "examples/i18n/fr/features/addition.feature", "examples/i18n/fr/features/step_definitions/calculatrice_steps.rb", "examples/i18n/fr/lib/calculatrice.rb", "examples/i18n/id/Rakefile", "examples/i18n/id/features/addition.feature", "examples/i18n/id/features/division.feature", "examples/i18n/id/features/step_definitons/calculator_steps.rb", "examples/i18n/id/lib/calculator.rb", "examples/i18n/it/Rakefile", "examples/i18n/it/features/somma.feature", "examples/i18n/it/features/step_definitons/calcolatrice_steps.rb", "examples/i18n/it/lib/calcolatrice.rb", "examples/i18n/ja/README.txt", "examples/i18n/ja/Rakefile", "examples/i18n/ja/features/addition.feature", "examples/i18n/ja/features/division.feature", "examples/i18n/ja/features/step_definitons/calculator_steps.rb", "examples/i18n/ja/lib/calculator.rb", "examples/i18n/lt/Rakefile", "examples/i18n/lt/features/addition.feature", "examples/i18n/lt/features/division.feature", "examples/i18n/lt/features/step_definitons/calculator_steps.rb", "examples/i18n/lt/lib/calculator.rb", "examples/i18n/no/Rakefile", "examples/i18n/no/features/step_definitons/kalkulator_steps.rb", "examples/i18n/no/features/summering.feature", "examples/i18n/no/lib/kalkulator.rb", "examples/i18n/pt/Rakefile", "examples/i18n/pt/features/adicao.feature", "examples/i18n/pt/features/step_definitions/calculadora_steps.rb", "examples/i18n/pt/lib/calculadora.rb", "examples/i18n/ro/Rakefile", "examples/i18n/ro/features/step_definitons/calculator_steps.rb", "examples/i18n/ro/features/suma.feature", "examples/i18n/ro/lib/calculator.rb", "examples/i18n/se/Rakefile", "examples/i18n/se/features/step_definitons/kalkulator_steps.rb", "examples/i18n/se/features/summering.feature", "examples/i18n/se/lib/kalkulator.rb", "examples/i18n/zh-CN/Rakefile", "examples/i18n/zh-CN/features/addition.feature", "examples/i18n/zh-CN/features/step_definitons/calculator_steps.rb", "examples/i18n/zh-CN/lib/calculator.rb", "examples/java/README.textile", "examples/java/Rakefile", "examples/java/features/hello.feature", "examples/java/features/step_definitons/hello_steps.rb", "examples/java/features/step_definitons/tree_steps.rb", "examples/java/features/tree.feature", "examples/java/src/cucumber/demo/Hello.java", "examples/selenium/Rakefile", "examples/selenium/features/search.feature", "examples/selenium/features/step_definitons/stories_steps.rb", "examples/test_unit/Rakefile", "examples/test_unit/features/step_definitions/test_unit_steps.rb", "examples/test_unit/features/test_unit.feature", "examples/tickets/Rakefile", "examples/tickets/cucumber.yml", "examples/tickets/features/step_definitons/tickets_steps.rb", "examples/tickets/features/tickets.feature", "examples/watir/Rakefile", "examples/watir/features/search.feature", "examples/watir/features/step_definitons/stories_steps.rb", "features/see_features.feature", "features/steps/features_steps.rb", "gem_tasks/deployment.rake", "gem_tasks/environment.rake", "gem_tasks/features.rake", "gem_tasks/fix_cr_lf.rake", "gem_tasks/flog.rake", "gem_tasks/gemspec.rake", "gem_tasks/rspec.rake", "gem_tasks/treetop.rake", "lib/autotest/cucumber.rb", "lib/autotest/cucumber_mixin.rb", "lib/autotest/cucumber_rails.rb", "lib/autotest/cucumber_rails_rspec.rb", "lib/autotest/cucumber_rspec.rb", "lib/autotest/discover.rb", "lib/cucumber.rb", "lib/cucumber/broadcaster.rb", "lib/cucumber/cli.rb", "lib/cucumber/core_ext/proc.rb", "lib/cucumber/core_ext/string.rb", "lib/cucumber/executor.rb", "lib/cucumber/formatters.rb", "lib/cucumber/formatters/ansicolor.rb", "lib/cucumber/formatters/autotest_formatter.rb", "lib/cucumber/formatters/cucumber.css", "lib/cucumber/formatters/cucumber.js", "lib/cucumber/formatters/html_formatter.rb", "lib/cucumber/formatters/jquery.js", "lib/cucumber/formatters/pretty_formatter.rb", "lib/cucumber/formatters/profile_formatter.rb", "lib/cucumber/formatters/progress_formatter.rb", "lib/cucumber/languages.yml", "lib/cucumber/model.rb", "lib/cucumber/model/table.rb", "lib/cucumber/platform.rb", "lib/cucumber/rails/rspec.rb", "lib/cucumber/rails/world.rb", "lib/cucumber/rake/task.rb", "lib/cucumber/step_methods.rb", "lib/cucumber/step_mother.rb", "lib/cucumber/tree.rb", "lib/cucumber/tree/feature.rb", "lib/cucumber/tree/features.rb", "lib/cucumber/tree/given_scenario.rb", "lib/cucumber/tree/scenario.rb", "lib/cucumber/tree/step.rb", "lib/cucumber/tree/table.rb", "lib/cucumber/tree/top_down_visitor.rb", "lib/cucumber/treetop_parser/feature.treetop.erb", "lib/cucumber/treetop_parser/feature_ar.rb", "lib/cucumber/treetop_parser/feature_cy.rb", "lib/cucumber/treetop_parser/feature_da.rb", "lib/cucumber/treetop_parser/feature_de.rb", "lib/cucumber/treetop_parser/feature_en-tx.rb", "lib/cucumber/treetop_parser/feature_en.rb", "lib/cucumber/treetop_parser/feature_es.rb", "lib/cucumber/treetop_parser/feature_et.rb", "lib/cucumber/treetop_parser/feature_fr.rb", "lib/cucumber/treetop_parser/feature_id.rb", "lib/cucumber/treetop_parser/feature_it.rb", "lib/cucumber/treetop_parser/feature_ja.rb", "lib/cucumber/treetop_parser/feature_lt.rb", "lib/cucumber/treetop_parser/feature_nl.rb", "lib/cucumber/treetop_parser/feature_no.rb", "lib/cucumber/treetop_parser/feature_parser.rb", "lib/cucumber/treetop_parser/feature_pl.rb", "lib/cucumber/treetop_parser/feature_pt.rb", "lib/cucumber/treetop_parser/feature_ro.rb", "lib/cucumber/treetop_parser/feature_ro2.rb", "lib/cucumber/treetop_parser/feature_ru.rb", "lib/cucumber/treetop_parser/feature_se.rb", "lib/cucumber/treetop_parser/feature_zh-CN.rb", "lib/cucumber/version.rb", "rails_generators/cucumber/USAGE", "rails_generators/cucumber/cucumber_generator.rb", "rails_generators/cucumber/templates/cucumber", "rails_generators/cucumber/templates/cucumber.rake", "rails_generators/cucumber/templates/env.rb", "rails_generators/cucumber/templates/webrat_steps.rb", "rails_generators/feature/USAGE", "rails_generators/feature/feature_generator.rb", "rails_generators/feature/templates/feature.erb", "rails_generators/feature/templates/steps.erb", "script/console", "script/console.cmd", "script/destroy", "script/destroy.cmd", "script/generate", "script/generate.cmd", "script/txt2html", "script/txt2html.cmd", "setup.rb", "spec/cucumber/broadcaster_spec.rb", "spec/cucumber/cli_spec.rb", "spec/cucumber/core_ext/proc_spec.rb", "spec/cucumber/core_ext/string_spec.rb", "spec/cucumber/executor_spec.rb", "spec/cucumber/formatters/ansicolor_spec.rb", "spec/cucumber/formatters/autotest_formatter_spec.rb", "spec/cucumber/formatters/features.html", "spec/cucumber/formatters/html_formatter_spec.rb", "spec/cucumber/formatters/pretty_formatter_spec.rb", "spec/cucumber/formatters/profile_formatter_spec.rb", "spec/cucumber/formatters/progress_formatter_spec.rb", "spec/cucumber/model/table_spec.rb", "spec/cucumber/rails/stubs/mini_rails.rb", "spec/cucumber/rails/stubs/test_help.rb", "spec/cucumber/rails/world_spec.rb", "spec/cucumber/sell_cucumbers.feature", "spec/cucumber/step_mother_spec.rb", "spec/cucumber/tree/feature_spec.rb", "spec/cucumber/tree/row_scenario_spec.rb", "spec/cucumber/tree/scenario_spec.rb", "spec/cucumber/tree/step_spec.rb", "spec/cucumber/treetop_parser/empty_feature.feature", "spec/cucumber/treetop_parser/empty_scenario.feature", "spec/cucumber/treetop_parser/feature_parser_spec.rb", "spec/cucumber/treetop_parser/fit_scenario.feature", "spec/cucumber/treetop_parser/given_scenario.feature", "spec/cucumber/treetop_parser/multiline_steps.feature", "spec/cucumber/treetop_parser/multiple_tables.feature", "spec/cucumber/treetop_parser/spaces.feature", "spec/cucumber/treetop_parser/test_dos.feature", "spec/cucumber/treetop_parser/with_comments.feature", "spec/spec.opts", "spec/spec_helper.rb"]
+ s.has_rdoc = true
+ s.homepage = %q{http://github.com/aslakhellesoy/cucumber}
+ s.rdoc_options = ["--main", "README.txt"]
+ s.require_paths = ["lib"]
+ s.rubyforge_project = %q{rspec}
+ s.rubygems_version = %q{1.2.0}
+ s.summary = %q{Executable Feature scenarios}
+
+ if s.respond_to? :specification_version then
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
+ s.specification_version = 2
+
+ if current_version >= 3 then
+ s.add_runtime_dependency(%q<term-ansicolor>, [">= 1.0.3"])
+ s.add_runtime_dependency(%q<treetop>, [">= 1.2.4"])
+ s.add_runtime_dependency(%q<diff-lcs>, [">= 1.1.2"])
+ s.add_development_dependency(%q<rspec>, [">= 1.1.11"])
+ s.add_development_dependency(%q<hoe>, [">= 1.8.2"])
+ else
+ s.add_dependency(%q<term-ansicolor>, [">= 1.0.3"])
+ s.add_dependency(%q<treetop>, [">= 1.2.4"])
+ s.add_dependency(%q<diff-lcs>, [">= 1.1.2"])
+ s.add_dependency(%q<rspec>, [">= 1.1.11"])
+ s.add_dependency(%q<hoe>, [">= 1.8.2"])
+ end
+ else
+ s.add_dependency(%q<term-ansicolor>, [">= 1.0.3"])
+ s.add_dependency(%q<treetop>, [">= 1.2.4"])
+ s.add_dependency(%q<diff-lcs>, [">= 1.1.2"])
+ s.add_dependency(%q<rspec>, [">= 1.1.11"])
+ s.add_dependency(%q<hoe>, [">= 1.8.2"])
+ end
+end
View
1  vendor/plugins/cucumber/cucumber.yml
@@ -0,0 +1 @@
+default: --format progress features
View
6 vendor/plugins/cucumber/examples/calculator_ruby_features/Rakefile
@@ -0,0 +1,6 @@
+$:.unshift(File.dirname(__FILE__) + '/../../lib')
+require 'cucumber/rake/task'
+
+Cucumber::Rake::Task.new do |t|
+ t.cucumber_opts = "--format pretty"
+end
View
23 vendor/plugins/cucumber/examples/calculator_ruby_features/features/addition.rb
@@ -0,0 +1,23 @@
+require 'cucumber/cli' # Needed in order to run the feature with ruby
+
+Feature %|Addition
+ In order to avoid silly mistakes
+ As a math idiot
+ I want to be told the sum of two numbers| do
+
+ Scenario "Add two numbers" do
+ Given "I have entered 50 into the calculator"
+ And "I have entered 70 into the calculator"
+ When "I add"
+ Then "the result should be 120 on the screen"
+ And "the result class should be Fixnum"
+ end
+
+ Table do |t|
+ t | "input_1" | "input_2" | "output" | "class" | t
+ # This is kind of dumb - but it illustrates how scenarios can be "generated" in code.
+ 10.times do |n|
+ t | n | n*2 | n*3 | Fixnum | t
+ end
+ end
+end
View
43 vendor/plugins/cucumber/examples/calculator_ruby_features/features/step_definitons/calculator_steps.rb
@@ -0,0 +1,43 @@
+require 'spec'
+
+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
+
+Before do
+ @calc = Calculator.new
+end
+
+After do
+end
+
+Given /I have entered (\d+) into the calculator/ do |n|
+ @calc.push n.to_i
+end
+
+When 'I add' do
+ @result = @calc.add
+end
+
+When 'I divide' do
+ @result = @calc.divide
+end
+
+Then /the result should be (\d*) on the screen/ do |result|
+ @result.should == result.to_i
+end
+
+Then /the result class should be (\w*)/ do |class_name|
+ @result.class.name.should == class_name
+end
View
22 vendor/plugins/cucumber/examples/cs/README.textile
@@ -0,0 +1,22 @@
+h1. Using Cucumber with Java
+
+This directory contains code to demonstrate how Cucumber can be used to develop Java code.
+You need JRuby 1.1.3 or higher installed and JRuby's bin directory on your PATH.
+
+h2. Installing required gems
+
+jruby -S gem install aslakhellesoy-cucumber
+jruby -S gem install diff-lcs
+
+h2. Running the scenarios
+
+Open a shell in this directory (java) and execute the following command:
+
+<pre><code>
+jruby -S rake features
+</code></pre>
+
+This will compile the java code and package it in a jar file, and then run Cucumber against
+that code.
+
+There is a deliberate error. See if you can fix it!
View
12 vendor/plugins/cucumber/examples/cs/Rakefile
@@ -0,0 +1,12 @@
+$:.unshift(File.dirname(__FILE__) + '/../../lib')
+require 'cucumber/rake/task'
+
+Cucumber::Rake::Task.new(:features) do |t|
+ t.cucumber_opts = "--format pretty"
+end
+
+task :features => :compile
+
+task :compile do
+ sh "csc /target:library /out:Cucumber.Demo.dll src\\Hello.cs"
+end
View
11 vendor/plugins/cucumber/examples/cs/features/hello.feature
@@ -0,0 +1,11 @@
+Feature: Hello
+ In order to have more friends
+ I want to say hello
+
+ Scenario: Personal greeting
+ Given my name is Aslak
+ When I greet David
+ Then he should hear Hi, David. I'm Aslak.
+ And I should remember David as a friend
+ And I should get David's phone number
+
View
25 vendor/plugins/cucumber/examples/cs/features/step_definitons/hello_steps.rb
@@ -0,0 +1,25 @@
+require 'spec' # so we can call .should
+$LOAD_PATH.unshift(File.dirname(__FILE__) + '/../../src') # so the jar is found
+require 'dotnet'
+loadLibrary 'Cucumber.Demo'
+
+Given /my name is (\w+)/ do |name|
+ @hello = Hello.new # A .net object
+ @name = name
+end
+
+When /I greet (.*)/ do |someone|
+ @greeting = @hello.greet(someone, @name)
+end
+
+Then /he should hear (.*)\./ do |message|
+ @greeting.should == message
+end
+
+Then /I should remember (\w+) as a friend/ do |name|
+ @hello.isFriend(name).should == true
+end
+
+Then /I should get (\w+)'s phone number/ do |name|
+ @hello.getPhoneNumber(name).should_not == nil
+end
View
14 vendor/plugins/cucumber/examples/cs/features/step_definitons/tree_steps.rb
@@ -0,0 +1,14 @@
+require 'spec'
+require 'dotnet'
+
+Given /I have an empty set/ do
+ @set = System.Collections.ArrayList.new
+end
+
+When /I add (\w+)/ do |s|
+ @set.add(s)
+end
+
+Then /the contents should be (.*)/ do |s|
+ @set.to_a.join(" ").should == s
+end
View
9 vendor/plugins/cucumber/examples/cs/features/tree.feature
@@ -0,0 +1,9 @@
+Feature: Tree
+ In order to have more robust Java software
+ I want to use Cucumber against Java classes
+
+ Scenario: Use java.util.TreeSet
+ Given I have an empty set
+ When I add hello
+ And I add world
+ Then the contents should be hello world
View
1  vendor/plugins/cucumber/examples/cs/src/.gitignore
@@ -0,0 +1 @@
+cucumber_demo.jar
View
18 vendor/plugins/cucumber/examples/cs/src/Hello.cs
@@ -0,0 +1,18 @@
+using System;
+
+namespace Cucumber.Demo {
+ public class Hello {
+ public string Greet(string who, string from) {
+ return "Hi, " + who + ". I'm " + from;
+ }
+
+ public bool IsFriend(string who) {
+ return true;
+ }
+
+ public string GetPhoneNumber(string who) {
+ return "99999";
+//throw new Exception("My phone is secret!");
+ }
+ }
+}
View
6 vendor/plugins/cucumber/examples/dos_line_endings/Rakefile
@@ -0,0 +1,6 @@
+$:.unshift(File.dirname(__FILE__) + '/../../lib')
+require 'cucumber/rake/task'
+
+Cucumber::Rake::Task.new do |t|
+ t.cucumber_opts = "--format pretty"
+end
View
9 vendor/plugins/cucumber/examples/dos_line_endings/features/dos_line_endings.feature
@@ -0,0 +1,9 @@
+Feature: DOS line endings
+ In order to have less bug reports
+ As a windows developer
+ I want to write features with DOS line endigs
+
+ Scenario: Just lots of DOS
+ Given I am on DOS
+ And Any version of Windows is really just DOS
+ Then Windows still sucks
View
18 vendor/plugins/cucumber/examples/i18n/README.textile
@@ -0,0 +1,18 @@
+h1. Internationalisation (i18n) examples
+
+Under this directory you'll find examples of Cucumber features written in
+many of the natural languages Cucumber supports.
+
+For a full list of what languages Cucumber supports - run <pre>cucumber --help</pre>
+
+h2. Running all the examples
+
+Open a shell in this directory and run
+
+<pre>rake i18n</pre>
+
+h2. Running examples for a specific language
+
+Open a shell in the directory for the specific language and run
+
+<pre>rake features</pre>
View
16 vendor/plugins/cucumber/examples/i18n/Rakefile
@@ -0,0 +1,16 @@
+desc 'Run features for all languages'
+task :i18n do
+ dir = File.dirname(__FILE__)
+ Dir["#{dir}/*"].each do |f|
+ if File.directory?(f)
+ lang = f[dir.length+1..-1]
+ Dir.chdir(f) do
+ rake("features")
+ end
+ end
+ end
+end
+
+def rake(args)
+ ruby(File.join(Gem.bindir, 'rake'), args)
+end
View
6 vendor/plugins/cucumber/examples/i18n/ar/Rakefile
@@ -0,0 +1,6 @@
+$:.unshift(File.dirname(__FILE__) + '/../../../lib')
+require 'cucumber/rake/task'
+
+Cucumber::Rake::Task.new do |t|
+ t.cucumber_opts = "--language ar"
+end
View
17 vendor/plugins/cucumber/examples/i18n/ar/features/addition.feature
@@ -0,0 +1,17 @@
+خاصية: الجمع
+ من اجل تجنب الأخطاء السخيفة
+ كشخص غبي في الرياضيات
+ اريد معرفة ناتج جمع عددين
+
+ سيناريو: جمع عددين
+ بفرض كتابة ٥٠ في الآلة الحاسبة
+ و كتابة ٧٠ في الآلة الحاسبة
+ متى يتم الضغط على جمع
+ اذاً يظهر ١٢ على الشاشة
+ و الناتج يجب ان يكون Fixnum
+
+ امثلة اكثر:
+ | input_1 | input_2 | button | output | class |
+ | 20 | 30 | جمع | 50 | Fixnum |
+ | 2 | 5 | جمع | 7 | Fixnum |
+ | 0 | 40 | جمع | 40 | Fixnum |
View
32 vendor/plugins/cucumber/examples/i18n/ar/features/step_definitons/calculator_steps.rb
@@ -0,0 +1,32 @@
+$KCODE='u'
+require 'spec'
+$:.unshift(File.dirname(__FILE__) + '/../../lib')
+require 'calculator'
+
+Before do
+ @calc = Calculator.new
+end
+
+After do
+end
+
+Given "كتابة $n في الآلة الحاسبة" do |n|
+ @calc.push n.to_i
+end
+
+When /يتم الضغط على (\w+)/ do |op|
+ @result = @calc.send op
+end
+
+Then /يظهر (.*) على الشاشة/ do |result|
+ @result.should == result.to_f
+end
+
+Then /يجب ان يكون (\w*)/ do |class_name|
+ @result.class.name.should == class_name
+end
+
+Given /it should rain on (\w+)/ do |day|
+ @calc.rain?(day).should == true
+end
+
View
10 vendor/plugins/cucumber/examples/i18n/ar/lib/calculator.rb
@@ -0,0 +1,10 @@
+class Calculator
+ def push(n)
+ @args ||= []
+ @args << n
+ end
+
+ def جمع
+ @args.inject(0){|n,sum| sum+=n}
+ end
+end
View
6 vendor/plugins/cucumber/examples/i18n/da/Rakefile
@@ -0,0 +1,6 @@
+$:.unshift(File.dirname(__FILE__) + '/../../../lib')
+require 'cucumber/rake/task'
+
+Cucumber::Rake::Task.new do |t|
+ t.cucumber_opts = "--language da"
+end
View
22 vendor/plugins/cucumber/examples/i18n/da/features/step_definitons/kalkulator_steps.rb
@@ -0,0 +1,22 @@
+require 'spec'
+$:.unshift(File.dirname(__FILE__) + '/../../lib')
+require 'kalkulator'
+
+Before do
+ @calc = Kalkulator.new
+end
+
+After do
+end
+
+Given /at jeg har indtastet (\d+)/ do |n|
+ @calc.push n.to_i
+end
+
+When 'jeg summerer' do
+ @result = @calc.add
+end
+
+Then /skal resultatet være (\d*)/ do |result|
+ @result.should == result.to_i
+end
View
17 vendor/plugins/cucumber/examples/i18n/da/features/summering.feature
@@ -0,0 +1,17 @@
+Egenskab: Summering
+ For at slippe for at lave dumme fejl
+ Som en regnskabsfører
+ Vil jeg kunne lægge sammen
+
+ Scenarie: to tal
+ Givet at jeg har indtastet 5
+ Og at jeg har indtastet 7
+ Når jeg summerer
+ skal resultatet være 12
+
+ Scenarie: tre tal
+ Givet at jeg har indtastet 5
+ Og at jeg har indtastet 7
+ Og at jeg har indtastet 1
+ Når jeg summerer
+ skal resultatet være 13
View
11 vendor/plugins/cucumber/examples/i18n/da/lib/kalkulator.rb
@@ -0,0 +1,11 @@
+class Kalkulator
+ def push(n)
+ @args ||= []
+ @args << n
+ end
+
+ def add
+ #@args[0] + @args[1]
+ @args.inject(0){|n,sum| sum+=n}
+ end
+end
View
1  vendor/plugins/cucumber/examples/i18n/de/.gitignore
@@ -0,0 +1 @@
+features.html
View
6 vendor/plugins/cucumber/examples/i18n/de/Rakefile
@@ -0,0 +1,6 @@
+$:.unshift(File.dirname(__FILE__) + '/../../../lib')
+require 'cucumber/rake/task'
+
+Cucumber::Rake::Task.new do |t|
+ t.cucumber_opts = "--language de"
+end
View
17 vendor/plugins/cucumber/examples/i18n/de/features/addition.feature
@@ -0,0 +1,17 @@
+Funktionalität: Addition
+ Um dumme Fehler zu vermeiden
+ möchte ich als Matheidiot
+ die Summe zweier Zahlen gesagt bekommen
+
+ Szenario: Zwei Zahlen hinzufügen
+ Gegeben sei ich habe 50 in den Taschenrechner eingegeben
+ Und ich habe 70 in den Taschenrechner eingegeben
+ Wenn ich add drücke
+ Dann sollte das Ergebniss auf dem Bildschirm 120 sein
+ Und die Ergebnissklasse sollte eine Fixnum sein
+
+ Mehr Beispiele:
+ | Eingabe_1 | Eingabe_2 | Knopf | Ausgabe | Klasse |
+ | 20 | 30 | add | 50 | Fixnum |
+ | 2 | 5 | add | 7 | Fixnum |
+ | 0 | 40 | add | 40 | Fixnum |
View
10 vendor/plugins/cucumber/examples/i18n/de/features/division.feature
@@ -0,0 +1,10 @@
+Funktionalität: Division
+ Um dumme Fehler zu vermeiden
+ müssen Kassierer in der Lage sein einen Bruchteil zu berechnen
+
+ Szenario: Normale Zahlen
+ Gegeben sei ich habe 3 in den Taschenrechner eingegeben
+ Und ich habe 2 in den Taschenrechner eingegeben
+ Wenn ich divide drücke
+ Dann sollte das Ergebniss auf dem Bildschirm 1.5 sein
+ Und die Ergebnissklasse sollte eine Float sein
View
30 vendor/plugins/cucumber/examples/i18n/de/features/step_definitons/calculator_steps.rb
@@ -0,0 +1,30 @@
+require 'spec'
+$:.unshift(File.dirname(__FILE__) + '/../../lib')
+require 'calculator'
+
+Before do
+ @calc = Calculator.new
+end
+
+After do
+end
+
+Given "ich habe $n in den Taschenrechner eingegeben" do |n|
+ @calc.push n.to_i
+end
+
+When /ich (\w+) drücke/ do |op|
+ @result = @calc.send op
+end
+
+Then /sollte das Ergebniss auf dem Bildschirm (.*) sein/ do |result|
+ @result.should == result.to_f
+end
+
+Then /die Ergebnissklasse sollte eine (\w*) sein/ do |class_name|
+ @result.class.name.should == class_name
+end
+
+Given /it should rain on (\w+)/ do |day|
+ @calc.rain?(day).should == true
+end
View
14 vendor/plugins/cucumber/examples/i18n/de/lib/calculator.rb
@@ -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
View
1  vendor/plugins/cucumber/examples/i18n/en/.gitignore
@@ -0,0 +1 @@
+features.html
View
6 vendor/plugins/cucumber/examples/i18n/en/Rakefile
@@ -0,0 +1,6 @@
+$:.unshift(File.dirname(__FILE__) + '/../../../lib')
+require 'cucumber/rake/task'
+
+Cucumber::Rake::Task.new do |t|
+ t.cucumber_opts = "--language en"
+end
View
17 vendor/plugins/cucumber/examples/i18n/en/features/addition.feature
@@ -0,0 +1,17 @@
+Feature: Addition
+ In order to avoid silly mistakes
+ As a math idiot
+ I want to be told the sum of two numbers
+
+ Scenario: Add two numbers
+ Given I have entered 50 into the calculator
+ And I have entered 70 into the calculator
+ When I press add
+ Then the result should be 120 on the screen
+ And the result class should be Fixnum
+
+ More Examples:
+ | input_1 | input_2 | button | output | class |
+ | 20 | 30 | add | 50 | Fixnum |
+ | 2 | 5 | add | 7 | Fixnum |
+ | 0 | 40 | add | 40 | Fixnum |
View
10 vendor/plugins/cucumber/examples/i18n/en/features/division.feature
@@ -0,0 +1,10 @@
+Feature: Division
+ In order to avoid silly mistakes
+ Cashiers must be able to calculate a fraction
+
+ Scenario: Regular numbers
+ Given I have entered 3 into the calculator
+ And I have entered 2 into the calculator
+ When I press divide
+ Then the result should be 1.5 on the screen
+ And the result class should be Float
View
31 vendor/plugins/cucumber/examples/i18n/en/features/step_definitons/calculator_steps.rb
@@ -0,0 +1,31 @@
+require 'spec'
+$:.unshift(File.dirname(__FILE__) + '/../../lib')
+require 'calculator'
+
+Before do
+ @calc = Calculator.new
+end
+
+After do
+end
+
+Given "I have entered $n into the calculator" do |n|
+ @calc.push n.to_i
+end
+
+When /I press (\w+)/ do |op|
+ @result = @calc.send op
+end
+