test/helper.rb in sinatra-1.3.1 vs test/helper.rb in sinatra-1.3.2
- old
+ new
@@ -67,10 +67,14 @@
def body
response.body.to_s
end
def assert_body(value)
- assert_equal value.lstrip.gsub(/\s*\n\s*/, ""), body.lstrip.gsub(/\s*\n\s*/, "")
+ if value.respond_to? :to_str
+ assert_equal value.lstrip.gsub(/\s*\n\s*/, ""), body.lstrip.gsub(/\s*\n\s*/, "")
+ else
+ assert_match value, body
+ end
end
def assert_status(expected)
assert_equal Integer(expected), Integer(status)
end