spec/hawking_spec.rb in hawking-0.1 vs spec/hawking_spec.rb in hawking-0.2
- old
+ new
@@ -1,15 +1,15 @@
require "spec_helper"
describe "Hawking" do
before do
- $stdout.stub(:write).and_return ""
+ $stdout.stub(:write).and_return nil
end
it "storing a job" do
Hawking.job "example" do |data|
- puts "Some example with #{data}"
+ puts "Some example with #{data.inspect}"
end
jobs = Hawking.jobs
jobs.should be_a(Hash)
@@ -20,11 +20,11 @@
it "queuing data" do
server = TCPServer.open "127.0.0.1", 4481
hawking = Hawking::Queue.new
- hawking.put "example", :data => "john@example.org"
+ hawking.put "example", data: "john@example.org"
data = JSON.parse server.accept.gets, symbolize_names: true
server.close
@@ -35,16 +35,16 @@
expect(data[:data]).to eq data: "john@example.org"
end
it "works" do
Hawking.job "example" do |data|
- puts "Some example with #{data}"
+ puts "Some example with #{data.inspect}"
end
server = TCPServer.open "127.0.0.1", 4481
hawking = Hawking::Queue.new
- hawking.put "example", :data => "john@example.org"
+ hawking.put "example", data: "john@example.org"
Hawking.work_jobs server
server.close
end