spec/spec_helper.rb in deadly_serious-1.0.0.pre vs spec/spec_helper.rb in deadly_serious-1.0.0.rc1

- old
+ new

@@ -11,11 +11,11 @@ end def create_file(file_name, an_array) open(file_name, 'w') do |f| an_array.each do |data| - f.puts JSON.generate(data) + f.puts MultiJson.dump(data) end end end RSpec::Matchers.define :be_running do @@ -25,11 +25,11 @@ Process.kill(0, pid) return true rescue Errno::EPERM # changed uid message = "No permission to query #{pid}!"; rescue Errno::ESRCH - message = "PID #{pid} is NOT running."; # or zombied + message = "PID #{pid} is NOT running or is a zombie."; rescue message = "Unable to determine status for PID #{pid} : #{$!}" end return false end @@ -53,10 +53,10 @@ RSpec::Matchers.define :have_content do |expected| result = nil match do |file_name| result = open(file_name, 'r') do |f| - f.map { |line| JSON.parse(line) } + f.map { |line| MultiJson.load(line) } end result == expected end failure_message do |file_name| %(expected "#{file_name}" to have content "#{expected}", but was "#{result}")