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

pastebinit: improve test #835

Merged
merged 1 commit into from
May 5, 2016
Merged

pastebinit: improve test #835

merged 1 commit into from
May 5, 2016

Conversation

apjanke
Copy link
Contributor

@apjanke apjanke commented May 4, 2016

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same formula update/change?
  • Have you built your formula locally prior to submission with brew install <formula> (where <formula> is the name of the formula you're submitting)?
  • Does your submission pass brew audit --strict --online <formula> (after doing brew install <formula>)?

Checks the output of pastebinit to see if it's actually a URL, indicating the paste succeeded. Unfortunately, we can't check the results on pastebin because it blocks our curl fetches, probably based on user agent, and also detects these simple pastes as spammy, so you need to pass a captcha to see them.

url = shell_output("echo \"Hello world at $(date)\" | pastebinit").chomp
assert_match %r{^http://pastebin\.com/}, url
# We can't actually fetch the URL to check the paste's success because pastebin
# blocks our fetches with curl, probably based on the user agent
Copy link
Contributor

Choose a reason for hiding this comment

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

curl can set its own user agent with -A/--user-agent option, so that can probably be defeated without too much trouble.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, but we don't want to defeat it. Our policy is to report homebrew/curl as the user agent, and respect the server side's handling of it.

@apjanke apjanke merged commit 1ecec44 into Homebrew:master May 5, 2016
@apjanke apjanke deleted the pastebinit-test branch May 5, 2016 05:50
@Homebrew Homebrew locked and limited conversation to collaborators May 4, 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.

2 participants