Sha256: 08fdf1ca7919e27af245b33f383a03a2ce33284ad4af6638afb15add80c8bfea

Contents?: true

Size: 819 Bytes

Versions: 1

Compression:

Stored size: 819 Bytes

Contents

# frozen_string_literal: true

# File: env.rb

module DemoMacros4Cuke # Use the module as a namespace
  # Class created just for testing and demonstration purposes.
  # Its instance, will record the output emitted by the steps.
  class TracingWorld
    # Will contain the text emitted by the steps
    attr_reader(:trace_steps)

    def initialize()
      # Constructor
      @trace_steps = []
    end

    # Write the given text to the error console
    def show(someText)
      # Replace every \" sequence by genuine "
      unescaped = someText.gsub(/\\"/, '"')
      $stderr.puts(unescaped)
    end
  end # class
end # module

# For testing purpose we override the default Cucumber behaviour
# making our world object an instance of the TracingWorld class
World { DemoMacros4Cuke::TracingWorld.new }

# End of file

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
macros4cuke-0.5.17 examples/demo/features/support/env.rb