Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

@tuliren
Copy link
Contributor

@tuliren tuliren commented Mar 11, 2019

Currently, this repository has no tests - and adding tests using RSpec would make a great PR :)

Here comes the unit test!

To test locally, run bundle exec rspec. By default, client - server communication is mocked by vcr, which uses local casettes recorded from production server.

To test against production server, set a test api key as SCALE_TEST_API_KEY and run bundle exec rake spec:production, which sets environment variable SCALE_TEST_SERVER to production. It will also update new client - server communication in the cassette.

Please note that updating the cassettes will break existing specs. This is because 1) the server may return random results for test api key, and 2) some of the cassettes have been modified specifically for the specs. So after the update, either the cassettes or the specs need to manually revised.

tuliren and others added 2 commits March 10, 2019 18:07
* Activate travis ci

* Set up rspec files

* Add more tests for scale.rb

* Fix example labels in readme

* Depend on webmock and vcr for testing

* Add tests for create-task methods

* Use let and test all alias methods

* Allow selection of test server

* Split each task to its own spec

* Unify task specs

* Add specs for remaining tasks

* Add spec for task list

* Update cassettes

* Test tasks and task list

* Update readme

* Use custom serializer to remove headers from cassette

* Fix spec for cancellation of valid task

* Update task list spec

* Use downcase for comments

* Remove ruby 2.4.5

* Add rake task spec:production to test against production server

* Add notes about unit tests in readme

* Revise comment for custom serializer

* Revise readme about test
@ccope
Copy link

ccope commented Apr 4, 2019

Thanks for contributing this! 🎉

@ccope ccope merged commit 531d4dc into scaleapi:master Apr 4, 2019
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.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.