Skip to content

Commit

Permalink
Switch from Test::Unit to Minitest
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielVartanov committed Mar 15, 2014
1 parent 5990480 commit c24d39d
Show file tree
Hide file tree
Showing 37 changed files with 83 additions and 82 deletions.
8 changes: 4 additions & 4 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ require 'rake'
require 'rake/testtask'
require 'bundler/gem_tasks'

task :default => :test
task default: :test

Rake::TestTask.new do |t|
t.libs = ["lib"]
t.warning = true
t.libs << "lib"
t.libs << "test"
t.test_files = FileList['test/**/*_test.rb']
t.verbose = true
t.test_files = FileList['test/*_test.rb']
end
1 change: 1 addition & 0 deletions ruby-geometry.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ Gem::Specification.new do |s|

s.add_development_dependency 'bundler'
s.add_development_dependency 'rake'
s.add_development_dependency 'minitest'
end
4 changes: 2 additions & 2 deletions test/bounding_box/contains_test.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'test/unit'
require 'minitest/autorun'
require 'geometry'

class ContainsTest < Test::Unit::TestCase
class ContainsTest < MiniTest::Unit::TestCase
include Geometry

def bounding_box
Expand Down
4 changes: 2 additions & 2 deletions test/geometry/distance_test.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'test/unit'
require 'minitest/autorun'
require 'geometry'

class DistanceTest < Test::Unit::TestCase
class DistanceTest < MiniTest::Unit::TestCase
include Geometry

def test_trivial_cases
Expand Down
4 changes: 2 additions & 2 deletions test/line/angle_to_test.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'test/unit'
require 'minitest/autorun'
require 'geometry'

class AngleToTest < Test::Unit::TestCase
class AngleToTest < MiniTest::Unit::TestCase
include Geometry

def test_angle_to_self
Expand Down
4 changes: 2 additions & 2 deletions test/line/distance_to_test.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'test/unit'
require 'minitest/autorun'
require 'geometry'

class DistanceToTest < Test::Unit::TestCase
class DistanceToTest < MiniTest::Unit::TestCase
include Geometry

def test_distance_to_point_on_line
Expand Down
4 changes: 2 additions & 2 deletions test/line/horizontal_test.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'test/unit'
require 'minitest/autorun'
require 'geometry'

class HorizontalTest < Test::Unit::TestCase
class HorizontalTest < MiniTest::Unit::TestCase
include Geometry

def test_horizontal
Expand Down
4 changes: 2 additions & 2 deletions test/line/initialize_test.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'test/unit'
require 'minitest/autorun'
require 'geometry'

class InitializeTest < Test::Unit::TestCase
class InitializeTest < MiniTest::Unit::TestCase
include Geometry

def test_initialize_by_points
Expand Down
4 changes: 2 additions & 2 deletions test/line/intersect_x_test.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'test/unit'
require 'minitest/autorun'
require 'geometry'

class IntersectXTest < Test::Unit::TestCase
class IntersectXTest < MiniTest::Unit::TestCase
include Geometry

def test_vertical_non_overlapping
Expand Down
4 changes: 2 additions & 2 deletions test/line/parallel_to_test.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'test/unit'
require 'minitest/autorun'
require 'geometry'

class ParallelToTest < Test::Unit::TestCase
class ParallelToTest < MiniTest::Unit::TestCase
include Geometry

def test_identical
Expand Down
4 changes: 2 additions & 2 deletions test/line/slope_test.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'test/unit'
require 'minitest/autorun'
require 'geometry'

class SlopeTest < Test::Unit::TestCase
class SlopeTest < MiniTest::Unit::TestCase
include Geometry

def setup
Expand Down
4 changes: 2 additions & 2 deletions test/line/vertical_test.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'test/unit'
require 'minitest/autorun'
require 'geometry'

class VerticalTest < Test::Unit::TestCase
class VerticalTest < MiniTest::Unit::TestCase
include Geometry

def test_vertical
Expand Down
4 changes: 2 additions & 2 deletions test/line/x_intercept_test.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'test/unit'
require 'minitest/autorun'
require 'geometry'

class XInterceptTest < Test::Unit::TestCase
class XInterceptTest < MiniTest::Unit::TestCase
include Geometry

