approvals/ApprovalTests.Ruby

Initialization issue w/ Approvals::CLI in v0.0.13

Closed this issue · 4 comments

zph commented

Cool idea for a library & I remember @rking being interested by this concept a year or so ago.

I ran into trouble w/ v0.0.13:

  • When trying to run the cmdline tool, it complains about:
$ bundle exec approvals                                                                                        
/Users/zph/projectX/vendor/ruby/1.9.1/gems/approvals-0.0.13/bin/approvals:7:in `<top (required)>': uninitialized constant Approvals (NameError)
        from /Users/zph/rentpath/source/rnr_ui/vendor/ruby/1.9.1/bin/approvals:23:in `load'
        from /Users/zph/rentpath/source/rnr_ui/vendor/ruby/1.9.1/bin/approvals:23:in `<main>'

So, I reverted to 0.0.12 in my Gemfile and it's working as expected.

After I fix the issue that I'm hoping to refactor, I'll see about digging into this further 😄.

Thanks for putting this lib out there!

zph commented

After 30 min refactoring this logic laden view using your approvals, I'm really excited! This is awesome 🎆

zph commented

Might be a pathing issue related to gem being run from bundler...

Seems fine when I gem install approvals && approvals but when I use it by way of bundler bundle exec approvals it throws exceptions.

zph commented

Looks like it's picking up a different CLI lib from Thor instead of the Approvals::CLI.

Verified by renaming cli.rb to something else & updating the require statement to avoid naming clash.

Hey! Thanks for figuring this out. I've never used it with bundler, and so I hadn't run into it. This makes total sense.