[DRE-commits] [ruby-rspec-instafail] 55/126: Spec out current behavior

Hideki Yamane henrich at moszumanska.debian.org
Sun Nov 15 19:15:10 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 e58e029de328d5fdcac9ed2fb4a96b1139c4a740
Author: Raphael Sofaer <raphael at joindiaspora.com>
Date:   Thu Mar 3 10:41:59 2011 -0800

    Spec out current behavior
---
 spec/instafail_spec.rb | 31 ++++++++++++++++++++++++-------
 spec/rspec_2/a_test.rb | 10 ++++++++++
 2 files changed, 34 insertions(+), 7 deletions(-)

diff --git a/spec/instafail_spec.rb b/spec/instafail_spec.rb
index 9d55351..d68db16 100644
--- a/spec/instafail_spec.rb
+++ b/spec/instafail_spec.rb
@@ -30,6 +30,7 @@ EXP
     before do
       @output = @rspec_result.dup
     end
+
     it "outputs logical failures" do
       expected = <<EXP
   1\\) x fails logically
@@ -41,10 +42,28 @@ EXP
 
       @output.should include('/a_test.rb:5')
     end
-    it 'outputs the remaining passing specs and the ending block' do
 
+    it 'outputs a simple error' do
       expected = <<EXP
-\\.\\.\\*\\.
+\\.\\.\\*
+  2\\) x raises a simple error
+     Failure\\/Error: raise 'shallow failure'
+     shallow failure
+EXP
+      @output.should =~ Regexp.new(expected, 'x')
+    end
+
+    it 'outputs an error which responds to original_exception' do
+      expected = <<EXP
+  3\\) x raises a hidden error
+     Failure\\/Error: raise error
+     There is an error in this error.
+EXP
+      @output.should =~ Regexp.new(expected, 'x')
+    end
+    it 'outputs the remaining passing specs and the ending block' do
+      expected = <<EXP
+\\.
 
 Pending:
   x pends
@@ -52,10 +71,10 @@ Pending:
     # \\./a_test\\.rb:14
 
 Finished in \\d\\.\\d+ seconds
-5 examples, 1 failure, 1 pending
+7 examples, 3 failures, 1 pending
 EXP
+      puts @output
       @output.should =~ Regexp.new(expected, 'x')
-
     end
 
     it "works correctly with RSpec 2.x" do
@@ -74,11 +93,9 @@ Pending:
     # \\./a_test\\.rb:14
 
 Finished in \\d\\.\\d+ seconds
-5 examples, 1 failure, 1 pending
+7 examples, 3 failures, 1 pending
 EXP
-
       @output.should =~ Regexp.new(expected_output, 'x')
-
     end
   end
 end
diff --git a/spec/rspec_2/a_test.rb b/spec/rspec_2/a_test.rb
index 04a0934..5b0990d 100644
--- a/spec/rspec_2/a_test.rb
+++ b/spec/rspec_2/a_test.rb
@@ -16,6 +16,16 @@ describe 'x' do
     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

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