We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d0bec5a commit befb107Copy full SHA for befb107
spec/yjit_spec.rb
@@ -1,4 +1,5 @@
1
require "promenade/yjit/stats"
2
+require "promenade/yjit/middleware"
3
require "open3"
4
5
RSpec.describe Promenade::YJIT::Stats do
@@ -56,3 +57,17 @@ def parse_number(string)
56
57
string.to_f
58
end
59
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