Skip to content

Commit

Permalink
Fix spec errors with binding of caller
Browse files Browse the repository at this point in the history
For some weird reason with binding of caller loaded the inspected value
for strings is no longer quoted, breaking the specs, so this changes
the specs back to using all symbols.
  • Loading branch information
felixbuenemann committed Feb 16, 2020
1 parent faa39ec commit 641da2a
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions spec/better_errors/error_page_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ module BetterErrors

let(:exception_binding) {
local_a = :value_for_local_a
local_b = "value_for_local_b"
local_b = :value_for_local_b

@inst_c = :value_for_inst_c
@inst_d = "value_for_inst_d"
@inst_d = :value_for_inst_d

binding
}
Expand All @@ -39,15 +39,15 @@ module BetterErrors
expect(html).to include('<td class="name">local_a</td>')
expect(html).to include("<pre>:value_for_local_a</pre>")
expect(html).to include('<td class="name">local_b</td>')
expect(html).to include('<pre>"value_for_local_b"</pre>')
expect(html).to include("<pre>:value_for_local_b</pre>")
end

it "shows instance variables" do
html = error_page.do_variables("index" => 0)[:html]
expect(html).to include('<td class="name">' + '@inst_c</td>')
expect(html).to include("<pre>" + ":value_for_inst_c</pre>")
expect(html).to include('<td class="name">' + '@inst_d</td>')
expect(html).to include("<pre>" + '"value_for_inst_d"</pre>')
expect(html).to include("<pre>" + ":value_for_inst_d</pre>")
end

it "does not show filtered variables" do
Expand All @@ -56,7 +56,7 @@ module BetterErrors
expect(html).to include('<td class="name">' + '@inst_c</td>')
expect(html).to include("<pre>" + ":value_for_inst_c</pre>")
expect(html).not_to include('<td class="name">' + '@inst_d</td>')
expect(html).not_to include("<pre>" + '"value_for_inst_d"</pre>')
expect(html).not_to include("<pre>" + ":value_for_inst_d</pre>")
end

it "does not inspect value of ignored classes" do
Expand All @@ -65,11 +65,11 @@ module BetterErrors
expect(html).to include('<td class="name">local_a</td>')
expect(html).not_to include("<pre>:value_for_local_a</pre>")
expect(html).to include('<td class="name">local_b</td>')
expect(html).to include('<pre>"value_for_local_b"</pre>')
expect(html).not_to include("<pre>:value_for_local_b</pre>")
expect(html).to include('<td class="name">' + '@inst_c</td>')
expect(html).not_to include("<pre>" + ":value_for_inst_c</pre>")
expect(html).to include('<td class="name">' + '@inst_d</td>')
expect(html).to include("<pre>" + '"value_for_inst_d"</pre>')
expect(html).not_to include("<pre>" + ":value_for_inst_d</pre>")
expect(html).to include("(Class ignored. Remove Symbol from BetterErrors.ignored_classes if you need to see it.)")
end

Expand Down

0 comments on commit 641da2a

Please sign in to comment.