...
 
Commits (168)
language: ruby
cache: bundler
rvm: 2.3.1
source "https://rubygems.org"
gemspec
gem "bump"
gem "rake"
PATH
remote: .
specs:
rspec-instafail (1.0.0)
rspec
GEM
remote: https://rubygems.org/
specs:
bump (0.5.1)
diff-lcs (1.2.5)
rake (10.4.2)
rspec (3.1.0)
rspec-core (~> 3.1.0)
rspec-expectations (~> 3.1.0)
rspec-mocks (~> 3.1.0)
rspec-core (3.1.7)
rspec-support (~> 3.1.0)
rspec-expectations (3.1.2)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.1.0)
rspec-mocks (3.1.3)
rspec-support (~> 3.1.0)
rspec-support (3.1.2)
PLATFORMS
ruby
DEPENDENCIES
bump
rake
rspec-instafail!
BUNDLED WITH
1.12.3
require "bundler/setup"
require "bundler/gem_tasks"
require "bump/tasks"
task :default do
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/instafail_spec.rb"
end
# rspec-instafail
[![Gem Version](https://badge.fury.io/rb/rspec-instafail.svg)](https://rubygems.org/gems/rspec-instafail)
[![Build Status](https://travis-ci.org/grosser/rspec-instafail.svg)](https://travis-ci.org/grosser/rspec-instafail)
Show failing specs instantly. Show passing spec as green dots as usual.
Output
======
```
....................................................*....
1) ApplicationController#sign_out_and_redirect with JSON should return JSON indicating success
Failure/Error: json_response = JSON.parse response.body
A JSON text must at least contain two octets!
# /Users/miwillhite/.rvm/gems/ruby-1.9.2-p0/gems/json_pure-1.4.6/lib/json/common.rb:146:in `initialize'
# /Users/miwillhite/.rvm/gems/ruby-1.9.2-p0/gems/json_pure-1.4.6/lib/json/common.rb:146:in `new'
# /Users/miwillhite/.rvm/gems/ruby-1.9.2-p0/gems/json_pure-1.4.6/lib/json/common.rb:146:in `parse'
# ./spec/controllers/application_controller_spec.rb:17:in `block (4 levels) in <top (required)>'
..................................................................
Finished in 650.095614 seconds
1680 examples, 1 failure, 1 pending
```
Install
=======
```Bash
gem install rspec-instafail
# .rspec
--require rspec/instafail
--format RSpec::Instafail
--format progress # to keep dots appear
```
Alternatives
============
Use built-in `--fail-fast`
Authors
=======
### [Contributors](http://github.com/grosser/rspec-instafail/contributors)
- [Matthew Willhite](http://github.com/miwillhite)
- [Jeff Kreeftmeijer](http://jeffkreeftmeijer.com)
- [Steve Tooke](http://tooky.github.com)
- [Josh Ellithorpe](https://github.com/zquestz)
- [Raphael Sofaer](https://github.com/rsofaer)
- [Mike Mazur](https://github.com/mikem)
- [vernonR2](https://github.com/vernonR2)
- [Olek Janiszewski](https://github.com/exviva)
- [Kevin Carter](https://github.com/DexterTheDragon)
[Michael Grosser](http://grosser.it)<br/>
michael@grosser.it<br/>
License: MIT
ruby-rspec-instafail (1.0.0-5) unstable; urgency=medium
[ Utkarsh Gupta ]
* Add salsa-ci.yml
[ Hideki Yamane ]
* debian/control
- use dh12
- add Rules-Requires-Root: no
- set Standards-Version: 4.4.0
* debian/salsa-ci.yml
- disable unnecessary tests
-- Hideki Yamane <henrich@debian.org> Sun, 22 Sep 2019 01:07:45 +0900
ruby-rspec-instafail (1.0.0-4) unstable; urgency=medium
* debian/patches
- add 0001-do-not-use-git-command.patch to fix test failure with git
* debian/control
- fix dependency
* debian/ruby-tests.rb
- wrote it
-- Hideki Yamane <henrich@debian.org> Sun, 16 Dec 2018 18:16:01 +0900
ruby-rspec-instafail (1.0.0-3) unstable; urgency=medium
* debian/control
- move Vcs-* to salsa.debian.org
- set Standards-Version: 4.2.1
- drop deprecated "Depends: ruby-interpreter"
- add Testsuite: autopkgtest-pkg-ruby
* use dh11
* debian/copyright
-use https
- update copyright year
* debian/watch
- update to use gemwatch.debian.net
-- Hideki Yamane <henrich@debian.org> Sun, 14 Oct 2018 03:29:46 +0900
ruby-rspec-instafail (1.0.0-2) unstable; urgency=medium
* debian/control
- fix Vcs-Git URI
-- Hideki Yamane <henrich@debian.org> Sun, 05 Jun 2016 12:08:12 +0900
ruby-rspec-instafail (1.0.0-1) unstable; urgency=medium
* New upstream release
* debian/control
- set Standards-Version: 3.9.8
- use https for Vcs-Git
- Bump up debhelper version 9
* debian/compat
- set 9
-- Hideki Yamane <henrich@debian.org> Sat, 21 May 2016 22:21:50 +0900
ruby-rspec-instafail (0.4.0-1) unstable; urgency=medium
* New upstream release
* debian/control
- use https, instead of http
* add debian/gbp.conf
-- Hideki Yamane <henrich@debian.org> Mon, 16 Nov 2015 03:30:11 +0900
ruby-rspec-instafail (0.2.6-1) unstable; urgency=medium
* Imported Upstream version 0.2.6
* debian/control
- update Vcs-Browser
- set Standards-Version: 3.9.6
-- Hideki Yamane <henrich@debian.org> Sat, 30 May 2015 00:03:22 +0900
ruby-rspec-instafail (0.2.5-1) unstable; urgency=low
[ Hideki Yamane ]
* Initial release (Closes: #702666)
-- Pirate Praveen <praveen@debian.org> Wed, 10 Sep 2014 21:26:39 +0530
Source: ruby-rspec-instafail
Section: ruby
Priority: optional
Maintainer: Debian Ruby Extras Maintainers <pkg-ruby-extras-maintainers@lists.alioth.debian.org>
Uploaders: Hideki Yamane <henrich@debian.org>, Pirate Praveen <praveen@debian.org>
Build-Depends: debhelper-compat (= 12), gem2deb (>= 0.3.0~), rake, ruby-rspec,
Standards-Version: 4.4.0
Vcs-Git: https://salsa.debian.org/ruby-team/ruby-rspec-instafail.git
Vcs-Browser: https://salsa.debian.org/ruby-team/ruby-rspec-instafail
Homepage: https://github.com/grosser/rspec-instafail
XS-Ruby-Versions: all
Testsuite: autopkgtest-pkg-ruby
Rules-Requires-Root: no
Package: ruby-rspec-instafail
Architecture: all
XB-Ruby-Versions: ${ruby:Versions}
Depends: ${shlibs:Depends}, ${misc:Depends}, ruby-rspec,
Description: Show failing specs instantly
Show failing specs instantly. Show passing spec as green dots as usual.
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: rspec-instafail
Source: https://github.com/grosser/rspec-instafail
Files: *
Copyright: 2010-2012 Michael Grosser <michael@grosser.it>
Matthew Willhite (http://github.com/miwillhite)
Jeff Kreeftmeijer (http://jeffkreeftmeijer.com)
Steve Tooke (http://tooky.github.com)
Josh Ellithorpe (https://github.com/zquestz)
Raphael Sofaer (https://github.com/rsofaer)
Mike Mazur (https://github.com/mikem)
vernonR2 (https://github.com/vernonR2)
Olek Janiszewski (https://github.com/exviva)
License: Expat
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Files: debian/*
Copyright: 2013-2018 Hideki Yamane <henrich@debian.org>
License: GPL-2+
This program is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later
version.
.
This program is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the GNU General Public License for more
details.
.
You should have received a copy of the GNU General Public
License along with this package; if not, write to the Free
Software Foundation, Inc., 51 Franklin St, Fifth Floor,
Boston, MA 02110-1301 USA
.
On Debian systems, the full text of the GNU General Public
License version 2 can be found in the file
`/usr/share/common-licenses/GPL-2'.
[DEFAULT]
debian-branch = debian/sid
upstream-tag = v%(version)s
debian-tag = debian/%(version)s
pristine-tar = True
color = auto
[buildpackage]
# Look for a tag matching the upstream version when creating a tarball
upstream-tree = tag
# uncomment this to automatically GPG sign tags:
sign-tags = True
From: Hideki Yamane <henrich@debian.org>
Date: Sun, 16 Dec 2018 17:58:42 +0900
Subject: do not use git command
---
rspec-instafail.gemspec | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/rspec-instafail.gemspec b/rspec-instafail.gemspec
index 9d4c0b7..39243c1 100755
--- a/rspec-instafail.gemspec
+++ b/rspec-instafail.gemspec
@@ -6,7 +6,7 @@ Gem::Specification.new name, RSpec::Instafail::VERSION do |s|
s.authors = ["Michael Grosser"]
s.email = "michael@grosser.it"
s.homepage = "https://github.com/grosser/#{name}"
- s.files = `git ls-files lib Readme.md`.split("\n")
+ s.files = Dir['**/*'].reject { |f| f =~ %r{^debian/} }
s.license = "MIT"
s.add_runtime_dependency "rspec"
end
0001-do-not-use-git-command.patch
require 'gem2deb/rake/spectask'
Gem2Deb::Rake::RSpecTask.new do |spec|
spec.pattern = './spec/**/*_spec.rb'
end
#!/usr/bin/make -f
#export DH_VERBOSE=1
#
# Uncomment to ignore all test failures (but the tests will run anyway)
#export DH_RUBY_IGNORE_TESTS=all
#
# Uncomment to ignore some test failures (but the tests will run anyway).
# Valid values:
#export DH_RUBY_IGNORE_TESTS=ruby1.8 ruby1.9.1 require-rubygems
#
# If you need to specify the .gemspec (eg there is more than one)
#export DH_RUBY_GEMSPEC=gem.gemspec
%:
dh $@ --buildsystem=ruby --with ruby
---
include:
- https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/salsa-ci.yml
- https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/pipeline-jobs.yml
variables:
SALSA_CI_DISABLE_BLHC: 1
SALSA_CI_DISABLE_BUILD_PACKAGE_ANY: 1
version=3
https://gemwatch.debian.net/rspec-instafail .*/rspec-instafail-(.*).tar.gz
module RSpec
gem_spec = Gem::Specification.find_all_by_name('rspec-core').first
if gem_spec
version = gem_spec.version
require "rspec/instafail/rspec_#{[3, version.segments.first].min}"
else
require "rspec/instafail/rspec_1"
end
end
require 'spec/runner/formatter/progress_bar_formatter'
module RSpec
class Instafail < Spec::Runner::Formatter::ProgressBarFormatter
def example_failed(example, counter, failure)
dump_failure(counter, failure)
end
end
end
require 'rspec/core/formatters/progress_formatter'
module RSpec
class Instafail < RSpec::Core::Formatters::ProgressFormatter
def example_failed(example)
# do what BaseFormatter#example_failed would do
@failed_examples << example
# do what BaseTextFormatter#dump_failures would do
index = failed_examples.size - 1
_dump_pending_example(example, index)
dump_backtrace(example)
end
private
def _dump_pending_example(example, index)
if defined? pending_fixed? # > 2.8
if pending_fixed?(example)
dump_pending_fixed(example, index)
else
preserve_size(example.example_group.ancestors) do
dump_failure(example, index)
end
end
else
dump_pending_example_fixed(example, index) || dump_failure(example, index)
end
end
def preserve_size(array)
old = array.size
yield
array.pop if array.size > old
end
end
end
require 'rspec/core/formatters/base_formatter'
module RSpec
class Instafail < RSpec::Core::Formatters::BaseFormatter
RSpec::Core::Formatters.register self, :example_failed
def initialize(output)
super
@failed_examples = []
end
def example_failed(failure)
@failed_examples << failure.example
output.puts failure.fully_formatted(@failed_examples.size)
end
end
end
module RSpec
class Instafail
VERSION = '1.0.0'
end
end
name = 'rspec-instafail'
require './lib/rspec/instafail/version'
Gem::Specification.new name, RSpec::Instafail::VERSION do |s|
s.summary = "Show failing specs instantly"
s.authors = ["Michael Grosser"]
s.email = "michael@grosser.it"
s.homepage = "https://github.com/grosser/#{name}"
s.files = `git ls-files lib Readme.md`.split("\n")
s.license = "MIT"
s.add_runtime_dependency "rspec"
end
RSpec.configure do |config|
config.expect_with(:rspec) { |c| c.syntax = :should }
config.mock_with(:rspec) { |c| c.syntax = :should }
end
describe 'RSpec::Instafail' do
context "RSpec 1.x" do
before :all do
Bundler.with_clean_env do
@rspec_result = `cd spec/rspec_1 && bundle exec spec a_test.rb --format RSpec::Instafail`
end
end
before do
@output = @rspec_result.dup
end
it "outputs failures at start of output" do
@output.should =~ /^\s*1\)\s*'x fails logically'/m
end
it 'outputs errors in middle of output' do
@output.should =~ /\.\.\*\s*2\)\s*RuntimeError in 'x raises a simple error'/m
end
it 'outputs the the ending block' do
@output.should =~ /Finished in \d\.\d+ seconds\s*7 examples, 3 failures, 1 pending/
end
end
context 'Rspec 2.x' do
before :all do
Bundler.with_clean_env do
@rspec_result = `cd spec/rspec_2 && bundle exec rspec a_test.rb -I ../../lib --require rspec/instafail --format RSpec::Instafail --no-color --order defined`
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:17')
@output.should_not include('ANCESTORS:18')
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 -I ../../lib --require rspec/instafail --format RSpec::Instafail --format progress --no-color --order defined`
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
source 'https://rubygems.org'
gem 'rspec', '~> 1.3'
GEM
remote: https://rubygems.org/
specs:
rspec (1.3.0)
PLATFORMS
ruby
DEPENDENCIES
rspec (~> 1.3)
require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'lib', 'rspec', 'instafail'))
describe 'x' do
it 'fails logically' do
1.should == 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
end
class ExceptionWrappingException < RuntimeError
attr_accessor :original_exception
end
source 'https://rubygems.org'
gem 'rspec', '~> 2.2'
GEM
remote: https://rubygems.org/
specs:
diff-lcs (1.2.5)
rspec (2.99.0)
rspec-core (~> 2.99.0)
rspec-expectations (~> 2.99.0)
rspec-mocks (~> 2.99.0)
rspec-core (2.99.2)
rspec-expectations (2.99.2)
diff-lcs (>= 1.1.3, < 2.0)
rspec-mocks (2.99.2)
PLATFORMS
ruby
DEPENDENCIES
rspec (~> 2.2)
require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'lib', 'rspec', 'instafail'))
describe 'x' do
it 'fails logically' do
1.should == 2
end
it 'b' do
end
it 'c' do
end
it 'pends' do
skip
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
source 'https://rubygems.org'
gem 'rspec', '~> 3.0'
GEM
remote: https://rubygems.org/
specs:
diff-lcs (1.2.5)
rspec (3.1.0)
rspec-core (~> 3.1.0)
rspec-expectations (~> 3.1.0)
rspec-mocks (~> 3.1.0)
rspec-core (3.1.7)
rspec-support (~> 3.1.0)
rspec-expectations (3.1.2)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.1.0)
rspec-mocks (3.1.3)
rspec-support (~> 3.1.0)
rspec-support (3.1.2)
PLATFORMS
ruby
DEPENDENCIES
rspec (~> 3.0)
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