Skip to content

Commit

Permalink
Fix spec for ruby 3.4
Browse files Browse the repository at this point in the history
Ruby 3.4 changed its inspect format. Using JSON.dump for stable format across ruby versions.
  • Loading branch information
fnordfish committed Dec 13, 2024
1 parent 27f405d commit 5c73567
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion spec/roda/phlex_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def app
it "works" do
get "/more", {a: 1, b: 2}

expect(last_response.body).to eq("<pre>{&quot;a&quot;=&gt;&quot;1&quot;, &quot;b&quot;=&gt;&quot;2&quot;}</pre>")
expect(last_response.body).to eq("<pre>{&quot;a&quot;:&quot;1&quot;,&quot;b&quot;:&quot;2&quot;}</pre>")
expect(last_response.media_type).to eq("text/html")
end
end
Expand Down
4 changes: 3 additions & 1 deletion spec/support/views.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true

require "json"

class FooView < Phlex::HTML
def initialize(text = "foo")
@text = text
Expand All @@ -22,7 +24,7 @@ def view_template

class MoreDetailsView < Phlex::HTML
def view_template
pre { app.request.params.inspect }
pre { JSON.dump(app.request.params) }
end
end

Expand Down

0 comments on commit 5c73567

Please sign in to comment.