Sha256: 40b0c9f43e1380828e6d0b5387d182961b7158e8c3cef4e09ebf9938a159c426

Contents?: true

Size: 700 Bytes

Versions: 8

Compression:

Stored size: 700 Bytes

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 Float"
  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

Version data entries

8 entries across 8 versions & 3 rubygems

Version Path
aslakhellesoy-cucumber-0.1.3 examples/calculator_ruby_features/features/addition.rb
aslakhellesoy-cucumber-0.1.4 examples/calculator_ruby_features/features/addition.rb
aslakhellesoy-cucumber-0.1.9 examples/calculator_ruby_features/features/addition.rb
elight-cucumber-0.1.9 examples/calculator_ruby_features/features/addition.rb
cucumber-0.1.7 examples/calculator_ruby_features/features/addition.rb
cucumber-0.1.6 examples/calculator_ruby_features/features/addition.rb
cucumber-0.1.8 examples/calculator_ruby_features/features/addition.rb
cucumber-0.1.9 examples/calculator_ruby_features/features/addition.rb