Skip to content

Commit a0e55db

Browse files
committed
Add spec to test frozen string debug generation
1 parent 0391aea commit a0e55db

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

command_line/frozen_strings_spec.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@
1818
it "produce different objects for literals with the same content in different files if they have different encodings" do
1919
ruby_exe(fixture(__FILE__, "freeze_flag_across_files_diff_enc.rb"), options: "--enable-frozen-string-literal").chomp.should == "true"
2020
end
21+
end
2122

23+
describe "The --debug flag produces" do
24+
it "debugging info on attempted frozen string modification" do
25+
error_str = ruby_exe(fixture(__FILE__, 'debug_info.rb'), options: '--debug', args: "2>&1")
26+
error_str.should include("can't modify frozen String, created at ")
27+
error_str.should include("spec/command_line/fixtures/debug_info.rb:2")
28+
end
2229
end
2330
end

0 commit comments

Comments
 (0)