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

docstring #53

Closed
AlbanMinassian opened this issue Jan 5, 2014 · 3 comments
Closed

docstring #53

AlbanMinassian opened this issue Jan 5, 2014 · 3 comments

Comments

@AlbanMinassian
Copy link
Contributor

is it possible to write this with yadda ?:

Scenario:
  Given a blog post named "Random" with:
    """
    Some Title, Eh?
    ===============
    Here is the first paragraph of my blog post.
    Lorem ipsum dolor sit amet, consectetur adipiscing
    elit.
 """

src :

Ami44

@cressie176
Copy link
Member

Not easily at present. You could achieve something similar using a very general pattern to match each line in the body and a change in format, e.g.

Scenario:

Given a blog post named "Random"
with title, Some Title, Eh?
and body:
> Here is the first paragraph of my blog post.
> Lorem ipsum dolor sit amet, consectetur adipiscing
> elit.
library.given('a blog post named "$name"', function(name) {
   blog = new Blog(name);
}).given('title, $title', function(title) { 
   blog.title = title;
}).given('body:', function()) {
  // Do nothing
}).define('> $line', function(line) {
   blog.appendBody(line);
}

I agree the multiline syntax is better. I've tagged it as an enhancement.

@AlbanMinassian
Copy link
Contributor Author

Thank for this temporary alternative

@cressie176
Copy link
Member

Going to close as discussed in #144

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