Permalink
Browse files

playing test unit

  • Loading branch information...
1 parent 1d837d9 commit f5abf2fcb6a42339531cb3f2e5f11eca51bba7ac @netbe committed Apr 18, 2012
Showing with 29 additions and 4 deletions.
  1. +5 −4 convert.rb
  2. +24 −0 test_convert.rb
View
9 convert.rb
@@ -155,14 +155,15 @@ def self.csv_to_dotstrings(name)
end
end
-# Part of the script
-if $0 == __FILE__
- # Shows help on how to use this script
-
def usage
RDoc::usage
exit
end
+# Part of the script
+if $0 == __FILE__
+ # Shows help on how to use this script
+
+
# Main program
if ARGV.size < 1
View
24 test_convert.rb
@@ -0,0 +1,24 @@
+# == Synopsis
+# tesing script
+begin
+ require "test/unit"
+rescue Exception => e
+ puts "gem install test-unit"
+ exit
+end
+$: << File.expand_path(File.join(File.dirname(__FILE__)))
+
+require 'convert'
+# require File.expand_path('convert',File.dirname(__FILE__))
+
+class TestConvert < Test::Unit::TestCase
+
+ def test_usage
+ begin
+ usage
+ rescue SystemExit => e
+ assert e.status == 0
+ end
+ end
+
+end

0 comments on commit f5abf2f

Please sign in to comment.