diff options
| author | Matt Robinson <matt@puppetlabs.com> | 2011-01-03 22:19:41 -0800 |
|---|---|---|
| committer | Nick Lewis <nick@puppetlabs.com> | 2011-01-04 16:01:41 -0800 |
| commit | 52760a4fb2764d011609c82adb68cc61d0772dc4 (patch) | |
| tree | 489df98ee50d6ac6cf01fb905e78bd4864cde2c0 /spec/unit/parser | |
| parent | ac114371fc161a48fc48bf68944846a1defbc6c4 (diff) | |
| download | puppet-52760a4fb2764d011609c82adb68cc61d0772dc4.tar.gz puppet-52760a4fb2764d011609c82adb68cc61d0772dc4.tar.xz puppet-52760a4fb2764d011609c82adb68cc61d0772dc4.zip | |
(#5771) Upgrade rspec to version 2
The biggest change is that we no longer need to monkey patch rspec to
get confine behavior. Describe blocks can now be conditional like
confine used to be. "describe" blocks with "shared => true" are now
"shared_examples_for".
Paired-With: Nick Lewis
Diffstat (limited to 'spec/unit/parser')
| -rwxr-xr-x | spec/unit/parser/collector_spec.rb | 8 | ||||
| -rwxr-xr-x | spec/unit/parser/lexer_spec.rb | 5 |
2 files changed, 5 insertions, 8 deletions
diff --git a/spec/unit/parser/collector_spec.rb b/spec/unit/parser/collector_spec.rb index 908cda63a..4cab26c44 100755 --- a/spec/unit/parser/collector_spec.rb +++ b/spec/unit/parser/collector_spec.rb @@ -263,9 +263,7 @@ describe Puppet::Parser::Collector, "when collecting virtual and catalog resourc end end -describe Puppet::Parser::Collector, "when collecting exported resources" do - confine "Cannot test Rails integration without ActiveRecord" => Puppet.features.rails? - +describe Puppet::Parser::Collector, "when collecting exported resources", :if => Puppet.features.rails? do before do @compiler = Puppet::Parser::Compiler.new(Puppet::Node.new("mynode")) @scope = Puppet::Parser::Scope.new :compiler => @compiler @@ -469,9 +467,7 @@ describe Puppet::Parser::Collector, "when collecting exported resources" do end end -describe Puppet::Parser::Collector, "when building its ActiveRecord query for collecting exported resources" do - confine "Cannot test Rails integration without ActiveRecord" => Puppet.features.rails? - +describe Puppet::Parser::Collector, "when building its ActiveRecord query for collecting exported resources", :if => Puppet.features.rails? do before do @scope = stub 'scope', :host => "myhost", :debug => nil @compiler = mock 'compile' diff --git a/spec/unit/parser/lexer_spec.rb b/spec/unit/parser/lexer_spec.rb index d52add399..860326973 100755 --- a/spec/unit/parser/lexer_spec.rb +++ b/spec/unit/parser/lexer_spec.rb @@ -5,7 +5,7 @@ require File.dirname(__FILE__) + '/../../spec_helper' require 'puppet/parser/lexer' # This is a special matcher to match easily lexer output -Spec::Matchers.define :be_like do |*expected| +RSpec::Matchers.define :be_like do |*expected| match do |actual| expected.zip(actual).all? { |e,a| !e or a[0] == e or (e.is_a? Array and a[0] == e[0] and (a[1] == e[1] or (a[1].is_a?(Hash) and a[1][:value] == e[1]))) } end @@ -651,7 +651,8 @@ describe "Puppet::Parser::Lexer in the old tests" do end end -require 'puppettest/support/utils' +require File.dirname(__FILE__) + '/../../../test/lib/puppettest' +require File.dirname(__FILE__) + '/../../../test/lib/puppettest/support/utils' describe "Puppet::Parser::Lexer in the old tests when lexing example files" do extend PuppetTest::Support::Utils textfiles do |file| |
