Class: Janus::Command::Validate
- Inherits:
-
Object
- Object
- Janus::Command::Validate
- Defined in:
- lib/janus/command/validate.rb
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(configuration) ⇒ Validate
constructor
A new instance of Validate.
- #validate_screenshot(test) ⇒ Object
Constructor Details
#initialize(configuration) ⇒ Validate
Returns a new instance of Validate.
4 5 6 |
# File 'lib/janus/command/validate.rb', line 4 def initialize(configuration) @configuration = configuration end |
Instance Method Details
#execute ⇒ Object
8 9 10 11 12 |
# File 'lib/janus/command/validate.rb', line 8 def execute @configuration.tests.each do |test| validate_screenshot(test) end end |
#validate_screenshot(test) ⇒ Object
14 15 16 17 18 19 |
# File 'lib/janus/command/validate.rb', line 14 def validate_screenshot(test) original = Janus::Screenshot.load(test, path: 'output') fresh = Janus::Screenshot.capture(test, username: @configuration.username, access_key: @configuration.access_key) raise "#{test.name}: Screenshots did not match!" unless original.image == fresh.image end |