summaryrefslogtreecommitdiff
path: root/spec/ruby
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby')
-rw-r--r--spec/ruby/command_line/frozen_strings_spec.rb12
-rw-r--r--spec/ruby/core/string/chilled_string_spec.rb12
2 files changed, 9 insertions, 15 deletions
diff --git a/spec/ruby/command_line/frozen_strings_spec.rb b/spec/ruby/command_line/frozen_strings_spec.rb
index 334b98273b..06889755d2 100644
--- a/spec/ruby/command_line/frozen_strings_spec.rb
+++ b/spec/ruby/command_line/frozen_strings_spec.rb
@@ -42,16 +42,8 @@ describe "With neither --enable-frozen-string-literal nor --disable-frozen-strin
ruby_exe(fixture(__FILE__, "freeze_flag_one_literal.rb")).chomp.should == "false"
end
- ruby_version_is "3.4" do
- it "if file has no frozen_string_literal comment produce different frozen strings each time" do
- ruby_exe(fixture(__FILE__, "string_literal_raw.rb")).chomp.should == "frozen:true interned:false"
- end
- end
-
- ruby_version_is ""..."3.4" do
- it "if file has no frozen_string_literal comment produce different mutable strings each time" do
- ruby_exe(fixture(__FILE__, "string_literal_raw.rb")).chomp.should == "frozen:false interned:false"
- end
+ it "if file has no frozen_string_literal comment produce different mutable strings each time" do
+ ruby_exe(fixture(__FILE__, "string_literal_raw.rb")).chomp.should == "frozen:false interned:false"
end
it "if file has frozen_string_literal:true comment produce same frozen strings each time" do
diff --git a/spec/ruby/core/string/chilled_string_spec.rb b/spec/ruby/core/string/chilled_string_spec.rb
index 8de4fc421b..9f81b1af6d 100644
--- a/spec/ruby/core/string/chilled_string_spec.rb
+++ b/spec/ruby/core/string/chilled_string_spec.rb
@@ -3,8 +3,8 @@ require_relative '../../spec_helper'
describe "chilled String" do
guard -> { ruby_version_is "3.4" and !"test".equal?("test") } do
describe "#frozen?" do
- it "returns true" do
- "chilled".frozen?.should == true
+ it "returns false" do
+ "chilled".frozen?.should == false
end
end
@@ -45,7 +45,7 @@ describe "chilled String" do
input.should == "chilled-mutated"
end
- it "emits a warning on singleton_class creaation" do
+ it "emits a warning on singleton_class creation" do
-> {
"chilled".singleton_class
}.should complain(/literal string will be frozen in the future/)
@@ -57,12 +57,14 @@ describe "chilled String" do
}.should complain(/literal string will be frozen in the future/)
end
- it "raises FrozenError after the string was explictly frozen" do
+ it "raises FrozenError after the string was explicitly frozen" do
input = "chilled"
input.freeze
-> {
+ -> {
input << "mutated"
- }.should raise_error(FrozenError)
+ }.should raise_error(FrozenError)
+ }.should_not complain(/literal string will be frozen in the future/)
end
end
end