Skip to content

Canary: replace <%= does() %> #1163

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

Closed
kingcody opened this issue Aug 13, 2015 · 3 comments
Closed

Canary: replace <%= does() %> #1163

kingcody opened this issue Aug 13, 2015 · 3 comments
Assignees
Milestone

Comments

@kingcody
Copy link
Member

After a long night of thought and experimentation, I'd like to propose replacing the templating syntax:

<%= does("ASSERTION_SUBJECT") %>.be.at.least(1);

With:

<%= expect() %>ASSERTION_SUBJECT<%= to() %>.be.at.least(1);

Pros:

  • Fixes problems with escaping templates and line breaks
  • Will be simpler to implement and maintain
  • Templates read better than broken english does
  • No need to quote the assertion subject

Cons:

  • Adds slightly more syntax to the templates than does
@Awk34
Copy link
Member

Awk34 commented Aug 14, 2015

Hmmm, I'm not sure how I feel about this. While it does make the Yeoman templates make more grammatical sense, I like the old syntax better. We could change the language of it to make more sense (especially the foo variable to something like subject), but I like the single function to insert the proper syntax better. I think it's harder to look at the second example you gave.

@kingcody
Copy link
Member Author

@Awk34 have you thought about any solutions for this issue? Particularly the issue of the ASSERTION_SUBJECT containing ejs strings and/or new lines.

@Awk34
Copy link
Member

Awk34 commented Aug 24, 2015

I've thought about it some more, and it seems like your new solution makes more sense for our specifics.

@Awk34 Awk34 added this to the 3.0.0 milestone Aug 27, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants