Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve code coverage
Browse files Browse the repository at this point in the history
errm committed Aug 15, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent d0bec5a commit befb107
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions spec/yjit_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
require "promenade/yjit/stats"
require "promenade/yjit/middleware"
require "open3"

RSpec.describe Promenade::YJIT::Stats do
@@ -56,3 +57,17 @@ def parse_number(string)
string.to_f
end
end

RSpec.describe Promenade::YJIT::Middlware do
let(:app) { double(:app, call: nil) }

it "is adds it's instrumentation method to the rack.after_reply array" do
stats = class_spy("Promenade::YJIT::Stats").as_stubbed_const

after_reply = []
described_class.new(app).call({ "rack.after_reply" => after_reply })
after_reply.each(&:call)

expect(stats).to have_received(:instrument)
end
end

0 comments on commit befb107

Please sign in to comment.