From 8f0fb511c3c8d780c2196551ae69bd9f394334e4 Mon Sep 17 00:00:00 2001 From: Arthur Neves Date: Sat, 25 Apr 2015 11:47:20 -0400 Subject: [PATCH] Fix warnings for rspec 3 --- spec/spec_helper.rb | 1 - spec/support/match_html_matcher.rb | 4 ++-- spec/support/time_matcher.rb | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 1f650b73be1..672981c922b 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -24,7 +24,6 @@ Spork.prefork do ENV["RAILS_ENV"] ||= 'test' require File.expand_path("../../config/environment", __FILE__) require 'rspec/rails' - require 'rspec/autorun' require 'shoulda' # Requires supporting ruby files with custom matchers and macros, etc, diff --git a/spec/support/match_html_matcher.rb b/spec/support/match_html_matcher.rb index 95e5a922c0d..d40c3cea654 100644 --- a/spec/support/match_html_matcher.rb +++ b/spec/support/match_html_matcher.rb @@ -6,11 +6,11 @@ RSpec::Matchers.define :match_html do |expected| a.eql? b end - failure_message_for_should do |actual| + failure_message do |actual| "after sanitizing for extra white space and compactness, expected:\n#{actual}\n to match:\n#{expected}" end - failure_message_for_should_not do |actual| + failure_message_when_negated do |actual| "after sanitizing for extra white space and compactness, expected:\n#{actual}\n not to match:\n#{expected}" end diff --git a/spec/support/time_matcher.rb b/spec/support/time_matcher.rb index 53d97e5f5c6..eb7ec2d80a2 100644 --- a/spec/support/time_matcher.rb +++ b/spec/support/time_matcher.rb @@ -2,7 +2,7 @@ RSpec::Matchers.define :be_within_one_second_of do |expected_time| match do |actual_time| (actual_time - expected_time).abs < 1 end - failure_message_for_should do |actual_time| + failure_message do |actual_time| "#{actual_time} is not within 1 second of #{expected_time}" end end