Skip to content

Commit

Permalink
Disable $RUBYOPT env variable in specs that expects there are no --en…
Browse files Browse the repository at this point in the history
…able-frozen-string-literal flag
  • Loading branch information
andrykonchin committed Apr 1, 2024
1 parent afee5cb commit a521d21
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions command_line/frozen_strings_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,15 @@
end

describe "With neither --enable-frozen-string-literal nor --disable-frozen-string-literal flag set" do
before do
# disable --enable-frozen-string-literal and --disable-frozen-string-literal passed in $RUBYOPT
@rubyopt = ENV["RUBYOPT"]
ENV["RUBYOPT"] = ""
end

after do
ENV["RUBYOPT"] = @rubyopt
end

it "produce a different object each time" do
ruby_exe(fixture(__FILE__, "freeze_flag_one_literal.rb")).chomp.should == "false"
Expand Down

0 comments on commit a521d21

Please sign in to comment.