forked from pedromg/bluepill
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
First working specs (minor), refs #87
- Loading branch information
Showing
3 changed files
with
32 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
-c -f progress | ||
-r ./spec/spec_helper.rb -c -f progress |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
describe Bluepill::System do | ||
describe :pid_alive? do | ||
it "should be true if process responds to zero signal" do | ||
mock(::Process).kill(0, 555) | ||
Bluepill::System.should be_pid_alive(555) | ||
end | ||
|
||
it "should be false if process throws exception on zero signal" do | ||
mock(::Process).kill(0, 555) { raise Errno::ESRCH.new } | ||
Bluepill::System.should_not be_pid_alive(555) | ||
end | ||
end | ||
|
||
describe :store do | ||
it "should be Hash" do | ||
Bluepill::System.store.should be_kind_of(Hash) | ||
end | ||
|
||
it "should return same Hash or every call" do | ||
Bluepill::System.store.should be_equal(Bluepill::System.store) | ||
end | ||
|
||
it "should store assigned pairs" do | ||
Bluepill::System.store[:somekey] = 10 | ||
Bluepill::System.store[:somekey].should be_eql(10) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters