mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Update to ruby/spec@28a728b
This commit is contained in:
parent
3eb0d50c0b
commit
664e96b1de
42 changed files with 484 additions and 117 deletions
|
@ -341,5 +341,22 @@ CODE
|
|||
value.encoding.should == Encoding::BINARY
|
||||
value.frozen?.should be_true
|
||||
end
|
||||
|
||||
it "ignores the frozen_string_literal magic comment if it appears after a token and warns if $VERBOSE is true" do
|
||||
code = <<CODE
|
||||
some_token_before_magic_comment = :anything
|
||||
# frozen_string_literal: true
|
||||
class EvalSpecs
|
||||
Vπstring_not_frozen = "not frozen"
|
||||
end
|
||||
CODE
|
||||
-> { eval(code) }.should complain(/warning: `frozen_string_literal' is ignored after any tokens/, verbose: true)
|
||||
EvalSpecs::Vπstring_not_frozen.frozen?.should be_false
|
||||
EvalSpecs.send :remove_const, :Vπstring_not_frozen
|
||||
|
||||
-> { eval(code) }.should_not complain(verbose: false)
|
||||
EvalSpecs::Vπstring_not_frozen.frozen?.should be_false
|
||||
EvalSpecs.send :remove_const, :Vπstring_not_frozen
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue