NYULibraries / siteleaf-gem

Ruby interface and command line utility for the Siteleaf API
http://siteleaf.com
MIT License
1 stars 0 forks source link

Create specs to test functionality of Siteleaf gem #1

Open hab278 opened 9 years ago

hab278 commented 9 years ago

More testing is always welcome, lets increase testing on existing functionality for Siteleaf

Amay22 commented 9 years ago

I am not sure if this needs to be added to Readme cause the user is just using the gem as a command line utility. So should this go in a wiki ?

I believe the RSpec testing is good for our code or even theirs except the user authentication part cause its been modified for figs support.

hab278 commented 9 years ago

@Amay22 The rspec tests should make no assumptions on impending features. This PR will be for siteleaf, and as such we cannot expect them to take Figs as part of their workflow. As such, lines like this shouldn't exist.

Amay22 commented 9 years ago

@hab278 How about now

https://github.com/NYULibraries/siteleaf-gem/tree/feature/rspec-testing

I can't rpsec the authentication i.e. part of the code cause the site-leaf command line utility already has tests for user authentication and it prompts the user so the code is not designed to be rpsec'ed.

https://github.com/NYULibraries/siteleaf-gem/blob/feature/rspec-testing/lib/siteleaf.rb#L33-L41

hab278 commented 9 years ago

@Amay22 A couple of things to note.

  1. The commit has too much going on. At a glance, I see changes to the gemspec, an addition to .gitignore, multiple new files, some specs and some cassettes. This is not ideal! These can be broken up to smaller iterative commits. For example, you can create a commit for the gemspec change, another for the `.gitignore, some for the cassettes, and some for specs. This allows someone to choose what they want to take and what not to. Not all new files have to go in one commit. You can commit each file separately, incase someone else makes a spec first, and it is more thorough.
  2. Not entirely sure what you mean the code isn't designed to be rspec'd. I understand you wouldn't want to rpsec command line arguments, which is fine, but loading a .siteleaf file is very rspeccable.
Amay22 commented 9 years ago

@hab278: How about now? https://github.com/NYULibraries/siteleaf-gem/tree/feature/rspec-testing