Skip to content

Commit

Permalink
Add inversive test
Browse files Browse the repository at this point in the history
  • Loading branch information
kirs committed Mar 24, 2021
1 parent 0e0b149 commit 0beda46
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions spec/ruby/language/fixtures/non_frozen_interpolation.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# frozen_string_literal: false

p "foo #{14}".frozen?
6 changes: 6 additions & 0 deletions spec/ruby/language/string_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,12 @@ def long_string_literals
it "interpolated string is frozen" do
ruby_exe(fixture(__FILE__, "freeze_magic_comment_interpolation.rb")).chomp.should == "true"
end

describe "when disabled" do
it "interpolated string is not frozen" do
ruby_exe(fixture(__FILE__, "non_frozen_interpolation.rb")).chomp.should == "false"
end
end
end

end
Expand Down
1 change: 1 addition & 0 deletions spec/tags/language/string_tags.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ slow:Ruby String literals with a magic frozen comment produce the same object fo
slow:Ruby String literals with a magic frozen comment produce different objects for literals with the same content in different files if the other file doesn't have the comment
slow:Ruby String literals with a magic frozen comment produce different objects for literals with the same content in different files if they have different encodings
slow:Ruby String literals with a magic frozen comment interpolated string is frozen
slow:Ruby String literals with a magic frozen comment when disabled interpolated string is not frozen

0 comments on commit 0beda46

Please sign in to comment.