I am updating a gem to make sure it works with the new versions of the bitly and rspec gems, and I have run into an odd issue.
When I run guard
to make sure all the tests pass with the new gem, I get a TypeError; however, if I run my test suite directly with just rspec
they all pass and do not throw the error.
My code is available on GitHub if you want to see the whole shebang.
From digging around, I've seen people suggesting to wrap the class inside of its own module to keep the class names from conflicting, but since it works fine with just rspec
, I am hoping I don't need to add another layer.
Here's the TypeError:
/Users/jstim/Documents/Programming/Ruby/uncoil/lib/uncoil.rb:6:in '': Uncoil is not a class (TypeError)
from /Users/jstim/Documents/Programming/Ruby/uncoil/spec/uncoil_spec.rb:1:in 'require_relative'
from /Users/jstim/Documents/Programming/Ruby/uncoil/spec/uncoil_spec.rb:1:in ''
from /Users/jstim/.rvm/gems/ruby-1.9.2-p290/gems/rspec-core-2.8.0/lib/rspec/core/configuration.rb:698:in 'load'
from /Users/jstim/.rvm/gems/ruby-1.9.2-p290/gems/rspec-core-2.8.0/lib/rspec/core/configuration.rb:698:in 'block in load_spec_files'
from /Users/jstim/.rvm/gems/ruby-1.9.2-p290/gems/rspec-core-2.8.0/lib/rspec/core/configuration.rb:698:in 'map'
from /Users/jstim/.rvm/gems/ruby-1.9.2-p290/gems/rspec-core-2.8.0/lib/rspec/core/configuration.rb:698:in 'load_spec_files'
from /Users/jstim/.rvm/gems/ruby-1.9.2-p290/gems/rspec-core-2.8.0/lib/rspec/core/command_line.rb:22:in 'run'
from /Users/jstim/.rvm/gems/ruby-1.9.2-p290/gems/rspec-core-2.8.0/lib/rspec/core/runner.rb:80:in 'run_in_process'
from /Users/jstim/.rvm/gems/ruby-1.9.2-p290/gems/rspec-core-2.8.0/lib/rspec/core/runner.rb:69:in 'run'
from /Users/jstim/.rvm/gems/ruby-1.9.2-p290/gems/rspec-core-2.8.0/lib/rspec/core/runner.rb:10:in 'block in autorun'
Let me know if I can include additional code to help out. thanks!
bundle exec guard
andbundle exec rspec spec
). Also, you don't needrequire_relative
as RSpec manages the path for you (lib is in the path, just dorequire "uncoil"
). – Joshua Cheek