Skip to content
This repository was archived by the owner on Nov 30, 2024. It is now read-only.

Commit b6503a2

Browse files
committed
preserve failure message formatting in base text formatter
1 parent ab44fca commit b6503a2

File tree

3 files changed

+23
-2
lines changed

3 files changed

+23
-2
lines changed

lib/rspec/core/formatters/base_text_formatter.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def dump_failures
1818
output.puts "#{index.next}) #{failed_example}"
1919
output.puts "#{padding}Failure/Error: #{read_failed_line(exception, failed_example).strip}"
2020
exception.message.split("\n").each do |line|
21-
output.puts "#{padding}#{colorise(line, exception).strip}"
21+
output.puts "#{padding}#{colorise(line, exception)}"
2222
end
2323
end
2424

rspec-core.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Gem::Specification.new do |s|
99

1010
s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
1111
s.authors = ["Chad Humphries", "David Chelimsky"]
12-
s.date = %q{2010-05-16}
12+
s.date = %q{2010-05-17}
1313
s.description = %q{RSpec runner and example group classes}
1414
1515
s.executables = ["rspec", "spec"]
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
require "spec_helper"
2+
3+
module RSpec::Core::Formatters
4+
5+
describe BaseTextFormatter do
6+
describe "#dump_failures" do
7+
it "preserves formatting" do
8+
output = StringIO.new
9+
group = RSpec::Core::ExampleGroup.describe
10+
example = group.example { "this".should eq("that") }
11+
formatter = BaseTextFormatter.new
12+
group.run_all(formatter)
13+
14+
RSpec.configuration.stub(:output) { output }
15+
RSpec.configuration.stub(:color_enabled?) { false }
16+
formatter.dump_failures
17+
output.string.should =~ /(\s+)expected \"that\"\n\1 got \"this\"/m
18+
end
19+
end
20+
end
21+
end

0 commit comments

Comments
 (0)