Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed failing spec.

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...
commit 20153f8e790100b0feac6b1f5d900a1cc2574e8b 1 parent e336700
Brendan Boesen authored

Showing 1 changed file with 3 additions and 2 deletions. Show diff stats Hide diff stats

  1. +3 2 spec/ci/reporter/report_manager_spec.rb
5 spec/ci/reporter/report_manager_spec.rb
@@ -40,10 +40,11 @@
40 40 it "should shorten extremely long report filenames" do
41 41 reporter = CI::Reporter::ReportManager.new("spec")
42 42 suite = mock("test suite")
43   - 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")
  43 + 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"
  44 + suite.should_receive(:name).and_return(very_long_name)
44 45 suite.should_receive(:to_xml).and_return("<xml></xml>")
45 46 reporter.write_report(suite)
46   - 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"
  47 + filename = "#{REPORTS_DIR}/SPEC-#{very_long_name}"[0..CI::Reporter::ReportManager::MAX_FILENAME_SIZE].gsub(/\s/, '-') + ".xml"
47 48 File.exist?(filename).should be_true
48 49 File.open(filename) {|f| f.read.should == "<xml></xml>"}
49 50 end

0 comments on commit 20153f8

Please sign in to comment.
Something went wrong with that request. Please try again.