[DRE-commits] [ruby-rspec-instafail] 47/108: fix for rspec 2.2

Hideki Yamane henrich at moszumanska.debian.org
Sun Nov 15 18:36:18 UTC 2015


This is an automated email from the git hooks/post-receive script.

henrich pushed a commit to branch debian/sid
in repository ruby-rspec-instafail.

commit b9e6653259822b982b93d6af462aaa052c6dd00c
Author: grosser <grosser.michael at gmail.com>
Date:   Mon Nov 29 21:19:44 2010 +0100

    fix for rspec 2.2
---
 lib/rspec/instafail.rb         |  2 +-
 lib/rspec/instafail/rspec_2.rb |  5 ++++-
 spec/rspec_2/Gemfile           |  2 +-
 spec/rspec_2/Gemfile.lock      | 20 +++++++++-----------
 4 files changed, 15 insertions(+), 14 deletions(-)

diff --git a/lib/rspec/instafail.rb b/lib/rspec/instafail.rb
index afa5e85..3819f71 100644
--- a/lib/rspec/instafail.rb
+++ b/lib/rspec/instafail.rb
@@ -1,7 +1,7 @@
 module RSpec
   begin
     require 'rspec/instafail/rspec_2'
-  rescue LoadError => try_rspec_1
+  rescue LoadError # try rspec 1
     require 'rspec/instafail/rspec_1'
   end
 
diff --git a/lib/rspec/instafail/rspec_2.rb b/lib/rspec/instafail/rspec_2.rb
index 33c4ef3..f0f444b 100644
--- a/lib/rspec/instafail/rspec_2.rb
+++ b/lib/rspec/instafail/rspec_2.rb
@@ -5,7 +5,10 @@ module RSpec
     def example_failed(example)
       @counter ||= 0
       @counter += 1
-      exception = example.metadata[:execution_result][:exception_encountered]
+
+      result = example.metadata[:execution_result]
+
+      exception = result[:exception_encountered] || result[:exception] # rspec 2.0 || rspec 2.2
       short_padding = '  '
       padding = '     '
       output.puts
diff --git a/spec/rspec_2/Gemfile b/spec/rspec_2/Gemfile
index bf3ee9f..9edf720 100644
--- a/spec/rspec_2/Gemfile
+++ b/spec/rspec_2/Gemfile
@@ -1,2 +1,2 @@
 source 'http://rubygems.org'
-gem 'rspec', '>=2'
+gem 'rspec', '>=2.2'
diff --git a/spec/rspec_2/Gemfile.lock b/spec/rspec_2/Gemfile.lock
index 4904ac1..725a692 100644
--- a/spec/rspec_2/Gemfile.lock
+++ b/spec/rspec_2/Gemfile.lock
@@ -2,19 +2,17 @@ GEM
   remote: http://rubygems.org/
   specs:
     diff-lcs (1.1.2)
-    rspec (2.0.1)
-      rspec-core (~> 2.0.1)
-      rspec-expectations (~> 2.0.1)
-      rspec-mocks (~> 2.0.1)
-    rspec-core (2.0.1)
-    rspec-expectations (2.0.1)
-      diff-lcs (>= 1.1.2)
-    rspec-mocks (2.0.1)
-      rspec-core (~> 2.0.1)
-      rspec-expectations (~> 2.0.1)
+    rspec (2.2.0)
+      rspec-core (~> 2.2)
+      rspec-expectations (~> 2.2)
+      rspec-mocks (~> 2.2)
+    rspec-core (2.2.1)
+    rspec-expectations (2.2.0)
+      diff-lcs (~> 1.1.2)
+    rspec-mocks (2.2.0)
 
 PLATFORMS
   ruby
 
 DEPENDENCIES
-  rspec (>= 2)
+  rspec (>= 2.2)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/ruby-rspec-instafail.git



More information about the Pkg-ruby-extras-commits mailing list