Created
April 2, 2009 19:52
-
-
Save tomtt/89396 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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