Skip to content

Commit b59ebdc

Browse files
authored
Merge pull request #356 from gtt-project/fix/355-test-is-missing-assertions
Remove 'Test is missing assertions' warnings by renaming method name in test helper
2 parents cde679b + 28b8fe4 commit b59ebdc

5 files changed

Lines changed: 11 additions & 11 deletions

File tree

test/test_helper.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
require File.expand_path(File.dirname(__FILE__) + '/../../../test/test_helper')
33

44
module GttTestData
5-
def test_geojson
6-
{'type'=>'Feature','geometry'=>{ 'type'=>'Polygon','coordinates'=> test_coordinates}}.to_json
5+
def example_geojson
6+
{'type'=>'Feature','geometry'=>{ 'type'=>'Polygon','coordinates'=> example_coordinates}}.to_json
77
end
88

9-
def test_coordinates
9+
def example_coordinates
1010
# [[[135.220734222,34.705690600],[135.302273376,34.699060014],[135.300041779,34.670969984],[135.252834900,34.676052304],[135.194212540,34.676684044],[135.220734222,34.705690600]]]
1111
[[[135.220734222,34.705690600,0.0],[135.302273376,34.699060014,0.0],[135.300041779,34.670969984,0.0],[135.252834900,34.676052304,0.0],[135.194212540,34.676684044,0.0],[135.220734222,34.705690600,0.0]]]
1212
end
@@ -27,7 +27,7 @@ def multipolygon_geojson(coordinates)
2727
{'type'=>'Feature','geometry'=>{ 'type'=>'MultiPolygon','coordinates'=> coordinates}}.to_json
2828
end
2929

30-
def test_geom
30+
def example_geom
3131
RedmineGtt::Conversions::WkbToGeom.("01030000000100000006000000C84B374110E76040381DD011545A4140C84B3739ACE96040F07E6DCC7A594140C84B37F199E960403CBC2D58E2554140C84B373917E8604098CBC3E188564140C84B37FD36E66040F24C2E959D564140C84B374110E76040381DD011545A4140")
3232
end
3333
end
@@ -40,7 +40,7 @@ def assert_geojson(json)
4040
assert_equal 'Feature', json['type']
4141
assert geom = json['geometry']
4242
assert_equal 'Polygon', geom['type']
43-
assert_equal_coordinates test_coordinates, geom['coordinates']
43+
assert_equal_coordinates example_coordinates, geom['coordinates']
4444
end
4545

4646
def assert_equal_coordinates(a, b)

test/unit/gtt_map_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ class GttMapTest < GttTest
77
end
88

99
# test 'should compute json from geom' do
10-
# m = GttMap.new layers: [@ts], geom: test_geom
10+
# m = GttMap.new layers: [@ts], geom: example_geom
1111
# assert_geojson m.json
1212
# end
1313
end

test/unit/issue_test.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ class IssueTest < GttTest
66
setup do
77
@project = Project.find 'ecookbook'
88
@issue = @project.issues.last
9-
@issue.update_attribute :geojson, test_geojson
9+
@issue.update_attribute :geojson, example_geojson
1010
@issue = Issue.find @issue.id
1111
end
1212

@@ -83,7 +83,7 @@ class IssueTest < GttTest
8383
end
8484

8585
test 'should ignore small linestring geom changes' do
86-
coordinates = test_coordinates[0]
86+
coordinates = example_coordinates[0]
8787

8888
@issue.update_attribute :geojson, linestring_geojson(coordinates)
8989
@issue.instance_variable_set "@geojson", nil
@@ -107,7 +107,7 @@ class IssueTest < GttTest
107107
end
108108

109109
test 'should ignore small polygon geom changes' do
110-
coordinates = test_coordinates
110+
coordinates = example_coordinates
111111

112112
@issue.update_attribute :geojson, polygon_geojson(coordinates)
113113
@issue.instance_variable_set "@geojson", nil

test/unit/project_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ class ProjectTest < GttTest
55

66
setup do
77
@p = Project.find 'ecookbook'
8-
@p.update_attribute :geojson, test_geojson
8+
@p.update_attribute :geojson, example_geojson
99
end
1010

1111
test 'should have geojson and geom attribute' do

test/unit/user_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ class UserTest < GttTest
55

66
setup do
77
@user = User.find_by_login 'dlopper'
8-
@user.update_attribute :geojson, test_geojson
8+
@user.update_attribute :geojson, example_geojson
99
end
1010

1111
test 'should set geom from json' do

0 commit comments

Comments
 (0)