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

Make preprocessor work with frozen inputs #27

Merged
merged 2 commits into from
Mar 31, 2023

Conversation

peteryates
Copy link
Member

Preprocessing frozen strings failed because originally we modified the actual inputs. Now we're overwriting them instead. All the specs have been switched over to frozen inputs as it's safe to assume if it works with a frozen string it will work with an unfrozen one.

Fixes #26

Preprocessing frozen strings failed because originally we modified the
actual inputs. Now we're overwriting them instead. All the specs have
been switched over to frozen inputs as it's safe to assume if it works
with a frozen string it will work with an unfrozen one.
@peteryates peteryates requested a review from HettieS February 25, 2023 14:36
Copy link
Contributor

@HettieS HettieS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some comments!

lib/govuk_markdown/preprocessor.rb Show resolved Hide resolved
@@ -17,7 +17,7 @@
describe "inset text" do
context "when there is an inline piece of inset text" do
let(:input) do
<<~MD
<<~MD.freeze
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice. I'm thinking I might create separate specs with frozen strings to highlight what we're doing here, rather than add it into existing specs - otherwise I'm going to forget why we did this...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah - good call!

@HettieS HettieS merged commit 03b4466 into main Mar 31, 2023
@HettieS HettieS deleted the ensure-preprocessor-works-with-frozen-inputs branch March 31, 2023 12:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Problem with modifying frozen strings
2 participants