Sha256: d3a2b6ec88d3c8004f1a58672dcb5aba3cb606f5f0aa35e57ab0f28bb1fcb0b0

Contents?: true

Size: 1.25 KB

Versions: 10

Compression:

Stored size: 1.25 KB

Contents

require 'spec_helper'
require 'cucumber/formatter/spec_helper'
require 'cucumber/formatter/pretty'

module Cucumber
  module RbSupport
    describe RbWorld do
      extend Cucumber::Formatter::SpecHelperDsl
      include Cucumber::Formatter::SpecHelper

      describe 'Handling puts in step definitions' do
        before(:each) do
          Cucumber::Term::ANSIColor.coloring = false
          @out = StringIO.new
          @formatter = Cucumber::Formatter::Pretty.new(runtime, @out, {})
          run_defined_feature
        end

        describe 'when modifying the printed variable after the call to puts' do
          define_feature <<-FEATURE
        Feature: Banana party

          Scenario: Monkey eats banana
            When puts is called twice for the same variable
          FEATURE

          define_steps do
            When(/^puts is called twice for the same variable$/) do
              foo = 'a'
              puts foo
              foo.upcase!
              puts foo
            end
          end

          it 'prints the variable value at the time puts was called' do
            expect( @out.string ).to include <<OUTPUT
    When puts is called twice for the same variable
      a
      A
OUTPUT
          end
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
cucumber-2.99.0 spec/cucumber/rb_support/rb_world_spec.rb
mobiusloop-0.1.5 spec/cucumber/rb_support/rb_world_spec.rb
cucumber-2.4.0 spec/cucumber/rb_support/rb_world_spec.rb
mobiusloop-0.1.3 spec/cucumber/rb_support/rb_world_spec.rb
mobiusloop-0.1.2 spec/cucumber/rb_support/rb_world_spec.rb
cucumber-2.3.3 spec/cucumber/rb_support/rb_world_spec.rb
cucumber-2.3.2 spec/cucumber/rb_support/rb_world_spec.rb
cucumber-2.3.1 spec/cucumber/rb_support/rb_world_spec.rb
cucumber-2.3.0 spec/cucumber/rb_support/rb_world_spec.rb
cucumber-2.2.0 spec/cucumber/rb_support/rb_world_spec.rb