From 917d9b65365125d8b1a813beb291d3f0c5a66b92 Mon Sep 17 00:00:00 2001 From: Hailee Kenney Date: Thu, 2 Jul 2015 14:08:41 -0700 Subject: [PATCH] (maint) Remove html-matchers dependency Prior to this commit, some of the unit tests for strings relied on the rspec-html-matchers gem, which does not seem to get along with rspec 3. This meant that we had to tie our tests to rspec 2 which has become too inconvenient. In order to remove the gem, use simple string matching instead. Update the Gemfile so that it no longer requires the matchers and no longer has rspec tied to 2.7. --- Gemfile | 3 +-- spec/unit/puppet/face_spec.rb | 7 +++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/Gemfile b/Gemfile index 38a0a2a..63148a3 100644 --- a/Gemfile +++ b/Gemfile @@ -14,10 +14,9 @@ else end group :test do - gem "rspec", "~> 2.14.1", :require => false + gem "rspec" gem 'mocha' gem 'puppetlabs_spec_helper' - gem 'rspec-html-matchers' gem 'serverspec' gem 'beaker' gem 'beaker-rspec' diff --git a/spec/unit/puppet/face_spec.rb b/spec/unit/puppet/face_spec.rb index e8024ec..03aad0d 100644 --- a/spec/unit/puppet/face_spec.rb +++ b/spec/unit/puppet/face_spec.rb @@ -1,6 +1,5 @@ require 'spec_helper' require 'puppet/face/strings' -require 'rspec-html-matchers' require 'tmpdir' require 'stringio' @@ -41,7 +40,7 @@ describe Puppet::Face do Puppet::Face[:strings, :current].yardoc - expect(read_html(tmp, 'test', 'test.html')).to have_tag('.docstring .discussion', :text => /This class/) + expect(read_html(tmp, 'test', 'test.html')).to include("Class: test") end end @@ -51,7 +50,7 @@ describe Puppet::Face do Puppet::Face[:strings, :current].yardoc - expect(read_html(tmp, 'test', 'Puppet3xFunctions.html')).to have_tag('.docstring .discussion', :text => /documentation for `function3x`/) + expect(read_html(tmp, 'test', 'Puppet3xFunctions.html')).to include("This is the function documentation for `function3x`") end end @@ -61,7 +60,7 @@ describe Puppet::Face do Puppet::Face[:strings, :current].yardoc - expect(read_html(tmp, 'test', 'Puppet4xFunctions.html')).to have_tag('.docstring .discussion', :text => /This is a function/) + expect(read_html(tmp, 'test', 'Puppet4xFunctions.html')).to include("This is a function which is used to test puppet strings") end end end