Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get tests running with frozen string literals. #211

Merged
merged 1 commit into from
Jul 7, 2017

Conversation

pat
Copy link
Contributor

@pat pat commented Jun 28, 2017

These changes ensure that all string literals can be frozen (as per the optional feature in MRI 2.3 and onwards).

I would recommend adding the following to your .travis.yml file to ensure regressions aren't introduced:

before_script:
- if (ruby -e "exit RUBY_VERSION.to_f >= 2.4"); then export RUBYOPT="--enable-frozen-string-literal"; fi; echo $RUBYOPT

This will add the flag when the tests are run on MRI 2.4 or newer (while the feature was introduced in 2.3, it doesn't seem to work reliably until 2.4). Note that to get the test suite passing in that situation, you'll need the latest test-unit release (3.2.5), because that's now also frozen-string-literal compatible.

@korny
Copy link
Member

korny commented Jul 7, 2017

Thank you!

@korny korny added the Tests label Jul 7, 2017
@korny korny self-assigned this Jul 7, 2017
@pat
Copy link
Contributor Author

pat commented Jul 7, 2017

No worries, thanks for merging :)

@mvz
Copy link

mvz commented Aug 26, 2017

Specs on 2.4 fail due to RedCloth not supporting immutable strings.

@korny
Copy link
Member

korny commented Sep 3, 2017

Will be fixed in the next version; sorry for not releasing sooner.

@mvz
Copy link

mvz commented Sep 14, 2017

Support for immutable strings has been merged in RedCloth, so that's one step toward making the specs succeed on 2.4: jgarber/redcloth#38

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants