Skip to content

Commit 3d8a5c8

Browse files
committed
Fix Rack::Profiler test to test behaviour, not implementation
1 parent 2b00f55 commit 3d8a5c8

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

test/spec_rack_profiler.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@
1414
profiler.instance_variable_get('@times').must_equal 1
1515
end
1616

17-
specify 'call @times globally and times is set' do
18-
profiler = Rack::Profiler.new(app, :times => 4)
19-
profiler.instance_variable_get('@times').should.equal 4
17+
specify 'called multiple times via query params' do
18+
req = Rack::MockRequest.env_for("/", :params => "profile=process_time&times=4")
19+
body = Rack::Profiler.new(app).call(req)[2].string
20+
body.must_match(/Fixnum#to_s \[4 calls, 4 total\]/)
2021
end
2122

2223
specify 'CallStackPrinter has Content-Type test/html' do

0 commit comments

Comments
 (0)