def setup
Expand Down
4 changes: 2 additions & 2 deletions test/line/y_intercept_test.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'test/unit'
require 'minitest/autorun'
require 'geometry'

class YInterceptTest < Test::Unit::TestCase
class YInterceptTest < MiniTest::Unit::TestCase
include Geometry

def setup
Expand Down
4 changes: 2 additions & 2 deletions test/point/equals_test.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'test/unit'
require 'minitest/autorun'
require 'geometry'

class EqualsTest < Test::Unit::TestCase
class EqualsTest < MiniTest::Unit::TestCase
include Geometry

def test_equal
Expand Down
4 changes: 2 additions & 2 deletions test/point/initialize_test.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'test/unit'
require 'minitest/autorun'
require 'geometry'

class InitializeTest < Test::Unit::TestCase
class InitializeTest < MiniTest::Unit::TestCase
include Geometry

def test_initialize_by_numbers
Expand Down
4 changes: 2 additions & 2 deletions test/polygon/bounding_box_test.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'test/unit'
require 'minitest/autorun'
require 'geometry'

class BoundingBoxTest < Test::Unit::TestCase
class BoundingBoxTest < MiniTest::Unit::TestCase
include Geometry

def test_rectangle
Expand Down
4 changes: 2 additions & 2 deletions test/polygon/contains_point_test.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'test/unit'
require 'minitest/autorun'
require 'geometry'

class ContainsPointTest < Test::Unit::TestCase
class ContainsPointTest < MiniTest::Unit::TestCase
include Geometry

def test_convex
Expand Down
4 changes: 2 additions & 2 deletions test/polygon/edges_test.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'test/unit'
require 'minitest/autorun'
require 'geometry'

class EdgesTest < Test::Unit::TestCase
class EdgesTest < MiniTest::Unit::TestCase
include Geometry

# +-----+
Expand Down
4 changes: 2 additions & 2 deletions test/polygon/polygon_area_test.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'test/unit'
require 'minitest/autorun'
require 'geometry'

class PolygonAreaTest < Test::Unit::TestCase
class PolygonAreaTest < MiniTest::Unit::TestCase
include Geometry
def test_area_of_empty_polygon
polygon = Polygon.new []
Expand Down
4 changes: 2 additions & 2 deletions test/segment/bounds_test.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'test/unit'
require 'minitest/autorun'
require 'geometry'

class BoundsTest < Test::Unit::TestCase
class BoundsTest < MiniTest::Unit::TestCase
include Geometry

def setup
Expand Down
4 changes: 2 additions & 2 deletions test/segment/contains_point_test.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'test/unit'
require 'minitest/autorun'
require 'geometry'

class ContainsPointTest < Test::Unit::TestCase
class ContainsPointTest < MiniTest::Unit::TestCase
include Geometry

# ----*----
Expand Down
4 changes: 2 additions & 2 deletions test/segment/distance_to_test.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'test/unit'
require 'minitest/autorun'
require 'geometry'

class DistanceToTest < Test::Unit::TestCase
class DistanceToTest < MiniTest::Unit::TestCase
include Geometry

def test_distance_to_point_on_segment
Expand Down
4 changes: 2 additions & 2 deletions test/segment/initialize_test.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'test/unit'
require 'minitest/autorun'
require 'geometry'

class InitializeTest < Test::Unit::TestCase
class InitializeTest < MiniTest::Unit::TestCase
include Geometry

def test_initialize_by_points
Expand Down
10 changes: 5 additions & 5 deletions test/segment/intersection_point_with_test.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'test/unit'
require 'minitest/autorun'
require 'geometry'

class IntersectionPointWithTest < Test::Unit::TestCase
class IntersectionPointWithTest < MiniTest::Unit::TestCase
include Geometry

def test_regular_case
Expand All @@ -22,7 +22,7 @@ def test_segments_do_not_intersect
segment1 = Segment.new_by_arrays([0, 0], [0, 2])
segment2 = Segment.new_by_arrays([1, 1], [2, 1])

assert_raise SegmentsDoNotIntersect do
assert_raises SegmentsDoNotIntersect do
segment1.intersection_point_with(segment2)
end
end
Expand All @@ -31,7 +31,7 @@ def test_segments_are_parallel
segment1 = Segment.new_by_arrays([0, 0], [2, 2])
segment2 = Segment.new_by_arrays([1, 0], [3, 2])

