18

Where can I find good examples of testing a Thor script with RSpec?

My searches have so far not turned up anything good.

iconoclast
  • 21,213
  • 15
  • 102
  • 138

2 Answers2

9

Try out Thor's own repo at https://github.com/wycats/thor/tree/master/spec

argent_smith
  • 476
  • 6
  • 11
6

I'm trying to do rspec tests for thor in my homedir project (in the homedir3 branch, at the moment). Look in the CLI_spec.rb file.

I don't claim they are the paragon of unit tests but it's something to look at.

docwhat
  • 11,435
  • 6
  • 55
  • 54