I've got an rspec test which looks something like this:
require 'require_all'
require_rel '../spec_helper'
describe "HtmlEntities" do
...some tests
end
And I'm invoking it from a rake task that looks like
require 'rspec/core/rake_task'
Rspec::Core::RakeTask.new(:spec) do |spec|
# spec.libs << 'lib' << 'spec'
# spec.spec_files = FileList['spec/**/*_spec.rb']
end
But I'm getting the exception:
./spec/fixers/entities_spec.rb:1:in `require': no such file to load -- require_all (LoadError)
from ./spec/fixers/entities_spec.rb:1
I definitely have the require_all gem installed (I can see it in gem list and require it in irb). Does anyone know why I can't require it here?
add require 'rubygems' to the top of your file that contains the rake task:
require 'rubygems'
require 'rspec/core/rake_task'
Rspec::Core::RakeTask.new(:spec) do |spec|
spec.libs << 'lib' << 'spec'
spec.spec_files = FileList['spec/**/*_spec.rb']
end
this will tell ruby to include your gems so you can run them
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With