cucumber-2.4.0/0000755000004100000410000000000012736055451013362 5ustar www-datawww-datacucumber-2.4.0/Rakefile0000644000004100000410000000101612736055451015025 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.4.0/bin/0000755000004100000410000000000012736055451014132 5ustar www-datawww-datacucumber-2.4.0/bin/cucumber0000755000004100000410000000053012736055451015663 0ustar www-datawww-data#!/usr/bin/env ruby $:.unshift(File.dirname(__FILE__) + '/../lib') unless $:.include?(File.dirname(__FILE__) + '/../lib') require 'simplecov_setup' 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.4.0/Gemfile0000644000004100000410000000107112736055451014654 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__) wire_path = File.expand_path("../../cucumber-ruby-wire", __FILE__) if File.exist?(core_path) && !ENV['CUCUMBER_USE_GIT_CORE'] gem 'cucumber-core', :path => core_path gem 'cucumber-wire', :path => wire_path else gem 'cucumber-core', :git => "https://github.com/cucumber/cucumber-ruby-core.git", :branch => 'v1.x-bugfix' end end gem 'mime-types', '~>2.99' cucumber-2.4.0/examples/0000755000004100000410000000000012736055451015200 5ustar www-datawww-datacucumber-2.4.0/examples/tcl/0000755000004100000410000000000012736055451015762 5ustar www-datawww-datacucumber-2.4.0/examples/tcl/Rakefile0000644000004100000410000000023312736055451017425 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.4.0/examples/tcl/features/0000755000004100000410000000000012736055451017600 5ustar www-datawww-datacucumber-2.4.0/examples/tcl/features/step_definitions/0000755000004100000410000000000012736055451023146 5ustar www-datawww-datacucumber-2.4.0/examples/tcl/features/step_definitions/fib_steps.rb0000644000004100000410000000031012736055451025443 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.4.0/examples/tcl/features/fibonnacci.feature0000644000004100000410000000061612736055451023253 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.4.0/examples/tcl/features/support/0000755000004100000410000000000012736055451021314 5ustar www-datawww-datacucumber-2.4.0/examples/tcl/features/support/env.rb0000644000004100000410000000020312736055451022424 0ustar www-datawww-datarequire 'rubygems' require 'tcl' Before do @fib = Tcl::Interp.load_from_file(File.dirname(__FILE__) + '/../../src/fib.tcl') end cucumber-2.4.0/examples/tcl/src/0000755000004100000410000000000012736055451016551 5ustar www-datawww-datacucumber-2.4.0/examples/tcl/src/fib.tcl0000644000004100000410000000012712736055451020015 0ustar www-datawww-dataproc fib {n} { return [expr {$n<2 ? $n : [fib [expr $n-1]] + [fib [expr $n-2]]}] } cucumber-2.4.0/examples/tcl/README.textile0000644000004100000410000000021212736055451020312 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.4.0/examples/rspec_doubles/0000755000004100000410000000000012736055451020031 5ustar www-datawww-datacucumber-2.4.0/examples/rspec_doubles/Rakefile0000644000004100000410000000015012736055451021472 0ustar www-datawww-data$:.unshift(File.dirname(__FILE__) + '/../../lib') require 'cucumber/rake/task' Cucumber::Rake::Task.newcucumber-2.4.0/examples/rspec_doubles/features/0000755000004100000410000000000012736055451021647 5ustar www-datawww-datacucumber-2.4.0/examples/rspec_doubles/features/step_definitions/0000755000004100000410000000000012736055451025215 5ustar www-datawww-datacucumber-2.4.0/examples/rspec_doubles/features/step_definitions/calvin_steps.rb0000644000004100000410000000057112736055451030237 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.4.0/examples/rspec_doubles/features/mocking.feature0000644000004100000410000000033312736055451024652 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.4.0/examples/rspec_doubles/features/support/0000755000004100000410000000000012736055451023363 5ustar www-datawww-datacucumber-2.4.0/examples/rspec_doubles/features/support/env.rb0000644000004100000410000000046612736055451024506 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.4.0/examples/test_unit/0000755000004100000410000000000012736055451017216 5ustar www-datawww-datacucumber-2.4.0/examples/test_unit/Rakefile0000644000004100000410000000023312736055451020661 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.4.0/examples/test_unit/Gemfile0000644000004100000410000000011512736055451020506 0ustar www-datawww-datasource 'https://rubygems.org' gem 'test-unit' gem 'cucumber', path: '../..' cucumber-2.4.0/examples/test_unit/features/0000755000004100000410000000000012736055451021034 5ustar www-datawww-datacucumber-2.4.0/examples/test_unit/features/step_definitions/0000755000004100000410000000000012736055451024402 5ustar www-datawww-datacucumber-2.4.0/examples/test_unit/features/step_definitions/test_unit_steps.rb0000644000004100000410000000105512736055451030164 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.4.0/examples/test_unit/features/test_unit.feature0000644000004100000410000000035512736055451024432 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.4.0/examples/i18n/0000755000004100000410000000000012736055451015757 5ustar www-datawww-datacucumber-2.4.0/examples/i18n/zh-CN/0000755000004100000410000000000012736055451016676 5ustar www-datawww-datacucumber-2.4.0/examples/i18n/zh-CN/Rakefile0000644000004100000410000000015312736055451020342 0ustar www-datawww-data$:.unshift(File.dirname(__FILE__) + '/../../../lib') require 'cucumber/rake/task' Cucumber::Rake::Task.newcucumber-2.4.0/examples/i18n/zh-CN/features/0000755000004100000410000000000012736055451020514 5ustar www-datawww-datacucumber-2.4.0/examples/i18n/zh-CN/features/step_definitions/0000755000004100000410000000000012736055451024062 5ustar www-datawww-datacucumber-2.4.0/examples/i18n/zh-CN/features/step_definitions/calculator_steps.rb0000644000004100000410000000101012736055451027746 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.4.0/examples/i18n/zh-CN/features/addition.feature0000644000004100000410000000106412736055451023665 0ustar www-datawww-data# language: zh-CN 功能:加法 为了避免一些愚蠢的错误 作为一个数学白痴 我希望有人告诉我数字相加的结果 场景: 两个数相加 假如我已经在计算器里输入6 而且我已经在计算器里输入7 当我按相加按钮 那么我应该在屏幕上看到的结果是13 场景: 三个数相加 假如我已经在计算器里输入6 而且我已经在计算器里输入7 而且我已经在计算器里输入1 当我按相加按钮 那么我应该在屏幕上看到的结果是14 cucumber-2.4.0/examples/i18n/zh-CN/lib/0000755000004100000410000000000012736055451017444 5ustar www-datawww-datacucumber-2.4.0/examples/i18n/zh-CN/lib/calculator.rb0000644000004100000410000000020012736055451022112 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.4.0/examples/i18n/Rakefile0000644000004100000410000000111112736055451017416 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.4.0/examples/i18n/tr/0000755000004100000410000000000012736055451016404 5ustar www-datawww-datacucumber-2.4.0/examples/i18n/tr/Rakefile0000644000004100000410000000023612736055451020052 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.4.0/examples/i18n/tr/features/0000755000004100000410000000000012736055451020222 5ustar www-datawww-datacucumber-2.4.0/examples/i18n/tr/features/step_definitions/0000755000004100000410000000000012736055451023570 5ustar www-datawww-datacucumber-2.4.0/examples/i18n/tr/features/step_definitions/hesap_makinesi_adimlari.rb0000644000004100000410000000077412736055451030747 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.4.0/examples/i18n/tr/features/bolme.feature0000644000004100000410000000043712736055451022701 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.4.0/examples/i18n/tr/features/toplama.feature0000644000004100000410000000113312736055451023232 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.4.0/examples/i18n/tr/lib/0000755000004100000410000000000012736055451017152 5ustar www-datawww-datacucumber-2.4.0/examples/i18n/tr/lib/hesap_makinesi.rb0000644000004100000410000000031212736055451022453 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.4.0/examples/i18n/cs/0000755000004100000410000000000012736055451016364 5ustar www-datawww-datacucumber-2.4.0/examples/i18n/cs/Rakefile0000644000004100000410000000023612736055451020032 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.4.0/examples/i18n/cs/features/0000755000004100000410000000000012736055451020202 5ustar www-datawww-datacucumber-2.4.0/examples/i18n/cs/features/step_definitions/0000755000004100000410000000000012736055451023550 5ustar www-datawww-datacucumber-2.4.0/examples/i18n/cs/features/step_definitions/calculator_steps.rb0000644000004100000410000000075012736055451027446 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.4.0/examples/i18n/cs/features/addition.feature0000644000004100000410000000105612736055451023354 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.4.0/examples/i18n/cs/features/division.feature0000644000004100000410000000047012736055451023404 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.4.0/examples/i18n/cs/lib/0000755000004100000410000000000012736055451017132 5ustar www-datawww-datacucumber-2.4.0/examples/i18n/cs/lib/calculator.rb0000644000004100000410000000026512736055451021613 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.4.0/examples/i18n/pt/0000755000004100000410000000000012736055451016402 5ustar www-datawww-datacucumber-2.4.0/examples/i18n/pt/Rakefile0000644000004100000410000000023612736055451020050 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.4.0/examples/i18n/pt/features/0000755000004100000410000000000012736055451020220 5ustar www-datawww-datacucumber-2.4.0/examples/i18n/pt/features/step_definitions/0000755000004100000410000000000012736055451023566 5ustar www-datawww-datacucumber-2.4.0/examples/i18n/pt/features/step_definitions/calculadora_steps.rb0000644000004100000410000000047312736055451027607 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.4.0/examples/i18n/pt/features/adicao.feature0000644000004100000410000000053112736055451023014 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.4.0/examples/i18n/pt/features/support/0000755000004100000410000000000012736055451021734 5ustar www-datawww-datacucumber-2.4.0/examples/i18n/pt/features/support/env.rb0000644000004100000410000000032712736055451023053 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.4.0/examples/i18n/pt/lib/0000755000004100000410000000000012736055451017150 5ustar www-datawww-datacucumber-2.4.0/examples/i18n/pt/lib/calculadora.rb0000644000004100000410000000020212736055451021741 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.4.0/examples/i18n/lt/0000755000004100000410000000000012736055451016376 5ustar www-datawww-datacucumber-2.4.0/examples/i18n/lt/Rakefile0000644000004100000410000000023712736055451020045 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.4.0/examples/i18n/lt/features/0000755000004100000410000000000012736055451020214 5ustar www-datawww-datacucumber-2.4.0/examples/i18n/lt/features/step_definitions/0000755000004100000410000000000012736055451023562 5ustar www-datawww-datacucumber-2.4.0/examples/i18n/lt/features/step_definitions/calculator_steps.rb0000644000004100000410000000077312736055451027465 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.4.0/examples/i18n/lt/features/addition.feature0000644000004100000410000000116212736055451023364 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.4.0/examples/i18n/lt/features/division.feature0000644000004100000410000000046112736055451023416 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.4.0/examples/i18n/lt/lib/0000755000004100000410000000000012736055451017144 5ustar www-datawww-datacucumber-2.4.0/examples/i18n/lt/lib/calculator.rb0000644000004100000410000000026612736055451021626 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.4.0/examples/i18n/de/0000755000004100000410000000000012736055451016347 5ustar www-datawww-datacucumber-2.4.0/examples/i18n/de/Rakefile0000644000004100000410000000023612736055451020015 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.4.0/examples/i18n/de/features/0000755000004100000410000000000012736055451020165 5ustar www-datawww-datacucumber-2.4.0/examples/i18n/de/features/step_definitions/0000755000004100000410000000000012736055451023533 5ustar www-datawww-datacucumber-2.4.0/examples/i18n/de/features/step_definitions/calculator_steps.rb0000644000004100000410000000102312736055451027423 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.4.0/examples/i18n/de/features/addition.feature0000644000004100000410000000115312736055451023335 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.4.0/examples/i18n/de/features/division.feature0000644000004100000410000000055412736055451023372 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.4.0/examples/i18n/de/lib/0000755000004100000410000000000012736055451017115 5ustar www-datawww-datacucumber-2.4.0/examples/i18n/de/lib/calculator.rb0000644000004100000410000000026512736055451021576 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.4.0/examples/i18n/ar/0000755000004100000410000000000012736055451016361 5ustar www-datawww-datacucumber-2.4.0/examples/i18n/ar/Rakefile0000644000004100000410000000023612736055451020027 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.4.0/examples/i18n/ar/features/0000755000004100000410000000000012736055451020177 5ustar www-datawww-datacucumber-2.4.0/examples/i18n/ar/features/step_definitions/0000755000004100000410000000000012736055451023545 5ustar www-datawww-datacucumber-2.4.0/examples/i18n/ar/features/step_definitions/calculator_steps.rb0000644000004100000410000000100612736055451027436 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.4.0/examples/i18n/ar/features/addition.feature0000644000004100000410000000120712736055451023347 0ustar www-datawww-data# language: ar خاصية: الجمع من اجل تجنب الأخطاء السخيفة كشخص غبي في الرياضيات اريد معرفة ناتج جمع عددين سيناريو مخطط: جمع عددين بفرض كتابة في الآلة الحاسبة و كتابة في الآلة الحاسبة متى يتم الضغط على