summaryrefslogtreecommitdiff
path: root/test/spec_runtime.rb
diff options
context:
space:
mode:
authorRyan Davis <ryand-ruby@zenspider.com>2015-06-12 00:41:57 -0700
committerRyan Davis <ryand-ruby@zenspider.com>2015-06-12 00:41:57 -0700
commitc99a755a3f55f0769245e7a22dd000b471f77d88 (patch)
tree120f7686f5415a0a7789a38f00268fe80469ed81 /test/spec_runtime.rb
parentdf941b3cc45b15d544f3445e3bfcbdd9add362a6 (diff)
downloadrack-c99a755a3f55f0769245e7a22dd000b471f77d88.tar.gz
First attempt to mass-port from minitest/bacon to minitest/spec.
I still can't run some of the tests, so they might have problems. I'll leave it to the CI to catch them.
Diffstat (limited to 'test/spec_runtime.rb')
-rw-r--r--test/spec_runtime.rb18
1 files changed, 9 insertions, 9 deletions
diff --git a/test/spec_runtime.rb b/test/spec_runtime.rb
index 4b926315..38af049f 100644
--- a/test/spec_runtime.rb
+++ b/test/spec_runtime.rb
@@ -1,4 +1,4 @@
-require 'minitest/bacon'
+require 'minitest/autorun'
require 'rack/lint'
require 'rack/mock'
require 'rack/runtime'
@@ -15,22 +15,22 @@ describe Rack::Runtime do
it "sets X-Runtime is none is set" do
app = lambda { |env| [200, {'Content-Type' => 'text/plain'}, "Hello, World!"] }
response = runtime_app(app).call(request)
- response[1]['X-Runtime'].should =~ /[\d\.]+/
+ response[1]['X-Runtime'].must_match(/[\d\.]+/)
end
it "doesn't set the X-Runtime if it is already set" do
app = lambda { |env| [200, {'Content-Type' => 'text/plain', "X-Runtime" => "foobar"}, "Hello, World!"] }
response = runtime_app(app).call(request)
- response[1]['X-Runtime'].should == "foobar"
+ response[1]['X-Runtime'].must_equal "foobar"
end
- should "allow a suffix to be set" do
+ it "allow a suffix to be set" do
app = lambda { |env| [200, {'Content-Type' => 'text/plain'}, "Hello, World!"] }
response = runtime_app(app, "Test").call(request)
- response[1]['X-Runtime-Test'].should =~ /[\d\.]+/
+ response[1]['X-Runtime-Test'].must_match(/[\d\.]+/)
end
- should "allow multiple timers to be set" do
+ it "allow multiple timers to be set" do
app = lambda { |env| sleep 0.1; [200, {'Content-Type' => 'text/plain'}, "Hello, World!"] }
runtime = runtime_app(app, "App")
@@ -42,9 +42,9 @@ describe Rack::Runtime do
response = runtime.call(request)
- response[1]['X-Runtime-App'].should =~ /[\d\.]+/
- response[1]['X-Runtime-All'].should =~ /[\d\.]+/
+ response[1]['X-Runtime-App'].must_match(/[\d\.]+/)
+ response[1]['X-Runtime-All'].must_match(/[\d\.]+/)
- Float(response[1]['X-Runtime-All']).should > Float(response[1]['X-Runtime-App'])
+ Float(response[1]['X-Runtime-All']).must_be :>, Float(response[1]['X-Runtime-App'])
end
end