Skip to content

Commit

Permalink
Add image_size gem to test screenshots
Browse files Browse the repository at this point in the history
  • Loading branch information
kaspergrubbe committed Nov 22, 2018
1 parent 64215ff commit 51e3548
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions ruby-vnc.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,5 @@ Gem::Specification.new do |s|
s.add_development_dependency 'rake', '~> 12.3'
s.add_development_dependency 'rspec', '~> 3.7'
s.add_development_dependency 'simplecov', '~> 0.16'
s.add_development_dependency 'image_size', '~> 2.0'
end
7 changes: 7 additions & 0 deletions spec/real_net_vnc_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,13 @@
end

context 'screenshotting' do
def verify_screenshot(input)
image_size = ImageSize.path(input)
expect(image_size.format).to eq :png
expect(image_size.width).to eq 1366
expect(image_size.height).to eq 768
end

it 'should allow you to take a screenshot with a path' do
Tempfile.open('ruby-vnc-spec') do |screenshotfile|
Net::VNC.open(NO_AUTH_SERVER_DISPLAY) do |vnc|
Expand Down
3 changes: 3 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
require 'simplecov'
SimpleCov.start

require 'tempfile'
require 'image_size'

RSpec.configure do |config|
# rspec-expectations config goes here. You can use an alternate
# assertion/expectation library such as wrong or the stdlib/minitest
Expand Down

0 comments on commit 51e3548

Please sign in to comment.