Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request from 'quantiverge:fix_failing_video_recorder_spec'

Conflicts:
	spec/video_recorder_spec.rb
  • Loading branch information...
commit 6bdebc2a6418906207810e2ec6fd97b1e7ecfe13 2 parents 753f59d + 7fe8ae3
@leonid-shevtsov authored
Showing with 12 additions and 7 deletions.
  1. +12 −7 spec/video_recorder_spec.rb
View
19 spec/video_recorder_spec.rb
@@ -5,7 +5,7 @@
stub_environment
end
- describe "instaniation" do
+ describe "instantiation" do
before do
Headless::CliUtil.stub!(:application_exists?).and_return(false)
end
@@ -26,25 +26,30 @@
end
context "stopping video recording" do
+ let(:tmpfile) { '/tmp/ci.mov' }
+ let(:filename) { '/tmp/test.mov' }
+ let(:pidfile) { '/tmp/pid' }
+
subject do
- recorder = Headless::VideoRecorder.new(99, "1024x768x32", :pid_file_path => "/tmp/pid", :tmp_file_path => "/tmp/ci.mov")
+ recorder = Headless::VideoRecorder.new(99, "1024x768x32", :pid_file_path => pidfile, :tmp_file_path => tmpfile)
recorder.start_capture
recorder
end
describe "using #stop_and_save" do
it "stops video recording and saves file" do
- Headless::CliUtil.should_receive(:kill_process).with("/tmp/pid", :wait => true)
- FileUtils.should_receive(:mv).with("/tmp/ci.mov", "/tmp/test.mov")
+ Headless::CliUtil.should_receive(:kill_process).with(pidfile, :wait => true)
+ File.should_receive(:exists?).with(tmpfile).and_return(true)
+ FileUtils.should_receive(:mv).with(tmpfile, filename)
- subject.stop_and_save("/tmp/test.mov")
+ subject.stop_and_save(filename)
end
end
describe "using #stop_and_discard" do
it "stops video recording and deletes temporary file" do
- Headless::CliUtil.should_receive(:kill_process).with("/tmp/pid", :wait => true)
- FileUtils.should_receive(:rm).with("/tmp/ci.mov")
+ Headless::CliUtil.should_receive(:kill_process).with(pidfile, :wait => true)
+ FileUtils.should_receive(:rm).with(tmpfile)
subject.stop_and_discard
end
Please sign in to comment.
Something went wrong with that request. Please try again.