Skip to content

Commit

Permalink
tmp: accept frozen strings
Browse files Browse the repository at this point in the history
Ref: ruby/ruby#10235

As discussed upstream, the mutability is only used in one spec, `path.rb`:

```ruby
    @name = +"file_to_path"
    @path = tmp(@name)
```

For all the others it doesn't matter if the argument is mutated or not.
  • Loading branch information
byroot committed Mar 13, 2024
1 parent 58050d7 commit 2b17e42
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/mspec/helpers/tmp.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ def tmp(name, uniquify = true)
if uniquify and !name.empty?
slash = name.rindex "/"
index = slash ? slash + 1 : 0
name = +name
name.insert index, "#{SPEC_TEMP_UNIQUIFIER.succ!}-"
end

Expand Down

0 comments on commit 2b17e42

Please sign in to comment.