Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

* Fixed writing of JRuby specific output examples

  • Loading branch information...
commit ca3ccea85482c1ce120bacf33d12cb2edce7af57 1 parent 2b643ac
@donv donv authored
Showing with 17 additions and 1 deletion.
  1. +16 −0 test/gruff_test_case.rb
  2. +1 −1  test/test_line.rb
View
16 test/gruff_test_case.rb
@@ -12,6 +12,22 @@
FileUtils.mkdir_p(TEST_OUTPUT_DIR)
FileUtils.rm_f Dir[TEST_OUTPUT_DIR + '/*']
+class Gruff::Base
+ alias :write_org :write
+
+ def write(filename="graph.png")
+ basefilename = File.basename(filename).split('.')[0..-2].join('.')
+ extension = filename.slice(/\..*$/)
+ testfilename = File.join(TEST_OUTPUT_DIR, basefilename) + extension
+ counter = 0
+ while File.exists? testfilename
+ counter += 1
+ testfilename = Fie.join(TEST_OUTPUT_DIR, basefilename) + "-#{counter}#{extension}"
+ end
+ write_org(testfilename)
+ end
+end
+
class GruffTestCase < Test::Unit::TestCase
def setup
View
2  test/test_line.rb
@@ -458,7 +458,7 @@ def test_xy_data
def test_xy_data_pairs
g = Gruff::Line.new
- g.title = "X/Y Dataset"
+ g.title = "X/Y Dataset Pairs"
g.dataxy("Apples", [[1,1], [3,2],[4,3],[5,4],[6,4],[10,3]])
g.dataxy("Bapples", [[1,1],[3,1],[4,2],[5,2],[7,3],[9,3]])
g.data("Capples", [1, 1, 2, 2, 3, 3])
Please sign in to comment.
Something went wrong with that request. Please try again.