Sha256: 62803764436d49a6e80bde49a57a89b3d1469b24de42c9da0bdffcbcc5b9fc74

Contents?: true

Size: 419 Bytes

Versions: 4

Compression:

Stored size: 419 Bytes

Contents

require 'spec'

class Calulatrice
  def push(n)
    @args ||= []
    @args << n
  end
  
  def additionner
    @args.inject(0){|n,sum| sum+=n}
  end
end

Before do
  @calc = Calulatrice.new
end

After do
end

Given /que j'ai entré (\d+)/ do |n|
  @calc.push n.to_i
end

When 'je tape additionner' do
  @result = @calc.additionner
end

Then /le reultat doit ĂȘtre (\d*)/ do |result|
  @result.should == result.to_i
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
elight-cucumber-0.1.9 examples/calculatrice_francaise_avec_soit_scenario/features/calculatrice_steps.rb
cucumber-0.1.6 examples/calculatrice_francaise_avec_soit_scenario/features/calculatrice_steps.rb
cucumber-0.1.7 examples/calculatrice_francaise_avec_soit_scenario/features/calculatrice_steps.rb
cucumber-0.1.8 examples/calculatrice_francaise_avec_soit_scenario/features/calculatrice_steps.rb