spec/gnawrnip/screenshot_spec.rb in gnawrnip-0.1.3 vs spec/gnawrnip/screenshot_spec.rb in gnawrnip-0.2.0

- old
+ new

@@ -4,11 +4,27 @@ module Gnawrnip describe Screenshot do describe '.take' do subject { Screenshot.take.read } - # see GnawrnipTestSession::save_screenshot - it { should == "screenshot" } + context 'No given max frame size' do + before do + Screenshot.stub(:need_resize?) { false } + Screenshot.should_not_receive(:resize) + end + + # see GnawrnipTestSession::save_screenshot + it { should == "screenshot" } + end + + context 'No given max frame size' do + before do + Screenshot.stub(:need_resize?) { true } + Screenshot.should_receive(:resize) + end + + it { should == "screenshot" } + end context 'not support save_screenshot' do before do GnawrnipTest::Session.any_instance.stub(:save_screenshot) do raise Capybara::NotSupportedByDriverError