Skip to content

Commit

Permalink
Fixed failing spec.
Browse files Browse the repository at this point in the history
The spec was failing because it relied on a hard-coded expectation of the shortened file path and the actual path depends on where you have the project checked-out.
  • Loading branch information
Brendan Boesen committed Apr 26, 2012
1 parent e336700 commit 20153f8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions spec/ci/reporter/report_manager_spec.rb
Expand Up @@ -40,10 +40,11 @@
it "should shorten extremely long report filenames" do it "should shorten extremely long report filenames" do
reporter = CI::Reporter::ReportManager.new("spec") reporter = CI::Reporter::ReportManager.new("spec")
suite = mock("test suite") suite = mock("test suite")
suite.should_receive(:name).and_return("some test suite name that goes on and on and on and on and on and on and does not look like it will end any time soon and just when you think it is almost over it just continues to go on and on and on and on and on until it is almost over but wait there is more and then el fin") very_long_name = "some test suite name that goes on and on and on and on and on and on and does not look like it will end any time soon and just when you think it is almost over it just continues to go on and on and on and on and on until it is almost over but wait there is more and then el fin"
suite.should_receive(:name).and_return(very_long_name)
suite.should_receive(:to_xml).and_return("<xml></xml>") suite.should_receive(:to_xml).and_return("<xml></xml>")
reporter.write_report(suite) reporter.write_report(suite)
filename = "#{REPORTS_DIR}/SPEC-some-test-suite-name-that-goes-on-and-on-and-on-and-on-and-on-and-on-and-does-not-look-like-it-will-end-any-time-soon-and-just-when-you-think-it-is-almost-over-it-just-continues-t.xml" filename = "#{REPORTS_DIR}/SPEC-#{very_long_name}"[0..CI::Reporter::ReportManager::MAX_FILENAME_SIZE].gsub(/\s/, '-') + ".xml"
File.exist?(filename).should be_true File.exist?(filename).should be_true
File.open(filename) {|f| f.read.should == "<xml></xml>"} File.open(filename) {|f| f.read.should == "<xml></xml>"}
end end
Expand Down

0 comments on commit 20153f8

Please sign in to comment.