[DRE-commits] [ruby-rspec-instafail] 06/15: Changed formatter to inherited from BaseFormatter

Hideki Yamane henrich at moszumanska.debian.org
Sat May 21 13:21:40 UTC 2016


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 1dc1a348a1c4a107f9ed26e42786f9b2bd3fa79a
Author: Houssem El Fekih <hfekih at pivotal.io>
Date:   Fri May 20 15:34:58 2016 +0100

    Changed formatter to inherited from BaseFormatter
    
    * This will help to use multiple formatters. I.e. documentation
    * Also fixed rspec_1 support
---
 Readme.md                      | 1 +
 lib/rspec/instafail.rb         | 2 ++
 lib/rspec/instafail/rspec_3.rb | 4 ++--
 spec/instafail_spec.rb         | 2 +-
 4 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/Readme.md b/Readme.md
index e9039ec..286dc45 100755
--- a/Readme.md
+++ b/Readme.md
@@ -34,6 +34,7 @@ gem install rspec-instafail
 # .rspec
 --require rspec/instafail
 --format RSpec::Instafail
+--format progress # to keep dots appear
 ```
 
 Alternatives
diff --git a/lib/rspec/instafail.rb b/lib/rspec/instafail.rb
index 0d38669..05637d0 100755
--- a/lib/rspec/instafail.rb
+++ b/lib/rspec/instafail.rb
@@ -1,4 +1,6 @@
 module RSpec
   version = Gem.loaded_specs["rspec-core"].version
   require "rspec/instafail/rspec_#{[3, version.segments.first].min}"
+rescue
+  require "rspec/instafail/rspec_1"
 end
diff --git a/lib/rspec/instafail/rspec_3.rb b/lib/rspec/instafail/rspec_3.rb
index d062532..137f049 100755
--- a/lib/rspec/instafail/rspec_3.rb
+++ b/lib/rspec/instafail/rspec_3.rb
@@ -1,7 +1,7 @@
-require 'rspec/core/formatters/progress_formatter'
+require 'rspec/core/formatters/base_formatter'
 
 module RSpec
-  class Instafail < RSpec::Core::Formatters::ProgressFormatter
+  class Instafail < RSpec::Core::Formatters::BaseFormatter
     RSpec::Core::Formatters.register self, :example_failed
 
     def initialize(output)
diff --git a/spec/instafail_spec.rb b/spec/instafail_spec.rb
index a4499bf..4adf890 100755
--- a/spec/instafail_spec.rb
+++ b/spec/instafail_spec.rb
@@ -60,7 +60,7 @@ describe 'RSpec::Instafail' do
   context 'Rspec 3.x' do
     before :all do
       Bundler.with_clean_env do
-        @rspec_result = `cd spec/rspec_3 && bundle exec rspec a_test.rb -I ../../lib --require rspec/instafail --format RSpec::Instafail --no-color --order defined`
+        @rspec_result = `cd spec/rspec_3 && bundle exec rspec a_test.rb -I ../../lib --require rspec/instafail --format RSpec::Instafail --format progress --no-color --order defined`
       end
     end
 

-- 
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