Skip to content

Commit

Permalink
Merge 395a3bb into e0c2ef8
Browse files Browse the repository at this point in the history
  • Loading branch information
aclemons committed Oct 7, 2018
2 parents e0c2ef8 + 395a3bb commit 483da69
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
26 changes: 13 additions & 13 deletions spec/spawn/spawn_spec.rb
Expand Up @@ -21,14 +21,14 @@

it "should work in new block" do
object = double('object')
object.should_receive(:do_something)
expect(object).to receive(:do_something)
Spawnling.new do
object.do_something
end
end

it "should be able to yield directly" do
spawn!.should == "hello"
expect(spawn!).to eq("hello")
end
end

Expand All @@ -38,7 +38,7 @@
end

it "should be able to return a proc" do
spawn!.should == "foo"
expect(spawn!).to eq("foo")
end

end
Expand All @@ -49,11 +49,11 @@
end

it "should be able to return a proc" do
spawn!.should be_kind_of(Proc)
expect(spawn!).to be_kind_of(Proc)
end

it "should be able to return a proc" do
spawn!.call.should == "hello"
expect(spawn!.call).to eq("hello")
end
end

Expand All @@ -64,20 +64,20 @@
end

it "should be able to return a proc" do
Store.flag.should be_falsey
expect(Store.flag).to be_falsey
spawn_flag!
sleep(0.1) # wait for file to finish writing
Store.flag.should be_truthy
expect(Store.flag).to be_truthy
end

it "instance should have a type" do
instance = Spawnling.new{}
instance.type.should be(:thread)
expect(instance.type).to be(:thread)
end

it "instance should have a handle" do
instance = Spawnling.new{}
instance.handle.should_not be_nil
expect(instance.handle).not_to be_nil
end
end

Expand All @@ -88,20 +88,20 @@
end

it "should be able to return a proc" do
Store.flag.should be_falsey
expect(Store.flag).to be_falsey
spawn_flag!
sleep(0.1) # wait for file to finish writing
Store.flag.should be_truthy
expect(Store.flag).to be_truthy
end

it "instance should have a type" do
instance = Spawnling.new{}
instance.type.should be(:fork)
expect(instance.type).to be(:fork)
end

it "instance should have a handle" do
instance = Spawnling.new{}
instance.handle.should_not be_nil
expect(instance.handle).not_to be_nil
end
end

Expand Down
6 changes: 3 additions & 3 deletions spec/spawn/store_spec.rb
Expand Up @@ -3,10 +3,10 @@
describe Store do
it 'should flag/unflag' do
Store.reset!
Store.flag.should be_falsey
expect(Store.flag).to be_falsey
Store.flag!
Store.flag.should be_truthy
expect(Store.flag).to be_truthy
Store.reset!
Store.flag.should be_falsey
expect(Store.flag).to be_falsey
end
end

0 comments on commit 483da69

Please sign in to comment.