cucumber-2.0.0/0000755000004100000410000000000012515125412013344 5ustar www-datawww-datacucumber-2.0.0/Rakefile0000644000004100000410000000101612515125412015007 0ustar www-datawww-data# encoding: utf-8 require 'rubygems' require 'bundler' Bundler::GemHelper.install_tasks $:.unshift(File.dirname(__FILE__) + '/lib') Dir['gem_tasks/**/*.rake'].each { |rake| load rake } task :default => [:spec, :cucumber] if ENV['TRAVIS'] ENV['SIMPLECOV'] = 'ci' ENV['JRUBY_OPTS'] = [ENV['JRUBY_OPTS'], '--debug'].compact.join(' ') require 'coveralls/rake/task' Coveralls::RakeTask.new task :default => [:spec, :cucumber, 'coveralls:push'] end require 'rake/clean' CLEAN.include %w(**/*.{log,pyc,rbc,tgz} doc) cucumber-2.0.0/bin/0000755000004100000410000000000012515125412014114 5ustar www-datawww-datacucumber-2.0.0/bin/cucumber0000755000004100000410000000061512515125412015651 0ustar www-datawww-data#!/usr/bin/env ruby $:.unshift(File.dirname(__FILE__) + '/../lib') unless $:.include?(File.dirname(__FILE__) + '/../lib') load File.expand_path(File.dirname(__FILE__) + '/../spec/simplecov_setup.rb') require 'cucumber/rspec/disable_option_parser' require 'cucumber/cli/main' # The dup is to keep ARGV intact, so that tools like ruby-debug can respawn. Cucumber::Cli::Main.new(ARGV.dup).execute! cucumber-2.0.0/Gemfile0000644000004100000410000000062012515125412014635 0ustar www-datawww-datagem "cucumber-pro", "0.0.13", :group => :test source "https://rubygems.org" gemspec unless ENV['CUCUMBER_USE_RELEASED_CORE'] core_path = File.expand_path("../../cucumber-ruby-core", __FILE__) if File.exist?(core_path) && !ENV['CUCUMBER_USE_GIT_CORE'] gem 'cucumber-core', :path => core_path else gem 'cucumber-core', :git => "git://github.com/cucumber/cucumber-ruby-core.git" end end cucumber-2.0.0/examples/0000755000004100000410000000000012515125412015162 5ustar www-datawww-datacucumber-2.0.0/examples/tcl/0000755000004100000410000000000012515125412015744 5ustar www-datawww-datacucumber-2.0.0/examples/tcl/Rakefile0000644000004100000410000000023312515125412017407 0ustar www-datawww-data$:.unshift(File.dirname(__FILE__) + '/../../lib') require 'cucumber/rake/task' Cucumber::Rake::Task.new do |t| t.cucumber_opts = %w{--format pretty} endcucumber-2.0.0/examples/tcl/features/0000755000004100000410000000000012515125412017562 5ustar www-datawww-datacucumber-2.0.0/examples/tcl/features/step_definitions/0000755000004100000410000000000012515125412023130 5ustar www-datawww-datacucumber-2.0.0/examples/tcl/features/step_definitions/fib_steps.rb0000644000004100000410000000031012515125412025425 0ustar www-datawww-dataWhen /^I ask Tcl to calculate fibonacci for (\d+)$/ do |n| @fib_result = @fib.eval("fib #{n}").to_i end Then /^it should give me (\d+)$/ do |expected| expect(@fib_result).to eq expected.to_i end cucumber-2.0.0/examples/tcl/features/fibonnacci.feature0000644000004100000410000000061612515125412023235 0ustar www-datawww-dataFeature: Fibonacci In order to calculate super fast fibonacci series As a Tcl hacker I want to use Tcl for that Scenario Outline: Series When I ask Tcl to calculate fibonacci for Then it should give me Examples: | n | result | | 1 | 1 | | 2 | 1 | | 3 | 2 | | 4 | 3 | | 5 | 5 | | 6 | 8 | cucumber-2.0.0/examples/tcl/features/support/0000755000004100000410000000000012515125412021276 5ustar www-datawww-datacucumber-2.0.0/examples/tcl/features/support/env.rb0000644000004100000410000000020312515125412022406 0ustar www-datawww-datarequire 'rubygems' require 'tcl' Before do @fib = Tcl::Interp.load_from_file(File.dirname(__FILE__) + '/../../src/fib.tcl') end cucumber-2.0.0/examples/tcl/src/0000755000004100000410000000000012515125412016533 5ustar www-datawww-datacucumber-2.0.0/examples/tcl/src/fib.tcl0000644000004100000410000000012712515125412017777 0ustar www-datawww-dataproc fib {n} { return [expr {$n<2 ? $n : [fib [expr $n-1]] + [fib [expr $n-2]]}] } cucumber-2.0.0/examples/tcl/README.textile0000644000004100000410000000021212515125412020274 0ustar www-datawww-datah1. Cucumber goes Tcl h2. Prerequisites Install the ruby-tcl bindings: [sudo] gem install tcl h2. Run the example: rake cucumber cucumber-2.0.0/examples/rspec_doubles/0000755000004100000410000000000012515125412020013 5ustar www-datawww-datacucumber-2.0.0/examples/rspec_doubles/Rakefile0000644000004100000410000000015012515125412021454 0ustar www-datawww-data$:.unshift(File.dirname(__FILE__) + '/../../lib') require 'cucumber/rake/task' Cucumber::Rake::Task.newcucumber-2.0.0/examples/rspec_doubles/features/0000755000004100000410000000000012515125412021631 5ustar www-datawww-datacucumber-2.0.0/examples/rspec_doubles/features/step_definitions/0000755000004100000410000000000012515125412025177 5ustar www-datawww-datacucumber-2.0.0/examples/rspec_doubles/features/step_definitions/calvin_steps.rb0000644000004100000410000000057112515125412030221 0ustar www-datawww-dataclass CardboardBox def initialize(transmogrifier) @transmogrifier = transmogrifier end def poke @transmogrifier.transmogrify end end Given /^I have a cardboard box$/ do transmogrifier = double('transmogrifier') transmogrifier.should_receive(:transmogrify) @box = CardboardBox.new(transmogrifier) end When /^I poke it all is good$/ do @box.poke end cucumber-2.0.0/examples/rspec_doubles/features/mocking.feature0000644000004100000410000000033312515125412024634 0ustar www-datawww-dataFeature: Mocking In order to test external stuff I want to mock Scenario: Mock a transmogrifier Given I have a cardboard box # Comment out the next line to see a failure When I poke it all is good cucumber-2.0.0/examples/rspec_doubles/features/support/0000755000004100000410000000000012515125412023345 5ustar www-datawww-datacucumber-2.0.0/examples/rspec_doubles/features/support/env.rb0000644000004100000410000000046612515125412024470 0ustar www-datawww-data# If you want to use a different mock framework than # RSpec-Mocks - just set configure that accordingly # # require 'rspec/core' # RSpec.configure do |c| # c.mock_framework = :rspec # c.mock_framework = :mocha # c.mock_framework = :rr # c.mock_framework = :flexmock # end require 'cucumber/rspec/doubles'cucumber-2.0.0/examples/test_unit/0000755000004100000410000000000012515125412017200 5ustar www-datawww-datacucumber-2.0.0/examples/test_unit/Rakefile0000644000004100000410000000023312515125412020643 0ustar www-datawww-data$:.unshift(File.dirname(__FILE__) + '/../../lib') require 'cucumber/rake/task' Cucumber::Rake::Task.new do |t| t.cucumber_opts = %w{--format pretty} endcucumber-2.0.0/examples/test_unit/Gemfile0000644000004100000410000000011512515125412020470 0ustar www-datawww-datasource 'https://rubygems.org' gem 'test-unit' gem 'cucumber', path: '../..' cucumber-2.0.0/examples/test_unit/features/0000755000004100000410000000000012515125412021016 5ustar www-datawww-datacucumber-2.0.0/examples/test_unit/features/step_definitions/0000755000004100000410000000000012515125412024364 5ustar www-datawww-datacucumber-2.0.0/examples/test_unit/features/step_definitions/test_unit_steps.rb0000644000004100000410000000105512515125412030146 0ustar www-datawww-dataGiven /^(\w+) = (\w+)$/ do |var, value| instance_variable_set("@#{var}", value) end begin require 'rubygems' require 'matchy' Then /^I can assert that (\w+) == (\w+)$/ do |var_a, var_b| a = instance_variable_get("@#{var_a}") b = instance_variable_get("@#{var_b}") a.should == b end rescue LoadError STDERR.puts "***** You should install matchy *****" Then /^I can assert that (\w+) == (\w+)$/ do |var_a, var_b| a = instance_variable_get("@#{var_a}") b = instance_variable_get("@#{var_b}") assert_equal(a, b) end end cucumber-2.0.0/examples/test_unit/features/test_unit.feature0000644000004100000410000000035512515125412024414 0ustar www-datawww-dataFeature: Test::Unit In order to please people who like Test::Unit As a Cucumber user I want to be able to use assert* in my step definitions Scenario: assert_equal Given x = 5 And y = 5 Then I can assert that x == y cucumber-2.0.0/examples/i18n/0000755000004100000410000000000012515125412015741 5ustar www-datawww-datacucumber-2.0.0/examples/i18n/zh-CN/0000755000004100000410000000000012515125412016660 5ustar www-datawww-datacucumber-2.0.0/examples/i18n/zh-CN/Rakefile0000644000004100000410000000015312515125412020324 0ustar www-datawww-data$:.unshift(File.dirname(__FILE__) + '/../../../lib') require 'cucumber/rake/task' Cucumber::Rake::Task.newcucumber-2.0.0/examples/i18n/zh-CN/features/0000755000004100000410000000000012515125412020476 5ustar www-datawww-datacucumber-2.0.0/examples/i18n/zh-CN/features/step_definitions/0000755000004100000410000000000012515125412024044 5ustar www-datawww-datacucumber-2.0.0/examples/i18n/zh-CN/features/step_definitions/calculator_steps.rb0000644000004100000410000000101012515125412027730 0ustar www-datawww-data# encoding: utf-8 begin require 'rspec/expectations'; rescue LoadError; require 'spec/expectations'; end require 'cucumber/formatter/unicode' $:.unshift(File.dirname(__FILE__) + '/../../lib') require 'calculator' Before do @calc = Calculator.new end After do end Given /在计算器上输入(\d+)/ do |n| @calc.push n.to_i end When /按(.*)键/ do |op| if op == '加号' @result = @calc.send "add" end end Then /屏幕上显示的结果应该是是(.*)/ do |result| @result.should == result.to_f end cucumber-2.0.0/examples/i18n/zh-CN/features/addition.feature0000644000004100000410000000106412515125412023647 0ustar www-datawww-data# language: zh-CN 功能:加法 为了避免一些愚蠢的错误 作为一个数学白痴 我希望有人告诉我数字相加的结果 场景: 两个数相加 假如我已经在计算器里输入6 而且我已经在计算器里输入7 当我按相加按钮 那么我应该在屏幕上看到的结果是13 场景: 三个数相加 假如我已经在计算器里输入6 而且我已经在计算器里输入7 而且我已经在计算器里输入1 当我按相加按钮 那么我应该在屏幕上看到的结果是14 cucumber-2.0.0/examples/i18n/zh-CN/lib/0000755000004100000410000000000012515125412017426 5ustar www-datawww-datacucumber-2.0.0/examples/i18n/zh-CN/lib/calculator.rb0000644000004100000410000000020012515125412022074 0ustar www-datawww-dataclass Calculator def push(n) @args ||= [] @args << n end def add @args.inject(0){|n,sum| sum+=n} end end cucumber-2.0.0/examples/i18n/Rakefile0000644000004100000410000000111112515125412017400 0ustar www-datawww-datadesc 'Run features for all languages' task :cucumber do dir = File.dirname(__FILE__) Dir["#{dir}/*"].each do |f| if File.directory?(f) lang = f[dir.length+1..-1] if examples_working?(lang) Dir.chdir(f) do puts "DIR: #{f}" rake("cucumber") end else STDERR.puts %{ !!!!! !!!!! !!!!! SKIPPING #{lang} (The examples are out of date - please help update them) !!!!! !!!!! } end end end end task :default => :cucumber def examples_working?(lang) !%w{}.index(lang) end def rake(args) ruby($0, args) end cucumber-2.0.0/examples/i18n/tr/0000755000004100000410000000000012515125412016366 5ustar www-datawww-datacucumber-2.0.0/examples/i18n/tr/Rakefile0000644000004100000410000000023612515125412020034 0ustar www-datawww-data$:.unshift(File.dirname(__FILE__) + '/../../../lib') require 'cucumber/rake/task' Cucumber::Rake::Task.new do |t| t.cucumber_opts = %w{--format pretty} endcucumber-2.0.0/examples/i18n/tr/features/0000755000004100000410000000000012515125412020204 5ustar www-datawww-datacucumber-2.0.0/examples/i18n/tr/features/step_definitions/0000755000004100000410000000000012515125412023552 5ustar www-datawww-datacucumber-2.0.0/examples/i18n/tr/features/step_definitions/hesap_makinesi_adimlari.rb0000644000004100000410000000077412515125412030731 0ustar www-datawww-data# encoding: utf-8 begin require 'rspec/expectations'; rescue LoadError; require 'spec/expectations'; end require 'cucumber/formatter/unicode' $:.unshift(File.dirname(__FILE__) + '/../../lib') require 'hesap_makinesi' Before do @calc = HesapMakinesi.new end After do end Diyelimki /hesap makinesine (\d+) girdim/ do |n| @calc.push n.to_i end Eğerki /(.*) tuşuna basarsam/ do |op| @result = @calc.send op end Ozaman /ekrandaki sonuç (.*) olmalı/ do |result| @result.should == result.to_f end cucumber-2.0.0/examples/i18n/tr/features/bolme.feature0000644000004100000410000000043712515125412022663 0ustar www-datawww-data# language: tr Özellik: Bölme Gülünç hatalardan sakınmak için Bir kasiyer sayıları bölebilmeli Senaryo: Doğal sayılar Diyelim ki hesap makinesine 3 girdim Ve hesap makinesine 2 girdim Eğer ki böl tuşuna basarsam O zaman ekrandaki sonuç 1.5 olmalı cucumber-2.0.0/examples/i18n/tr/features/toplama.feature0000644000004100000410000000113312515125412023214 0ustar www-datawww-data# language: tr Özellik: Toplama Gülünç hatalardan sakınmak için Matematikten anlamayan bir ahmak olarak Hesap makinasının bana iki sayının toplamını bulmasını istiyorum Senaryo taslağı: İki sayıyı topla Diyelim ki hesap makinesine girdim Ve hesap makinesine girdim Eğer ki tuşuna basarsam O zaman ekrandaki sonuç <çıktı> olmalı Örnekler: | girdi_1 | girdi_2 | düğme | çıktı | | 20 | 30 | topla | 50 | | 2 | 5 | topla | 7 | | 0 | 40 | topla | 40 | cucumber-2.0.0/examples/i18n/tr/lib/0000755000004100000410000000000012515125412017134 5ustar www-datawww-datacucumber-2.0.0/examples/i18n/tr/lib/hesap_makinesi.rb0000644000004100000410000000031212515125412022435 0ustar www-datawww-data# encoding: utf-8 class HesapMakinesi def push(n) @args ||= [] @args << n end def topla @args.inject(0){|n,sum| sum+=n} end def böl @args[0].to_f / @args[1].to_f end endcucumber-2.0.0/examples/i18n/cs/0000755000004100000410000000000012515125412016346 5ustar www-datawww-datacucumber-2.0.0/examples/i18n/cs/Rakefile0000644000004100000410000000023612515125412020014 0ustar www-datawww-data$:.unshift(File.dirname(__FILE__) + '/../../../lib') require 'cucumber/rake/task' Cucumber::Rake::Task.new do |t| t.cucumber_opts = %w{--format pretty} endcucumber-2.0.0/examples/i18n/cs/features/0000755000004100000410000000000012515125412020164 5ustar www-datawww-datacucumber-2.0.0/examples/i18n/cs/features/step_definitions/0000755000004100000410000000000012515125412023532 5ustar www-datawww-datacucumber-2.0.0/examples/i18n/cs/features/step_definitions/calculator_steps.rb0000644000004100000410000000075012515125412027430 0ustar www-datawww-data# encoding: utf-8 begin require 'rspec/expectations'; rescue LoadError; require 'spec/expectations'; end require 'cucumber/formatter/unicode' $:.unshift(File.dirname(__FILE__) + '/../../lib') require 'calculator' Before do @calc = Calculator.new end After do end Given /Zadám číslo (\d+) do kalkulačky/ do |n| @calc.push n.to_i end When /Stisknu (\w+)/ do |op| @result = @calc.send op end Then /Výsledek by měl být (.*)/ do |result| @result.should == result.to_f end cucumber-2.0.0/examples/i18n/cs/features/addition.feature0000644000004100000410000000105612515125412023336 0ustar www-datawww-data# language: cs Požadavek: Sčítání Jako matematický idiot Abych se vyhnul hloupým chybám Chci vědět jak sečíst dvě čísla Náčrt Scénáře: Sčítaní dvou čísel Pokud Zadám číslo do kalkulačky A Zadám číslo do kalkulačky Když Stisknu Pak Výsledek by měl být Příklady: | vstup_1 | vstup_2 | tlačítko | výstup | | 20 | 30 | add | 50 | | 2 | 5 | add | 7 | | 0 | 40 | add | 40 | cucumber-2.0.0/examples/i18n/cs/features/division.feature0000644000004100000410000000047012515125412023366 0ustar www-datawww-data# language: cs Požadavek: Dělení Jako matematický idiot Abych se vyhnul hloupým chybám Chci vědět jak vydělit dvě čísla Scénář: Přirozená čísla Pokud Zadám číslo 3 do kalkulačky A Zadám číslo 2 do kalkulačky Když stisknu divide Pak výsledek by měl být 1.5 cucumber-2.0.0/examples/i18n/cs/lib/0000755000004100000410000000000012515125412017114 5ustar www-datawww-datacucumber-2.0.0/examples/i18n/cs/lib/calculator.rb0000644000004100000410000000026512515125412021575 0ustar www-datawww-dataclass 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 endcucumber-2.0.0/examples/i18n/pt/0000755000004100000410000000000012515125412016364 5ustar www-datawww-datacucumber-2.0.0/examples/i18n/pt/Rakefile0000644000004100000410000000023612515125412020032 0ustar www-datawww-data$:.unshift(File.dirname(__FILE__) + '/../../../lib') require 'cucumber/rake/task' Cucumber::Rake::Task.new do |t| t.cucumber_opts = %w{--format pretty} endcucumber-2.0.0/examples/i18n/pt/features/0000755000004100000410000000000012515125412020202 5ustar www-datawww-datacucumber-2.0.0/examples/i18n/pt/features/step_definitions/0000755000004100000410000000000012515125412023550 5ustar www-datawww-datacucumber-2.0.0/examples/i18n/pt/features/step_definitions/calculadora_steps.rb0000644000004100000410000000047312515125412027571 0ustar www-datawww-data# encoding: utf-8 Before do @calc = Calculadora.new end After do end Dado /que eu digitei (\d+) na calculadora/ do |n| @calc.push n.to_i end Quando 'eu aperto o botão de soma' do @result = @calc.soma end Então /o resultado na calculadora deve ser (\d*)/ do |result| @result.should == result.to_i end cucumber-2.0.0/examples/i18n/pt/features/adicao.feature0000644000004100000410000000053112515125412022776 0ustar www-datawww-data# language: pt Funcionalidade: Adição Para evitar erros bobos Como um péssimo matemático Eu quero saber como somar dois números Cenário: Adicionar dois números Dado que eu digitei 50 na calculadora E que eu digitei 70 na calculadora Quando eu aperto o botão de soma Então o resultado na calculadora deve ser 120cucumber-2.0.0/examples/i18n/pt/features/support/0000755000004100000410000000000012515125412021716 5ustar www-datawww-datacucumber-2.0.0/examples/i18n/pt/features/support/env.rb0000644000004100000410000000032712515125412023035 0ustar www-datawww-data# encoding: utf-8 begin require 'rspec/expectations'; rescue LoadError; require 'spec/expectations'; end require 'cucumber/formatter/unicode' $:.unshift(File.dirname(__FILE__) + '/../../lib') require 'calculadora' cucumber-2.0.0/examples/i18n/pt/lib/0000755000004100000410000000000012515125412017132 5ustar www-datawww-datacucumber-2.0.0/examples/i18n/pt/lib/calculadora.rb0000644000004100000410000000020212515125412021723 0ustar www-datawww-dataclass Calculadora def push(n) @args ||= [] @args << n end def soma @args.inject(0) {|n,sum| sum+n} end end cucumber-2.0.0/examples/i18n/lt/0000755000004100000410000000000012515125412016360 5ustar www-datawww-datacucumber-2.0.0/examples/i18n/lt/Rakefile0000644000004100000410000000023712515125412020027 0ustar www-datawww-data$:.unshift(File.dirname(__FILE__) + '/../../../lib') require 'cucumber/rake/task' Cucumber::Rake::Task.new do |t| t.cucumber_opts = %w{--format pretty} end cucumber-2.0.0/examples/i18n/lt/features/0000755000004100000410000000000012515125412020176 5ustar www-datawww-datacucumber-2.0.0/examples/i18n/lt/features/step_definitions/0000755000004100000410000000000012515125412023544 5ustar www-datawww-datacucumber-2.0.0/examples/i18n/lt/features/step_definitions/calculator_steps.rb0000644000004100000410000000077312515125412027447 0ustar www-datawww-data# encoding: utf-8 begin require 'rspec/expectations'; rescue LoadError; require 'spec/expectations'; end require 'cucumber/formatter/unicode' $:.unshift(File.dirname(__FILE__) + '/../../lib') require 'calculator' Before do @calc = Calculator.new end After do end Given /aš įvedžiau (\d+) į skaičiuotuvą/ do |n| @calc.push n.to_i end When /aš paspaudžiu "(\w+)"/ do |op| @result = @calc.send op end Then /rezultatas ekrane turi būti (.*)/ do |result| @result.should == result.to_f end cucumber-2.0.0/examples/i18n/lt/features/addition.feature0000644000004100000410000000116212515125412023346 0ustar www-datawww-data# language: lt Savybė: Sudėtis Norint išvengti kvailų klaidų Kaip matematinis idiotas Aš noriu, kad man pasakytų dviejų skaičių sumą Scenarijaus šablonas: dviejų skaičių sudėtis Duota aš įvedžiau <įvestis_1> į skaičiuotuvą Ir aš įvedžiau <įvestis_2> į skaičiuotuvą Kai aš paspaudžiu "" Tada rezultatas ekrane turi būti Pavyzdžiai: | įvestis_1 | įvestis_2 | mygtukas | išvestis | | 20 | 30 | add | 50 | | 2 | 5 | add | 7 | | 0 | 40 | add | 40 | cucumber-2.0.0/examples/i18n/lt/features/division.feature0000644000004100000410000000046112515125412023400 0ustar www-datawww-data# language: lt Savybė: Dalyba Norint išvengti klaidų Kasininkai privalo mokėti skaičiuoti trupmenas Scenarijus: Realieji skaičiai Duota aš įvedžiau 3 į skaičiuotuvą Ir aš įvedžiau 2 į skaičiuotuvą Kai aš paspaudžiu "divide" Tada rezultatas ekrane turi būti 1.5 cucumber-2.0.0/examples/i18n/lt/lib/0000755000004100000410000000000012515125412017126 5ustar www-datawww-datacucumber-2.0.0/examples/i18n/lt/lib/calculator.rb0000644000004100000410000000026612515125412021610 0ustar www-datawww-dataclass 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 cucumber-2.0.0/examples/i18n/de/0000755000004100000410000000000012515125412016331 5ustar www-datawww-datacucumber-2.0.0/examples/i18n/de/Rakefile0000644000004100000410000000023612515125412017777 0ustar www-datawww-data$:.unshift(File.dirname(__FILE__) + '/../../../lib') require 'cucumber/rake/task' Cucumber::Rake::Task.new do |t| t.cucumber_opts = %w{--format pretty} endcucumber-2.0.0/examples/i18n/de/features/0000755000004100000410000000000012515125412020147 5ustar www-datawww-datacucumber-2.0.0/examples/i18n/de/features/step_definitions/0000755000004100000410000000000012515125412023515 5ustar www-datawww-datacucumber-2.0.0/examples/i18n/de/features/step_definitions/calculator_steps.rb0000644000004100000410000000102312515125412027405 0ustar www-datawww-data# encoding: utf-8 begin require 'rspec/expectations'; rescue LoadError; require 'spec/expectations'; end require 'cucumber/formatter/unicode' $:.unshift(File.dirname(__FILE__) + '/../../lib') require 'calculator' Before do @calc = Calculator.new end After do end Angenommen /ich habe (\d+) in den Taschenrechner eingegeben/ do |n| @calc.push n.to_i end Wenn /ich (\w+) drücke/ do |op| @result = @calc.send op end Dann /sollte das Ergebniss auf dem Bildschirm (.*) sein/ do |result| @result.should == result.to_f end cucumber-2.0.0/examples/i18n/de/features/addition.feature0000644000004100000410000000115312515125412023317 0ustar www-datawww-data# language: de Funktionalität: Addition Um dumme Fehler zu vermeiden möchte ich als Matheidiot die Summe zweier Zahlen gesagt bekommen Szenariogrundriss: Zwei Zahlen hinzufügen Angenommen ich habe in den Taschenrechner eingegeben Und ich habe in den Taschenrechner eingegeben Wenn ich drücke Dann sollte das Ergebniss auf dem Bildschirm sein Beispiele: | Eingabe_1 | Eingabe_2 | Knopf | Ausgabe | | 20 | 30 | add | 50 | | 2 | 5 | add | 7 | | 0 | 40 | add | 40 | cucumber-2.0.0/examples/i18n/de/features/division.feature0000644000004100000410000000055412515125412023354 0ustar www-datawww-data# language: de 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 cucumber-2.0.0/examples/i18n/de/lib/0000755000004100000410000000000012515125412017077 5ustar www-datawww-datacucumber-2.0.0/examples/i18n/de/lib/calculator.rb0000644000004100000410000000026512515125412021560 0ustar www-datawww-dataclass 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 endcucumber-2.0.0/examples/i18n/ar/0000755000004100000410000000000012515125412016343 5ustar www-datawww-datacucumber-2.0.0/examples/i18n/ar/Rakefile0000644000004100000410000000023612515125412020011 0ustar www-datawww-data$:.unshift(File.dirname(__FILE__) + '/../../../lib') require 'cucumber/rake/task' Cucumber::Rake::Task.new do |t| t.cucumber_opts = %w{--format pretty} endcucumber-2.0.0/examples/i18n/ar/features/0000755000004100000410000000000012515125412020161 5ustar www-datawww-datacucumber-2.0.0/examples/i18n/ar/features/step_definitions/0000755000004100000410000000000012515125412023527 5ustar www-datawww-datacucumber-2.0.0/examples/i18n/ar/features/step_definitions/calculator_steps.rb0000644000004100000410000000100612515125412027420 0ustar www-datawww-data# encoding: utf-8 begin require 'rspec/expectations'; rescue LoadError; require 'spec/expectations'; end require 'cucumber/formatter/unicode' $:.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 /يتم الضغط على (.+)/ do |op| @result = @calc.send op end Then /يظهر (.*) على الشاشة/ do |result| @result.should == result.to_f end cucumber-2.0.0/examples/i18n/ar/features/addition.feature0000644000004100000410000000120712515125412023331 0ustar www-datawww-data# language: ar خاصية: الجمع من اجل تجنب الأخطاء السخيفة كشخص غبي في الرياضيات اريد معرفة ناتج جمع عددين سيناريو مخطط: جمع عددين بفرض كتابة في الآلة الحاسبة و كتابة في الآلة الحاسبة متى يتم الضغط على