Skip to content

Instantly share code, notes, and snippets.

@tomtt
Created April 2, 2009 19:52
Show Gist options
  • Save tomtt/89396 to your computer and use it in GitHub Desktop.
Save tomtt/89396 to your computer and use it in GitHub Desktop.
module OptionsGetterSetter
attr_accessor :options
end
module Cucumber
module Formatter
class ScreenShots < Ast::Visitor
def initialize(step_mother, io, options)
super(step_mother)
@trac_numbers_generated = {}
@feature_statistics = {}
options[:screen_shots_directory] =
@screenshots_directory = File.expand_path(File.join(RAILS_ROOT,
'public',
'screenshots',
Time.now.to_s(:number)))
FileUtils.mkdir_p(@screenshots_directory)
step_mother.World { |world| world.options = options }
end
def visit_features(features)
super
puts "Screenshots created in %s" % @screenshots_directory
end
end
end
end
World do |world|
world.extend OptionsGetterSetter
world
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment