Add support for indicating an `assignee` on pull requests #393

Closed
wants to merge 1 commit into
from

Projects

None yet

3 participants

@gyllstromk

Adds patch method as well.

Fixes #371

@gyllstromk

I'm not a ruby developer: would appreciate guidance on augmenting the test suite.

@mislav
GitHub member

It's a good start. With the test suite, first ensure you can run rake features and that they pass for you. You can run a single file with cucumber features/pull_request.feature. You should add new scenarios to that file.

The tests never connect to the real GitHub API. Instead, they connect to what they think is a GitHub API, but in fact it's a mini-server that implements only the parts of GH API that the current command need. It will look like this:

    Given the GitHub API server:
      """
      post('/repos/mislav/coral/pulls') {
        assert :title => 'This title comes from vim!',
               :body  => 'This body as well.'
        json :html_url => "https://github.com/mislav/coral/pull/12"
      }
      """

This fake GitHub API server implements only one API endpoint: POST /repos/mislav/coral/pulls, verifies that it was given correct parameters (title and body) and returns a JSON representation of the pull request like a real GitHub server would. Since hub for now only reads the "html_url" part of the JSON representation, we only return that in tests since we keep it minimal.

For your feature, you'll have to create a new scenario where the --asignee option was used and thus implement another API endpoint: PATCH /repos/mislav/coral/pulls/XYZ. Let me know if you have any troubles.

@gyllstromk

Thanks, this is a great explanation. I'll update this week.

@frankshearar

You might draw some inspiration from the existing pull-request tests, like this one.

@mislav
GitHub member

@frankshearar Those are old-style tests which I don't maintain anymore since they used too much stubbing. I ported most of them to features/ directory and new contributions shouldn't add tests to test/ directory.

@mislav mislav referenced this pull request Apr 4, 2014
Closed

Pull request review helpers #537

@mislav mislav changed the title from [fix #371] Add support for indicating an `assignee` on pull requests. to Add support for indicating an `assignee` on pull requests Jul 28, 2014
@mislav
GitHub member

Closing this PR as it won't apply anymore since we nuked the Ruby implementation and replaced it with Go: #642. Sorry that this hasn't made it in.

@mislav mislav closed this Oct 21, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment