Closed poikilotherm closed 7 years ago
That's quite strange, it works for me. Ruby version 2.1.10 is definitely fine. Just running bundle install && bundle exec rake spec
should be enough.
Try to submit a PR, it will trigger an automated build on Travis. Btw. which OS/distribution do you use?
I'm using Fedora 24, tested on two other Fedora 23 machines. Maybe I'll setup an Ubuntu VM and try again there.
Could you check that librarian-puppet install --path=spec/fixtures/modules/
installs all dependencies correctly? Possibly the full trace might be helpful.
It get's installed correctly. I even tried to fix things by rerunning bundle exec rspec-puppet-init
(deleted Rakefile, ... before) - no new results, still all defines/classes cannot be included.
I setup an Travis CI for my repo, too. Will just stick with that for running the spec tests (also this takes more time than local testing first).
You might have a problem with .fixtures.yml
:
fixtures:
symlinks:
accounts: "#{source_dir}"
which is supposed to symlink source code directory. It's responsibility of puppetlabs_spec_helper, which is included in spec_helper.rb. You might try updating spec_helper
with exact path:
fixture_path = File.expand_path(File.join(__FILE__, '..', 'fixtures'))
RSpec.configure do |c|
c.module_path = File.join(fixture_path, 'modules')
c.manifest_dir = File.join(fixture_path, 'manifests')
end
Bingo! That's it!
Should I add this to my PR?
Cool. Sure, it's kind of magic where I don't know if it does anything or not :)
Hi there,
I wanted to add some spec tests to an extension I currently develop (see https://github.com/poikilotherm/puppet-accounts/tree/feature_enable_cleartext_pw). Maybe it is just me, but all (!) rspec tests invoked via
bundle exec rake spec
are failing with:Could not find declared class accounts::groups at line 1:1
Could not find declared class accounts at line 1:1
Could not find declared class accounts::users at line 1:1
I tried in the master branch (so no invalid code), same result. I tried with clean rvm envs (ruby 2.1.10, 2.3.1), same result. Even tried on two other machines, same result.
Does anybody have a clue? Other projects with rspec-puppet (like stdlib, ...) are running flawlessly within the same env!
My gem list: