[DRE-commits] [ruby-rspec-instafail] 96/126: Imported Upstream version 0.2.5

Hideki Yamane henrich at moszumanska.debian.org
Sun Nov 15 19:15:22 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 38facca4bb989db498011f6af6629d50d5a46106
Author: Praveen Arimbrathodiyil <praveen at debian.org>
Date:   Wed Sep 10 21:19:30 2014 +0530

    Imported Upstream version 0.2.5
---
 Gemfile                           |   6 +++++
 Gemfile.lock                      |  28 ++++++++++++++++++++++
 Rakefile                          |  29 +++++++----------------
 Readme.md                         |   4 +++-
 checksums.yaml.gz                 | Bin 0 -> 270 bytes
 lib/rspec/instafail.rb            |  12 ++++++----
 lib/rspec/instafail/rspec_3.rb    |  18 ++++++++++++++
 lib/rspec/instafail/version.rb    |   2 +-
 metadata.yml                      |  38 ++++++++++++++++++++++--------
 rspec-instafail.gemspec           |   7 ++++--
 spec/instafail_spec.rb            |  38 +++++++++++++++++++++++++++---
 spec/rspec_1/Gemfile              |   2 +-
 spec/rspec_1/Gemfile.lock         |   2 ++
 spec/rspec_2/Gemfile              |   1 +
 spec/rspec_2/Gemfile.lock         |   1 +
 spec/{rspec_1 => rspec_3}/Gemfile |   2 +-
 spec/rspec_3/Gemfile.lock         |  22 +++++++++++++++++
 spec/rspec_3/a_test.rb            |  48 ++++++++++++++++++++++++++++++++++++++
 18 files changed, 216 insertions(+), 44 deletions(-)

diff --git a/Gemfile b/Gemfile
new file mode 100644
index 0000000..4be058e
--- /dev/null
+++ b/Gemfile
@@ -0,0 +1,6 @@
+source "https://rubygems.org"
+
+gemspec
+
+gem "bump"
+gem "rake"
diff --git a/Gemfile.lock b/Gemfile.lock
new file mode 100644
index 0000000..03dedee
--- /dev/null
+++ b/Gemfile.lock
@@ -0,0 +1,28 @@
+PATH
+  remote: .
+  specs:
+    rspec-instafail (0.2.5)
+      rspec
+
+GEM
+  remote: https://rubygems.org/
+  specs:
+    bump (0.4.0)
+    diff-lcs (1.2.5)
+    rake (10.0.3)
+    rspec (2.99.0)
+      rspec-core (~> 2.99.0)
+      rspec-expectations (~> 2.99.0)
+      rspec-mocks (~> 2.99.0)
+    rspec-core (2.99.0)
+    rspec-expectations (2.99.0)
+      diff-lcs (>= 1.1.3, < 2.0)
+    rspec-mocks (2.99.0)
+
+PLATFORMS
+  ruby
+
+DEPENDENCIES
+  bump
+  rake
+  rspec-instafail!
diff --git a/Rakefile b/Rakefile
index f321e31..bb10184 100755
--- a/Rakefile
+++ b/Rakefile
@@ -1,25 +1,12 @@
-require "bundler"
-Bundler::GemHelper.install_tasks
+require "bundler/setup"
+require "bundler/gem_tasks"
+require "bump/tasks"
 
 task :default do
-  sh "cd spec/rspec_1 && (bundle || bundle install) > /dev/null"
-  sh "cd spec/rspec_2 && (bundle || bundle install) > /dev/null"
+  Bundler.with_clean_env do
+    sh "cd spec/rspec_1 && (bundle check || bundle) > /dev/null"
+    sh "cd spec/rspec_2 && (bundle check || bundle) > /dev/null"
+    sh "cd spec/rspec_3 && (bundle check || bundle) > /dev/null"
+  end
   sh "rspec spec/"
 end
-
-rule /^version:bump:.*/ do |t|
-  file = 'lib/rspec/instafail/version.rb'
-
-  sh "git status | grep 'nothing to commit'" # ensure we are not dirty
-  index = ['major', 'minor','patch'].index(t.name.split(':').last)
-
-  version_file = File.read(file)
-  old_version, *version_parts = version_file.match(/(\d+)\.(\d+)\.(\d+)/).to_a
-  version_parts[index] = version_parts[index].to_i + 1
-  version_parts[2] = 0 if index < 2
-  version_parts[1] = 0 if index < 1
-  new_version = version_parts * '.'
-  File.open(file,'w'){|f| f.write(version_file.sub(old_version, new_version)) }
-
-  sh "git add #{file} && git commit -m 'bump version to #{new_version}'"
-end
diff --git a/Readme.md b/Readme.md
index 179d34d..61f467c 100755
--- a/Readme.md
+++ b/Readme.md
@@ -49,4 +49,6 @@ Authors
 
 [Michael Grosser](http://grosser.it)<br/>
 michael at grosser.it<br/>
-License: MIT
+License: MIT<br/>
+[![Build Status](https://travis-ci.org/grosser/rspec-instafail.png)](https://travis-ci.org/grosser/rspec-instafail)
+
diff --git a/checksums.yaml.gz b/checksums.yaml.gz
new file mode 100644
index 0000000..7a949c7
Binary files /dev/null and b/checksums.yaml.gz differ
diff --git a/lib/rspec/instafail.rb b/lib/rspec/instafail.rb
index 68fba41..05145a8 100755
--- a/lib/rspec/instafail.rb
+++ b/lib/rspec/instafail.rb
@@ -4,10 +4,14 @@ module RSpec
   lib = File.expand_path(File.dirname(File.dirname(__FILE__)))
   $LOAD_PATH << lib unless $LOAD_PATH.include?(lib)
 
-  begin
-    require "rspec/instafail/rspec_2"
-  rescue LoadError # try rspec 1
-    require "rspec/instafail/rspec_1"
+  if defined?(::RSpec::Core) && ::RSpec::Core::Version::STRING >= '3.0.0'
+    require "rspec/instafail/rspec_3"
+  else
+    begin
+      require "rspec/instafail/rspec_2"
+    rescue LoadError # try rspec 1
+      require "rspec/instafail/rspec_1"
+    end
   end
 
   require 'rspec/instafail/version'
diff --git a/lib/rspec/instafail/rspec_3.rb b/lib/rspec/instafail/rspec_3.rb
new file mode 100755
index 0000000..93321ee
--- /dev/null
+++ b/lib/rspec/instafail/rspec_3.rb
@@ -0,0 +1,18 @@
+require 'rspec/core/formatters/progress_formatter'
+
+module RSpec
+  class Instafail < RSpec::Core::Formatters::ProgressFormatter
+    RSpec::Core::Formatters.register self, :example_failed
+
+    def initialize(output)
+      super
+      @output = output
+      @failed_examples = []
+    end
+
+    def example_failed(failure)
+      @failed_examples << failure.example
+      @output.puts failure.fully_formatted(@failed_examples.size)
+    end
+  end
+end
diff --git a/lib/rspec/instafail/version.rb b/lib/rspec/instafail/version.rb
index 9885290..8553c56 100755
--- a/lib/rspec/instafail/version.rb
+++ b/lib/rspec/instafail/version.rb
@@ -1,2 +1,2 @@
 require 'rspec/instafail'
-RSpec::Instafail::VERSION = '0.2.4'
+RSpec::Instafail::VERSION = '0.2.5'
diff --git a/metadata.yml b/metadata.yml
index 0dcb2b1..144c177 100644
--- a/metadata.yml
+++ b/metadata.yml
@@ -1,27 +1,43 @@
 --- !ruby/object:Gem::Specification
 name: rspec-instafail
 version: !ruby/object:Gem::Version
-  version: 0.2.4
-  prerelease: 
+  version: 0.2.5
 platform: ruby
 authors:
 - Michael Grosser
 autorequire: 
 bindir: bin
 cert_chain: []
-date: 2012-03-27 00:00:00.000000000 Z
-dependencies: []
+date: 2014-06-07 00:00:00.000000000 Z
+dependencies:
+- !ruby/object:Gem::Dependency
+  name: rspec
+  requirement: !ruby/object:Gem::Requirement
+    requirements:
+    - - ">="
+      - !ruby/object:Gem::Version
+        version: '0'
+  type: :runtime
+  prerelease: false
+  version_requirements: !ruby/object:Gem::Requirement
+    requirements:
+    - - ">="
+      - !ruby/object:Gem::Version
+        version: '0'
 description: 
 email: michael at grosser.it
 executables: []
 extensions: []
 extra_rdoc_files: []
 files:
+- Gemfile
+- Gemfile.lock
 - Rakefile
 - Readme.md
 - lib/rspec/instafail.rb
 - lib/rspec/instafail/rspec_1.rb
 - lib/rspec/instafail/rspec_2.rb
+- lib/rspec/instafail/rspec_3.rb
 - lib/rspec/instafail/version.rb
 - rspec-instafail.gemspec
 - spec/instafail_spec.rb
@@ -31,29 +47,31 @@ files:
 - spec/rspec_2/Gemfile
 - spec/rspec_2/Gemfile.lock
 - spec/rspec_2/a_test.rb
+- spec/rspec_3/Gemfile
+- spec/rspec_3/Gemfile.lock
+- spec/rspec_3/a_test.rb
 homepage: http://github.com/grosser/rspec-instafail
 licenses:
 - MIT
+metadata: {}
 post_install_message: 
 rdoc_options: []
 require_paths:
 - lib
 required_ruby_version: !ruby/object:Gem::Requirement
-  none: false
   requirements:
-  - - ! '>='
+  - - ">="
     - !ruby/object:Gem::Version
       version: '0'
 required_rubygems_version: !ruby/object:Gem::Requirement
-  none: false
   requirements:
-  - - ! '>='
+  - - ">="
     - !ruby/object:Gem::Version
       version: '0'
 requirements: []
 rubyforge_project: 
-rubygems_version: 1.8.15
+rubygems_version: 2.2.2
 signing_key: 
-specification_version: 3
+specification_version: 4
 summary: Show failing specs instantly
 test_files: []
diff --git a/rspec-instafail.gemspec b/rspec-instafail.gemspec
index d02b261..f7b7f0f 100755
--- a/rspec-instafail.gemspec
+++ b/rspec-instafail.gemspec
@@ -1,12 +1,15 @@
 $LOAD_PATH.unshift File.expand_path('../lib', __FILE__)
 name = 'rspec-instafail'
-require "rspec/instafail/version"
 
-Gem::Specification.new name, RSpec::Instafail::VERSION do |s|
+# needs rspec installed to load the version, so let's avoid this mess
+version = File.read("lib/rspec/instafail/version.rb")[/\d+\.\d+\.\d+/]
+
+Gem::Specification.new name, version do |s|
   s.summary = "Show failing specs instantly"
   s.authors = ["Michael Grosser"]
   s.email = "michael at grosser.it"
   s.homepage = "http://github.com/grosser/#{name}"
   s.files = `git ls-files`.split("\n")
   s.license = "MIT"
+  s.add_runtime_dependency "rspec"
 end
diff --git a/spec/instafail_spec.rb b/spec/instafail_spec.rb
index bd3c7d9..075b402 100755
--- a/spec/instafail_spec.rb
+++ b/spec/instafail_spec.rb
@@ -1,7 +1,9 @@
 describe 'RSpec::Instafail' do
   context "RSpec 1.x" do
     before :all do
-      @rspec_result = `cd spec/rspec_1 && bundle exec spec a_test.rb --format RSpec::Instafail`
+      Bundler.with_clean_env do
+        @rspec_result = `cd spec/rspec_1 && bundle exec spec a_test.rb --format RSpec::Instafail`
+      end
     end
 
     before do
@@ -23,7 +25,9 @@ describe 'RSpec::Instafail' do
 
   context 'Rspec 2.x' do
     before :all do
-      @rspec_result = `cd spec/rspec_2 && bundle exec rspec a_test.rb --require ../../lib/rspec/instafail --format RSpec::Instafail --no-color`
+      Bundler.with_clean_env do
+        @rspec_result = `cd spec/rspec_2 && bundle exec rspec a_test.rb --require ../../lib/rspec/instafail --format RSpec::Instafail --no-color --order default`
+      end
     end
 
     before do
@@ -47,5 +51,33 @@ describe 'RSpec::Instafail' do
       @output.should_not include('ANCESTORS:3')
     end
   end
-end
 
+  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 --require ../../lib/rspec/instafail --format RSpec::Instafail --no-color --order default`
+      end
+    end
+
+    before do
+      @output = @rspec_result.dup
+    end
+
+    it "outputs failures at start of output" do
+      @output.should =~ /^\s+1\) x fails logically/m
+    end
+
+    it 'outputs errors in middle of output' do
+      @output.should =~ /\.\.\*\s*2\) x raises a simple error/m
+    end
+
+    it 'outputs the the ending block' do
+      @output.should =~ /Finished in \d\.\d+ seconds.*\s*9 examples, 4 failures, 1 pending/
+    end
+
+    it "does not add ancestors after failures" do
+      @output.should include('ANCESTORS:18')
+      @output.should_not include('ANCESTORS:19')
+    end
+  end
+end
diff --git a/spec/rspec_1/Gemfile b/spec/rspec_1/Gemfile
index 9d42535..62e5cf9 100755
--- a/spec/rspec_1/Gemfile
+++ b/spec/rspec_1/Gemfile
@@ -1,2 +1,2 @@
 source 'http://rubygems.org'
-gem 'rspec', '1.3.0'
\ No newline at end of file
+gem 'rspec', '1.3.0'
diff --git a/spec/rspec_1/Gemfile.lock b/spec/rspec_1/Gemfile.lock
index a0bcbcb..31d4126 100755
--- a/spec/rspec_1/Gemfile.lock
+++ b/spec/rspec_1/Gemfile.lock
@@ -1,10 +1,12 @@
 GEM
   remote: http://rubygems.org/
   specs:
+    diff-lcs (1.1.3)
     rspec (1.3.0)
 
 PLATFORMS
   ruby
 
 DEPENDENCIES
+  diff-lcs (= 1.1.3)
   rspec (= 1.3.0)
diff --git a/spec/rspec_2/Gemfile b/spec/rspec_2/Gemfile
index 9edf720..fbe4f90 100755
--- a/spec/rspec_2/Gemfile
+++ b/spec/rspec_2/Gemfile
@@ -1,2 +1,3 @@
 source 'http://rubygems.org'
 gem 'rspec', '>=2.2'
+
diff --git a/spec/rspec_2/Gemfile.lock b/spec/rspec_2/Gemfile.lock
index b68cba3..415bffa 100755
--- a/spec/rspec_2/Gemfile.lock
+++ b/spec/rspec_2/Gemfile.lock
@@ -15,4 +15,5 @@ PLATFORMS
   ruby
 
 DEPENDENCIES
+  diff-lcs (= 1.1.3)
   rspec (>= 2.2)
diff --git a/spec/rspec_1/Gemfile b/spec/rspec_3/Gemfile
similarity index 58%
copy from spec/rspec_1/Gemfile
copy to spec/rspec_3/Gemfile
index 9d42535..d4e4e53 100755
--- a/spec/rspec_1/Gemfile
+++ b/spec/rspec_3/Gemfile
@@ -1,2 +1,2 @@
 source 'http://rubygems.org'
-gem 'rspec', '1.3.0'
\ No newline at end of file
+gem 'rspec', '>=3.0'
diff --git a/spec/rspec_3/Gemfile.lock b/spec/rspec_3/Gemfile.lock
new file mode 100755
index 0000000..f261f70
--- /dev/null
+++ b/spec/rspec_3/Gemfile.lock
@@ -0,0 +1,22 @@
+GEM
+  remote: http://rubygems.org/
+  specs:
+    diff-lcs (1.2.5)
+    rspec (3.0.0)
+      rspec-core (~> 3.0.0)
+      rspec-expectations (~> 3.0.0)
+      rspec-mocks (~> 3.0.0)
+    rspec-core (3.0.0)
+      rspec-support (~> 3.0.0)
+    rspec-expectations (3.0.0)
+      diff-lcs (>= 1.2.0, < 2.0)
+      rspec-support (~> 3.0.0)
+    rspec-mocks (3.0.0)
+      rspec-support (~> 3.0.0)
+    rspec-support (3.0.0)
+
+PLATFORMS
+  ruby
+
+DEPENDENCIES
+  rspec (>= 3.0)
diff --git a/spec/rspec_3/a_test.rb b/spec/rspec_3/a_test.rb
new file mode 100755
index 0000000..6eabea2
--- /dev/null
+++ b/spec/rspec_3/a_test.rb
@@ -0,0 +1,48 @@
+require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'lib', 'rspec', 'instafail'))
+
+describe 'x' do
+  it 'fails logically' do
+    expect(1).to eq 2
+  end
+
+  it 'b' do
+  end
+
+  it 'c' do
+  end
+
+  it 'pends' do
+    pending
+    raise
+  end
+
+  it 'raises a simple error' do
+    raise 'shallow failure'
+  end
+
+  it 'raises a hidden error' do
+    error = ExceptionWrappingException.new('There is an error in this error.')
+    error.original_exception = RuntimeError.new('There is no error in this error.')
+    raise error
+  end
+
+  it 'e' do
+  end
+
+  context "ancestors" do
+    after do |example|
+      puts "ANCESTORS:#{example.example_group.ancestors.size}"
+    end
+
+    it "does not add ancestors on failure" do
+      raise "BAM"
+    end
+
+    it "does not add ancestors on failure" do
+    end
+  end
+end
+
+class ExceptionWrappingException < RuntimeError
+  attr_accessor :original_exception
+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