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

Documentation for attachments #225

Closed

Conversation

simondean
Copy link
Contributor

Hi @jbpros, here's the documentation for #189

@simondean
Copy link
Contributor Author

I've realized that I didn't document how to create attachments from a step definition (by adding the scenario object to the world from a before or around hook). I should add that to the README.md

@samccone
Copy link
Member

hey @simondean I think it will be best to create a docs folder in the repo and add a new file for attachments.

That way we are not cramming everything into a single readme

@aslakhellesoy
Copy link
Contributor

Good stuff!

How about an alternate way to attach JSON attachments:

scenario.attach({name: "some JSON"});

The attach function could assume the attachment is JSON with the following test:

if(typeof attachment === 'object' && !Buffer.isBuffer(attachment) && !isReadableStream(attachment)) {
  // it's JSON
  json = JSON.stringify(attachment);
}

With:

function isReadableStream(o) {
  return typeof(o.read) === 'function';
}

WDYT?

@simondean
Copy link
Contributor Author

@samccone any suggestions for the approach for splitting out the documentation? Ruby Cucumber uses GitHub wiki pages. The "documentation" link on https://github.com/cucumber/cucumber/blob/master/README.md points to https://github.com/cucumber/cucumber/wiki

@jbpros
Copy link
Member

jbpros commented Jun 16, 2015

Merged in as b2d904d and 1350632

@jbpros jbpros closed this Jun 16, 2015
@lock
Copy link

lock bot commented Oct 25, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Oct 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants