Class: Watirmark::Screenshot::Master
- Defined in:
- lib/watirmark/screenshot.rb
Instance Attribute Summary
Attributes inherited from Current
#filename, #screenheight, #screenwidth
Instance Method Summary collapse
-
#initialize(filename, screenshot) ⇒ Master
constructor
A new instance of Master.
- #update(screenshot) ⇒ Object
Methods inherited from Current
#get_screen_size, #md5, #revert_window_size, #take_screen_shot, #update_window_size
Constructor Details
#initialize(filename, screenshot) ⇒ Master
Returns a new instance of Master.
108 109 110 111 |
# File 'lib/watirmark/screenshot.rb', line 108 def initialize(filename, screenshot) @filename = filename update(screenshot) if Watirmark::Configuration.instance.create_master_snapshots end |
Instance Method Details
#update(screenshot) ⇒ Object
113 114 115 116 117 118 |
# File 'lib/watirmark/screenshot.rb', line 113 def update(screenshot) FileUtils.mkdir_p(File.dirname(@filename)) File.unlink(@filename) if File.exists?(@filename) FileUtils.copy_file(screenshot.filename, @filename) Watirmark.logger.info "Created new master: #@filename" end |