Sha256: af369709e8a338c8fe3293b300e40b041fb65597709b1b5fb6ccc0a38ed2feba
Contents?: true
Size: 659 Bytes
Versions: 23
Compression:
Stored size: 659 Bytes
Contents
require 'spec_helper' describe 'misc forklift core' do describe 'pidfile' do it "can create a pidfile and will remove it when the plan is over" do plan = SpecPlan.new pid = "#{File.dirname(__FILE__)}/../../pid/pidfile" expect(File.exists?(pid)).to eql false plan.do! { expect(File.exists?(pid)).to eql true expect(File.read(pid).to_i).to eql Process.pid } expect(File.exists?(pid)).to eql false end it "will not run with an existing pidfile" do plan = SpecPlan.new plan.pid.store! expect { plan.do! }.to raise_error SystemExit plan.pid.delete! end end end
Version data entries
23 entries across 23 versions & 1 rubygems