Skip to content

Commit befb107

Browse files
committed
Improve code coverage
1 parent d0bec5a commit befb107

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

spec/yjit_spec.rb

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
require "promenade/yjit/stats"
2+
require "promenade/yjit/middleware"
23
require "open3"
34

45
RSpec.describe Promenade::YJIT::Stats do
@@ -56,3 +57,17 @@ def parse_number(string)
5657
string.to_f
5758
end
5859
end
60+
61+
RSpec.describe Promenade::YJIT::Middlware do
62+
let(:app) { double(:app, call: nil) }
63+
64+
it "is adds it's instrumentation method to the rack.after_reply array" do
65+
stats = class_spy("Promenade::YJIT::Stats").as_stubbed_const
66+
67+
after_reply = []
68+
described_class.new(app).call({ "rack.after_reply" => after_reply })
69+
after_reply.each(&:call)
70+
71+
expect(stats).to have_received(:instrument)
72+
end
73+
end

0 commit comments

Comments
 (0)