Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 6th, 2012  |  syntax: None  |  size: 0.88 KB  |  hits: 9  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Why does cucumber with aruba not see the output of my program?
  2. Then the stdout should contain "test"  # aruba-0.4.11/lib/aruba/cucumber.rb:82
  3.   expected "" to include "test" (RSpec::Expectations::ExpectationNotMetError)
  4.   features/test.feature:13:in `Then the output should contain "test"'
  5.        
  6. Scenario: echo test
  7.   Given a blank slate
  8.   When I run `echo "test"`
  9.   The stdout should contain "test"
  10.  
  11. Scenario: puts test
  12.   Given a blank slate
  13.   When I start the program
  14.   The stdout should contain "test"
  15.        
  16. When /^I start the program$/ do
  17.   TestModule::Main.new.start
  18. end
  19.        
  20. module TestModule
  21.   class Main
  22.     def initialize
  23.     end
  24.     def start
  25.       $stdout.puts "test"
  26.     end
  27.   end
  28. end
  29.        
  30. def initialize(output=$stdout)
  31.        
  32. When /^I start the program$/ do
  33.     TestModule::Main.new(@output).start
  34. end
  35.        
  36. Then the stdout should contain "(.+)" do |string|
  37.     @output.should include string
  38. end