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

Refactor thor #47

Merged
merged 14 commits into from Sep 29, 2014
Merged

Refactor thor #47

merged 14 commits into from Sep 29, 2014

Conversation

abtris
Copy link
Contributor

@abtris abtris commented Sep 15, 2014

Summary

  • refactor using Thor
  • add integration tests via Cucumber/Aruba
  • update tests to run RSpec 3
  • integration tests (at circle)

Ladislav Prskavec added 9 commits September 15, 2014 14:41
…ib from API_NAME.apiary.io

  # This is integration testing you have to set APIARY_API_KEY
  Scenario: Fetch apiary.apib from API_NAME.apiary.io                # features/fetch.feature:4
    When I run `apiary fetch --api-name apiaryclienttest`            # aruba-0.6.1/lib/aruba/cucumber.rb:93
    Then the output should contain the content of file "apiary.apib" # features/step_definitions/file_content_step.rb:1

Feature: Show API documentation in specified browser

  # This is integration testing you have to set APIARY_API_KEY
  Scenario: Write generated HTML into specified file                  # features/preview.feature:4
    When I run `apiary preview --path apiary.apib --output=test.html` # aruba-0.6.1/lib/aruba/cucumber.rb:93
    Then a file named "test.html" should exist                        # aruba-0.6.1/lib/aruba/cucumber.rb:307

Feature: Publish apiary.apib on docs.API_NAME.apiary.io

  # This is integration testing you have to set APIARY_API_KEY
  Scenario: Publish apiary.apib on docs.API_NAME.apiary.io                         # features/publish.feature:4
    When I run `apiary publish --path=apiary.apib --api-name 1111apiaryclienttest` # aruba-0.6.1/lib/aruba/cucumber.rb:93
    Then the exit status should be 1                                               # aruba-0.6.1/lib/aruba/cucumber.rb:197

Feature: Version of Apiary client

  Scenario: Print the semantic version of Apiary client                                                                        # features/version.feature:3
    When I run `apiary version`                                                                                                # aruba-0.6.1/lib/aruba/cucumber.rb:93
    Then the output should match /^([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+[0-9A-Za-z-]+)?$/ # aruba-0.6.1/lib/aruba/cucumber.rb:180
    And the exit status should be 0                                                                                            # aruba-0.6.1/lib/aruba/cucumber.rb:197

4 scenarios (4 passed)
9 steps (9 passed)
0m3.871s
@honzajavorek
Copy link
Contributor

Note: If merged, closes #37.

desc "fetch", "Fetch apiary.apib from API_NAME.apiary.io"
method_option :api_name, :type => :string, :required => true, :default => ''
def fetch
cmd = Apiary::Command::Fetch.new options
Copy link
Contributor

Choose a reason for hiding this comment

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

Some files have indentation by two spaces, some by four - I do not like this. Please, unify it throughout the codebase.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll fix all to 2, thx

Copy link
Contributor

Choose a reason for hiding this comment

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

👍

@honzajavorek
Copy link
Contributor

Why Circle? Thought that we usually put OpenSource projects into TravisCI.

BODY_EXAMPLE = '{
"error": false,
"message": "",
"code": "FORMAT: 1A\nHOST: http://www.testing.com\n\n# Notes API test 123\nNotes API is a *short texts saving* service similar to its physical paper presence on your table.\n\n# Group Notes\nNotes related resources of the **Notes API**\n\n## Notes Collection [/notes]\n### List all Notes [GET]\n+ Response 200 (application/json)\n\n [{\n \"id\": 1, \"title\": \"Jogging in park\"\n }, {\n \"id\": 2, \"title\": \"Pick-up posters from post-office\"\n }]\n\n### Create a Note [POST]\n+ Request (application/json)\n\n { \"title\": \"Buy cheese and bread for breakfast.\" }\n\n+ Response 201 (application/json)\n\n { \"id\": 3, \"title\": \"Buy cheese and bread for breakfast.\" }\n\n## Note [/notes/{id}]\nA single Note object with all its details\n\n+ Parameters\n + id (required, number, `1`) ... Numeric `id` of the Note to perform action with. Has example value.\n\n### Retrieve a Note [GET]\n+ Response 200 (application/json)\n\n + Header\n\n X-My-Header: The Value\n\n + Body\n\n { \"id\": 2, \"title\": \"Pick-up posters from post-office\" }\n\n### Remove a Note [DELETE]\n+ Response 204\n"
}'
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

@honzajavorek
Copy link
Contributor

Large PR :-( Please, split into smaller pieces next time so it is easier to understand and review.

As I am not that good in Ruby, I do not have balls to push the Merge button on something this big without someone else also reviewing this.

@abtris
Copy link
Contributor Author

abtris commented Sep 16, 2014

Circle for integration rake features i have to use APIARY_API_KEY for this.

@abtris
Copy link
Contributor Author

abtris commented Sep 16, 2014

Sorry for large PR, but doesn't not work without many changes.

@abtris
Copy link
Contributor Author

abtris commented Sep 27, 2014

@honzajavorek All works, please look into and merge or close.

@@ -0,0 +1,7 @@
require 'spec_helper'

describe Apiary::Command::Preview do
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't this dead code?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes and no. It's some from future feature. I'll remove from this PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

honzajavorek added a commit that referenced this pull request Sep 29, 2014
@honzajavorek honzajavorek merged commit 36b066d into master Sep 29, 2014
@honzajavorek honzajavorek deleted the abtris/refactor-thor branch September 29, 2014 12:13
@honzajavorek
Copy link
Contributor

@abtris will you please publish a new version?

@Almad
Copy link
Contributor

Almad commented Oct 3, 2014

@abtris Would you please give access to more people like @honzajavorek so they can publish new releases as well? ;)

@abtris
Copy link
Contributor Author

abtris commented Oct 3, 2014

@Almad Hi can (5 people can).

@honzajavorek
Copy link
Contributor

My request was not because I could not, but because I forgot again how to do it and I knew @abtris will have it done in a minute, so I kindly asked him :) I did already release apiary-client in history.

@Almad
Copy link
Contributor

Almad commented Oct 3, 2014

@honzajavorek this means we should have rake release or something similar (as we do have paver release)

@abtris
Copy link
Contributor Author

abtris commented Oct 4, 2014

@Almad I add into #52 it's small change

@Almad
Copy link
Contributor

Almad commented Oct 4, 2014

@abtris I'd still say "branch properly"...

@abtris
Copy link
Contributor Author

abtris commented Oct 4, 2014

Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants