Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rspec3 breaks rspec-puppet - undefined method `display_name' for RSpec::ExampleGroups #198

Closed
tuxmea opened this issue Jun 2, 2014 · 4 comments · Fixed by #201
Closed
Milestone

Comments

@tuxmea
Copy link
Contributor

tuxmea commented Jun 2, 2014

Gemfile:
gem 'rspec-puppet', :git => "https://github.com/rodjek/rspec-puppet.git"
gem 'puppetlabs_spec_helper'

Output:

[14:01:50][Step 1/3] Resolving dependencies...
[14:01:50][Step 1/3] Using rake (10.1.1)
[14:01:50][Step 1/3] Using diff-lcs (1.2.5)
[14:01:50][Step 1/3] Using facter (1.6.0)
[14:01:50][Step 1/3] Using json_pure (1.8.1)
[14:01:50][Step 1/3] Using hiera (1.3.3)
[14:01:50][Step 1/3] Using metaclass (0.0.4)
[14:01:50][Step 1/3] Using mocha (1.1.0)
[14:01:51][Step 1/3] Using puppet (3.1.1)
[14:01:51][Step 1/3] Using puppet-lint (0.3.2)
[14:01:51][Step 1/3] Using rspec-support (3.0.0)
[14:01:51][Step 1/3] Using rspec-core (3.0.0)
[14:01:51][Step 1/3] Using rspec-expectations (3.0.0)
[14:01:51][Step 1/3] Using rspec-mocks (3.0.0)
[14:01:51][Step 1/3] Using rspec (3.0.0)
[14:01:51][Step 1/3] Using rspec-puppet (1.0.1) from https://github.com/rodjek/rspec-puppet.git (at master)
[14:01:51][Step 1/3] Using puppetlabs_spec_helper (0.3.0)
[14:01:51][Step 1/3] Using test-unit (2.5.5)
[14:01:51][Step 1/3] Using bundler (1.3.5)
[14:01:51][Step 1/3] Your bundle is updated!
[14:01:51][Step 1/3] bundle exec rake test
[14:01:52][Step 1/3] cd modules/(module_name) && rake test
[14:01:52][Step 1/3] Initialized empty Git repository in /(path)/spec/fixtures/modules/concat/.git/
[14:01:52][Step 1/3] Initialized empty Git repository in /(path)/spec/fixtures/modules/stdlib/.git/
[14:01:53][Step 1/3] /usr/bin/ruby -I/(path)/vendor/ruby/1.8/gems/rspec-core-3.0.0/lib:/(path)/vendor/ruby/1.8/gems/rspec-support-3.0.0/lib -S /(path)/vendor/ruby/1.8/gems/rspec-core-3.0.0/exe/rspec spec/classes/(class_name)_spec.rb --color
[14:01:55][Step 1/3] FFFFFFFFFFFFFFFFFFFFF
[14:01:55][Step 1/3]
[14:01:55][Step 1/3] Deprecation Warnings:
[14:01:55][Step 1/3]
[14:01:55][Step 1/3] --------------------------------------------------------------------------------
[14:01:55][Step 1/3] RSpec::Puppet::ManifestMatchers::CreateGeneric implements a legacy RSpec matcher
[14:01:55][Step 1/3] protocol. For the current protocol you should expose the failure messages
[14:01:55][Step 1/3] via the failure_message and failure_message_when_negated methods.
[14:01:55][Step 1/3](Used from /%28path%29/spec/classes/%28class_name%29_spec.rb:11)
[14:01:55][Step 1/3] --------------------------------------------------------------------------------
[14:01:55][Step 1/3] --------------------------------------------------------------------------------
[14:01:55][Step 1/3] RSpec::Puppet::ManifestMatchers::CreateGeneric implements a legacy RSpec matcher
[14:01:55][Step 1/3] protocol. For the current protocol you should expose the failure messages
[14:01:55][Step 1/3] via the failure_message and failure_message_when_negated methods.
[14:01:55][Step 1/3](Used from /%28path%29/spec/classes/%28class_name%29_spec.rb:12)
[14:01:55][Step 1/3] --------------------------------------------------------------------------------
[14:01:55][Step 1/3] --------------------------------------------------------------------------------
[14:01:55][Step 1/3] RSpec::Puppet::ManifestMatchers::CreateGeneric implements a legacy RSpec matcher
[14:01:55][Step 1/3] protocol. For the current protocol you should expose the failure messages
[14:01:55][Step 1/3] via the failure_message and failure_message_when_negated methods.
[14:01:55][Step 1/3](Used from /%28path%29/spec/classes/%28class_name%29_spec.rb:13)
[14:01:55][Step 1/3] --------------------------------------------------------------------------------
[14:01:55][Step 1/3] Too many similar deprecation messages reported, disregarding further reports. Pass --deprecation-out or set config.deprecation_stream to a file for full output.
[14:01:55][Step 1/3]
[14:01:55][Step 1/3] The :example_group key in an example group's metadata hash is deprecated. Use the example group's hash directly for the computed keys and :parent_example_group to access the parent example group metadata instead. Called from /(path)/spec/classes/(class_name)_spec.rb:7.
[14:01:55][Step 1/3] The :example_group key in an example group's metadata hash is deprecated. Use the example group's hash directly for the computed keys and :parent_example_group to access the parent example group metadata instead. Called from /(path)/spec/classes/(class_name)_spec.rb:8.
[14:01:55][Step 1/3]
[14:01:55][Step 1/3]
[14:01:55][Step 1/3] If you need more of the backtrace for any of these deprecations to
[14:01:55][Step 1/3] identify where to make the necessary changes, you can configure
[14:01:55][Step 1/3] config.raise_errors_for_deprecations!, and it will turn the
[14:01:55][Step 1/3] deprecation warnings into errors, giving you the full backtrace.
[14:01:55][Step 1/3]
[14:01:55][Step 1/3] Failures:
[14:01:55][Step 1/3]
[14:01:55][Step 1/3] 1) (class) with hiera config on RedHat should contain Class[(class)]
[14:01:55][Step 1/3] Failure/Error: it { should contain_class('(class)') }
[14:01:55][Step 1/3] NoMethodError:
[14:01:55][Step 1/3] undefined method `display_name' for RSpec::ExampleGroups::(Class)::WithHieraConfigOnRedHat:Class
[14:01:55][Step 1/3] # ./spec/classes/(class)_spec.rb:11
[14:01:55][Step 1/3]

Solution:

in Gemfile:

gem 'rspec', '<3.0.0'

@tuxmea tuxmea changed the title rspec3 breaks rspec-puppet rspec3 breaks rspec-puppet - undefined method `display_name' for RSpec::ExampleGroups Jun 2, 2014
treydock added a commit to treydock/rspec-puppet that referenced this issue Jun 2, 2014
* Fix deprecation warnings related to 'display_name', fixes rodjek#198
@miguno
Copy link

miguno commented Jun 4, 2014

I can confirm the issue.

@arioch
Copy link

arioch commented Jun 10, 2014

+1

thomasvandoren added a commit to thomasvandoren/puppet-redis that referenced this issue Jun 18, 2014
At least until this is fixed: rodjek/rspec-puppet#198
samjsharpe pushed a commit to alphagov/puppet-graphite that referenced this issue Jun 30, 2014
This pulls in some changes proposed in #23, changes things slightly to
use the `params.pp` class, adds tests and puppetdoc.

I've also locked the rspec version at <3.0.0 because the 3.0.0 version
has broken rspec-puppet and that's what I get installed when I try to
bundle this repo. See rodjek/rspec-puppet#198

Closes #23.
samjsharpe pushed a commit to alphagov/puppet-graphite that referenced this issue Jun 30, 2014
This pulls in some changes proposed in #23, changes things slightly to
use the `params.pp` class, adds tests and puppetdoc.

I've also locked the rspec version at <3.0.0 because the 3.0.0 version
has broken rspec-puppet and that's what I get installed when I try to
bundle this repo. See rodjek/rspec-puppet#198

Closes #23.
samjsharpe pushed a commit to alphagov/puppet-graphite that referenced this issue Jun 30, 2014
This pulls in some changes proposed in #23, changes things slightly to
use the `params.pp` class, adds tests and puppetdoc.

I've also locked the rspec version at <3.0.0 because the 3.0.0 version
has broken rspec-puppet and that's what I get installed when I try to
bundle this repo. See rodjek/rspec-puppet#198

Closes #23.
javiplx pushed a commit to javiplx/rspec-puppet that referenced this issue Aug 4, 2014
* Fix deprecation warnings related to 'display_name', fixes rodjek#198
javiplx pushed a commit to javiplx/rspec-puppet that referenced this issue Aug 4, 2014
* Fix deprecation warnings related to 'display_name', fixes rodjek#198
@miguno
Copy link

miguno commented Aug 8, 2014

Any updates on this issue?

@plouc
Copy link

plouc commented Aug 13, 2014

+1

@rodjek rodjek added this to the 2.0.0 milestone Sep 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants