rspec-instafail 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Rakefile +1 -1
- data/VERSION +1 -1
- data/lib/rspec/instafail.rb +0 -4
- data/rspec-instafail.gemspec +2 -2
- data/spec/instafail_spec.rb +74 -5
- metadata +3 -3
data/Rakefile
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.2
|
data/lib/rspec/instafail.rb
CHANGED
@@ -34,20 +34,16 @@ module RSpec
|
|
34
34
|
def example_failed(example)
|
35
35
|
@counter ||= 0
|
36
36
|
@counter += 1
|
37
|
-
|
38
37
|
exception = example.metadata[:execution_result][:exception_encountered]
|
39
38
|
short_padding = ' '
|
40
39
|
padding = ' '
|
41
|
-
|
42
40
|
output.puts
|
43
41
|
output.puts "#{short_padding}#{@counter}) #{example.full_description}"
|
44
42
|
output.puts "#{padding}#{red("Failure/Error:")} #{red(read_failed_line(exception, example).strip)}"
|
45
43
|
output.puts "#{padding}#{red(exception)}"
|
46
|
-
|
47
44
|
format_backtrace(exception.backtrace, example).each do |backtrace_info|
|
48
45
|
output.puts grey("#{padding}# #{backtrace_info}")
|
49
46
|
end
|
50
|
-
|
51
47
|
output.flush
|
52
48
|
end
|
53
49
|
end
|
data/rspec-instafail.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{rspec-instafail}
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.2"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Michael Grosser"]
|
12
|
-
s.date = %q{2010-
|
12
|
+
s.date = %q{2010-11-01}
|
13
13
|
s.email = %q{grosser.michael@gmail.com}
|
14
14
|
s.files = [
|
15
15
|
"Rakefile",
|
data/spec/instafail_spec.rb
CHANGED
@@ -1,13 +1,82 @@
|
|
1
1
|
describe 'RSpec::Instafail' do
|
2
2
|
it "works correctly with RSpec 1.x" do
|
3
3
|
output = `cd spec/rspec_1 && bundle exec spec a_test.rb --format RSpec::Instafail`
|
4
|
-
|
5
|
-
|
4
|
+
expected_output = <<EXP
|
5
|
+
1\\) x a
|
6
|
+
expected: 2,
|
7
|
+
got: 1 \\(using ==\\)
|
8
|
+
# \\.\\/a_test\\.rb:5:
|
9
|
+
\\.\\.\\*\\.
|
10
|
+
|
11
|
+
Pending:
|
12
|
+
|
13
|
+
x d \\(TODO\\)
|
14
|
+
\\.\\/a_test\\.rb:14
|
15
|
+
|
16
|
+
1\\)
|
17
|
+
'x a' FAILED
|
18
|
+
expected: 2,
|
19
|
+
got: 1 \\(using ==\\)
|
20
|
+
\\./a_test\\.rb:5:
|
21
|
+
|
22
|
+
Finished in \\d\\.\\d+ seconds
|
23
|
+
|
24
|
+
5 examples, 1 failure, 1 pending
|
25
|
+
EXP
|
26
|
+
|
27
|
+
output.should =~ Regexp.new(expected_output, 'x')
|
28
|
+
|
29
|
+
end
|
30
|
+
|
31
|
+
it "works correctly with RSpec 2.x (but backtrace might be broken)" do
|
32
|
+
output = `cd spec/rspec_2 && bundle exec rspec a_test.rb --require ../../lib/rspec/instafail --format RSpec::Instafail --no-color`
|
33
|
+
expected = <<EXP
|
34
|
+
1\\) x a
|
35
|
+
Failure\\/Error: 1\\.should == 2
|
36
|
+
expected: 2,
|
37
|
+
got: 1 \\(using ==\\)
|
38
|
+
EXP
|
39
|
+
output.should =~ Regexp.new(expected, 'x')
|
40
|
+
|
41
|
+
output.should include('/a_test.rb:5')
|
42
|
+
|
43
|
+
expected = <<EXP
|
44
|
+
\\.\\.\\*\\.
|
45
|
+
|
46
|
+
Pending:
|
47
|
+
x d
|
48
|
+
# No reason given
|
49
|
+
# \\./a_test\\.rb:14
|
50
|
+
|
51
|
+
Finished in \\d\\.\\d+ seconds
|
52
|
+
5 examples, 1 failure, 1 pending
|
53
|
+
EXP
|
54
|
+
output.should =~ Regexp.new(expected, 'x')
|
55
|
+
|
6
56
|
end
|
7
57
|
|
8
58
|
it "works correctly with RSpec 2.x" do
|
59
|
+
pending 'the backtrace for the error is always absolute on my machine'
|
9
60
|
output = `cd spec/rspec_2 && bundle exec rspec a_test.rb --require ../../lib/rspec/instafail --format RSpec::Instafail --no-color`
|
10
|
-
|
11
|
-
|
61
|
+
expected_output = <<EXP
|
62
|
+
1\\) x a
|
63
|
+
Failure\\/Error: 1\\.should == 2
|
64
|
+
expected: 2,
|
65
|
+
got: 1 \\(using ==\\)
|
66
|
+
# \\./a_test\\.rb:5
|
67
|
+
\\.\\.\\*\\.
|
68
|
+
|
69
|
+
Pending:
|
70
|
+
x d
|
71
|
+
# No reason given
|
72
|
+
# \\./a_test\\.rb:14
|
73
|
+
|
74
|
+
Finished in \\d\\.\\d+ seconds
|
75
|
+
5 examples, 1 failure, 1 pending
|
76
|
+
EXP
|
77
|
+
|
78
|
+
output.should =~ Regexp.new(expected_output, 'x')
|
79
|
+
|
12
80
|
end
|
13
|
-
end
|
81
|
+
end
|
82
|
+
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
version: 0.1.
|
8
|
+
- 2
|
9
|
+
version: 0.1.2
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Michael Grosser
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-
|
17
|
+
date: 2010-11-01 00:00:00 +01:00
|
18
18
|
default_executable:
|
19
19
|
dependencies: []
|
20
20
|
|