Skip to content

tests squiggly heredoc - #318

Merged
eregon merged 1 commit into
ruby:masterfrom
sgarciac:master
Oct 22, 2016
Merged

eregon merged 1 commit into
ruby:masterfrom
sgarciac:master

Conversation

@sgarciac

Copy link
Copy Markdown
Contributor

@sgarciac

sgarciac commented Oct 18, 2016 •

Copy link
Copy Markdown
Contributor Author

ouch, it breaks on rubies < 2.3, obviously. I'll come back with a new PR.

@sgarciac

Copy link
Copy Markdown
Contributor Author

I'm using eval now, to prevent syntax problems on rubies < 2.3

Comment thread language/string_spec.rb
end

ruby_version_is "2.3" do
it "allows HEREDOC with <<~'identifier', allowing to indent identifier and content" do

@eregon eregon Oct 19, 2016 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The variable (s) is not indented in this case 😉 , maybe add a couple spaces before s = ?
Alternatively, this could be a fixture file under language/fixtures to improve readability.

@eregon eregon Oct 19, 2016 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I see, you meant the heredoc identifier, not the variable.
I think it's worth moving this to a fixture and under a method (say StringSpec.squiggly) to improve readability and make it a more real-world example.
You can then require fixture(__FILE__, "squiggly_heredoc.rb") in this spec example.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

ok

* See #175
* See [Feature 9098]
@sgarciac

Copy link
Copy Markdown
Contributor Author

new version

@eregon

eregon commented Oct 22, 2016

Copy link
Copy Markdown
Member

Well done, thanks!

@eregon
eregon merged commit 57c69fc into ruby:master Oct 22, 2016
@iliabylich iliabylich mentioned this pull request Oct 24, 2016
51 tasks done
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.

2 participants