Sha256: b3ad04539909ab339b88a30a84b2b2babc7814c1212df3be3b1aeb4e4a53feb4

Contents?: true

Size: 1.12 KB

Versions: 17

Compression:

Stored size: 1.12 KB

Contents

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
  
  ScenarioOutline "Add two numbers" do
    Given "I have entered <input_1> into the calculator"
    And "I have entered <input_2> into the calculator"
    When "I add"
    Then "the result should be <output> on the screen"
    And "the result class should be <class>"
  end
  
  Table do |t|
    t | "input_1" | "input_2" | "output" | "class"  | t
    10.times do |n|
      t | n         | n*2       | n*3      | Fixnum   | t
    end
  end
  
end

Version data entries

17 entries across 17 versions & 3 rubygems

Version Path
aslakhellesoy-cucumber-0.1.13.2 examples/calculator_ruby_features/features/addition.rb
aslakhellesoy-cucumber-0.1.13.3 examples/calculator_ruby_features/features/addition.rb
aslakhellesoy-cucumber-0.1.13 examples/calculator_ruby_features/features/addition.rb
aslakhellesoy-cucumber-0.1.14.1 examples/calculator_ruby_features/features/addition.rb
aslakhellesoy-cucumber-0.1.14.2 examples/calculator_ruby_features/features/addition.rb
aslakhellesoy-cucumber-0.1.15 examples/calculator_ruby_features/features/addition.rb
aslakhellesoy-cucumber-0.1.16.1 examples/calculator_ruby_features/features/addition.rb
aslakhellesoy-cucumber-0.1.16.2 examples/calculator_ruby_features/features/addition.rb
aslakhellesoy-cucumber-0.1.16.3 examples/calculator_ruby_features/features/addition.rb
aslakhellesoy-cucumber-0.1.16.4 examples/calculator_ruby_features/features/addition.rb
aslakhellesoy-cucumber-0.1.16 examples/calculator_ruby_features/features/addition.rb
kosmas58-cucumber-0.1.16.5 examples/calculator_ruby_features/features/addition.rb
kosmas58-cucumber-0.1.16.6 examples/calculator_ruby_features/features/addition.rb
cucumber-0.1.13 examples/calculator_ruby_features/features/addition.rb
cucumber-0.1.14 examples/calculator_ruby_features/features/addition.rb
cucumber-0.1.16 examples/calculator_ruby_features/features/addition.rb
cucumber-0.1.15 examples/calculator_ruby_features/features/addition.rb