assert_raise SegmentsDoNotIntersect do
assert_raises SegmentsDoNotIntersect do
segment1.intersection_point_with(segment2)
end
end
Expand All @@ -40,7 +40,7 @@ def test_segments_overlap
segment1 = Segment.new_by_arrays([0, 0], [2, 2])
segment2 = Segment.new_by_arrays([1, 1], [3, 3])

assert_raise SegmentsOverlap do
assert_raises SegmentsOverlap do
segment1.intersection_point_with(segment2)
end
end
Expand Down
4 changes: 2 additions & 2 deletions test/segment/intersects_with_test.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'test/unit'
require 'minitest/autorun'
require 'geometry'

class IntersectsTest < Test::Unit::TestCase
class IntersectsTest < MiniTest::Unit::TestCase
include Geometry

# |
Expand Down
4 changes: 2 additions & 2 deletions test/segment/length_test.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'test/unit'
require 'minitest/autorun'
require 'geometry'

class LengthTest < Test::Unit::TestCase
class LengthTest < MiniTest::Unit::TestCase
include Geometry

def test_parallel_to_axis
Expand Down
4 changes: 2 additions & 2 deletions test/segment/lie_on_one_line_with.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'test/unit'
require 'minitest/autorun'
require 'geometry'

class IntersectsTest < Test::Unit::TestCase
class IntersectsTest < MiniTest::Unit::TestCase
include Geometry

def test_segments_parralel_but_on_different_lines
Expand Down
4 changes: 2 additions & 2 deletions test/segment/overlaps_test.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'test/unit'
require 'minitest/autorun'
require 'geometry'

class OverlapsTest < Test::Unit::TestCase
class OverlapsTest < MiniTest::Unit::TestCase
include Geometry

def test_overlaps
Expand Down
4 changes: 2 additions & 2 deletions test/segment/parallel_to_test.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'test/unit'
require 'minitest/autorun'
require 'geometry'

class ParallelToTest < Test::Unit::TestCase
class ParallelToTest < MiniTest::Unit::TestCase
include Geometry

def test_segments_are_parallel
Expand Down
4 changes: 2 additions & 2 deletions test/segment/to_vector_test.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'test/unit'
require 'minitest/autorun'
require 'geometry'

class ToVectorTest < Test::Unit::TestCase
class ToVectorTest < MiniTest::Unit::TestCase
include Geometry

def test_regular_case
Expand Down
4 changes: 2 additions & 2 deletions test/vector/arithmetics_test.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'test/unit'
require 'minitest/autorun'
require 'geometry'

class ArithmeticsTest < Test::Unit::TestCase
class ArithmeticsTest < MiniTest::Unit::TestCase
include Geometry

def test_summation
Expand Down
4 changes: 2 additions & 2 deletions test/vector/collinear_with_test.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'test/unit'
require 'minitest/autorun'
require 'geometry'

class CollinearWithTest < Test::Unit::TestCase
class CollinearWithTest < MiniTest::Unit::TestCase
include Geometry

def test_vectors_are_collinear
Expand Down
4 changes: 2 additions & 2 deletions test/vector/cross_product_test.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'test/unit'
require 'minitest/autorun'
require 'geometry'

class CrossProductTest < Test::Unit::TestCase
class CrossProductTest < MiniTest::Unit::TestCase
include Geometry

def test_positive
Expand Down
14 changes: 7 additions & 7 deletions test/vector/equals_test.rb
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
require 'test/unit'
require 'minitest/autorun'
require 'geometry'

class EqualsTest < Test::Unit::TestCase
class EqualsTest < MiniTest::Unit::TestCase
include Geometry

def test_equal
def test_equal
assert_equal Vector.new(1, 3), Vector.new(1, 3)
end
def test_not_equal
assert_not_equal Vector.new(1, 3), Vector.new(1, 2)
assert_not_equal Vector.new(1, 2), Vector.new(0, 2)

def test_not_equal
refute_equal Vector.new(1, 3), Vector.new(1, 2)
refute_equal Vector.new(1, 2), Vector.new(0, 2)
end
end
Loading

0 comments on commit c24d39d

Please sign in to comment.