[DRE-commits] [ruby-rspec-instafail] 29/108: Adapted specs for new output, also attempted to make them a little more legible
Hideki Yamane
henrich at moszumanska.debian.org
Sun Nov 15 18:36:16 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 c3ad73016f2cd58569eb98a68475f0ab42813c6d
Author: Matt Willhite <matthew.willhite at gmail.com>
Date: Mon Oct 25 21:36:00 2010 -0700
Adapted specs for new output, also attempted to make them a little more legible
---
spec/instafail_spec.rb | 51 +++++++++++++++++++++++++++++++++++++++++++++-----
1 file changed, 46 insertions(+), 5 deletions(-)
diff --git a/spec/instafail_spec.rb b/spec/instafail_spec.rb
index 5e73d0d..50ee95c 100644
--- a/spec/instafail_spec.rb
+++ b/spec/instafail_spec.rb
@@ -1,13 +1,54 @@
describe 'RSpec::Instafail' do
it "works correctly with RSpec 1.x" do
output = `cd spec/rspec_1 && bundle exec spec a_test.rb --format RSpec::Instafail`
- output.should include("1: x a\n -> expected: 2,\n got: 1 (using ==)\n\.\.\*\.")
- output.should =~ /Finished in \d\.\d+ seconds/
+ expected_output = <<EXP
+ 1\\) x a
+ expected: 2,
+ got: 1 \\(using ==\\)
+ # \\.\\/a_test\\.rb:5:
+\\.\\.\\*\\.
+
+Pending:
+
+x d \\(TODO\\)
+\\.\\/a_test\\.rb:14
+
+1\\)
+'x a' FAILED
+expected: 2,
+ got: 1 \\(using ==\\)
+\\./a_test\\.rb:5:
+
+Finished in \\d\\.\\d+ seconds
+
+5 examples, 1 failure, 1 pending
+EXP
+
+ output.should =~ Regexp.new(expected_output, 'x')
+
end
it "works correctly with RSpec 2.x" do
output = `cd spec/rspec_2 && bundle exec rspec a_test.rb --require ../../lib/rspec/instafail --format RSpec::Instafail --no-color`
- output.should =~ /1: x a\n -> expected: 2,\n got: 1 .*\.\.\*\./m
- output.should =~ /Finished in \d\.\d+ seconds/
+ expected_output = <<EXP
+ 1\\) x a
+ Failure\\/Error: 1\\.should == 2
+ expected: 2,
+ got: 1 \\(using ==\\)
+ # \\./a_test\\.rb:5
+\\.\\.\\*\\.
+
+Pending:
+ x d
+ # No reason given
+ # \\./a_test\\.rb:14
+
+Finished in \\d\\.\\d+ seconds
+5 examples, 1 failure, 1 pending
+EXP
+
+ output.should =~ Regexp.new(expected_output, 'x')
+
end
-end
\ No newline at end of file
+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