rails_uri_validator 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -8,4 +8,5 @@ source "http://rubygems.org"
8
8
  group :development do
9
9
  gem "bundler", "~> 1.0.0"
10
10
  gem "jeweler", "~> 1.5.2"
11
+ gem "cover_me"
11
12
  end
data/Gemfile.lock CHANGED
@@ -7,13 +7,20 @@ GEM
7
7
  i18n (~> 0.4)
8
8
  activesupport (3.0.3)
9
9
  builder (2.1.2)
10
+ configatron (2.6.4)
11
+ yamler (>= 0.1.0)
12
+ cover_me (1.0.0.rc5)
13
+ configatron
14
+ hashie
10
15
  git (1.2.5)
16
+ hashie (0.4.0)
11
17
  i18n (0.5.0)
12
18
  jeweler (1.5.2)
13
19
  bundler (~> 1.0.0)
14
20
  git (>= 1.2.5)
15
21
  rake
16
22
  rake (0.8.7)
23
+ yamler (0.1.0)
17
24
 
18
25
  PLATFORMS
19
26
  ruby
@@ -21,4 +28,5 @@ PLATFORMS
21
28
  DEPENDENCIES
22
29
  activemodel (>= 3.0.0)
23
30
  bundler (~> 1.0.0)
31
+ cover_me
24
32
  jeweler (~> 1.5.2)
data/Rakefile CHANGED
@@ -33,6 +33,17 @@ Rake::TestTask.new(:test) do |test|
33
33
  test.verbose = true
34
34
  end
35
35
 
36
+ namespace :cover_me do
37
+ task :report do
38
+ require 'cover_me'
39
+ CoverMe.complete!
40
+ end
41
+ end
42
+
43
+ task :test do
44
+ Rake::Task['cover_me:report'].invoke
45
+ end
46
+
36
47
  task :default => :test
37
48
 
38
49
  require 'rake/rdoctask'
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.1.1
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{rails_uri_validator}
8
- s.version = "0.1.0"
8
+ s.version = "0.1.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Marco Scholl"]
@@ -48,17 +48,20 @@ Gem::Specification.new do |s|
48
48
  s.add_runtime_dependency(%q<activemodel>, [">= 3.0.0"])
49
49
  s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
50
50
  s.add_development_dependency(%q<jeweler>, ["~> 1.5.2"])
51
+ s.add_development_dependency(%q<cover_me>, [">= 0"])
51
52
  s.add_runtime_dependency(%q<activemodel>, [">= 3.0.0"])
52
53
  else
53
54
  s.add_dependency(%q<activemodel>, [">= 3.0.0"])
54
55
  s.add_dependency(%q<bundler>, ["~> 1.0.0"])
55
56
  s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
57
+ s.add_dependency(%q<cover_me>, [">= 0"])
56
58
  s.add_dependency(%q<activemodel>, [">= 3.0.0"])
57
59
  end
58
60
  else
59
61
  s.add_dependency(%q<activemodel>, [">= 3.0.0"])
60
62
  s.add_dependency(%q<bundler>, ["~> 1.0.0"])
61
63
  s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
64
+ s.add_dependency(%q<cover_me>, [">= 0"])
62
65
  s.add_dependency(%q<activemodel>, [">= 3.0.0"])
63
66
  end
64
67
  end
data/test/helper.rb CHANGED
@@ -9,10 +9,12 @@ rescue Bundler::BundlerError => e
9
9
  $stderr.puts "Run `bundle install` to install missing gems"
10
10
  exit e.status_code
11
11
  end
12
+ require 'cover_me'
12
13
  require 'test/unit'
13
14
 
14
15
  $LOAD_PATH.unshift(File.dirname(__FILE__))
15
16
  $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
17
+ require 'cover_me'
16
18
  require 'rails_uri_validator'
17
19
 
18
20
  class Test::Unit::TestCase
@@ -25,6 +25,7 @@ class TestRailsUriValidator < Test::Unit::TestCase
25
25
  def test_valid_uri
26
26
  instance = ValidateDefaultUri.new
27
27
  [
28
+ 'test',
28
29
  "http://user:pass@www.web.de:80/directory/?querystring#anker",
29
30
  "https://user:pass@www.web.de:80/directory/?querystring#anker",
30
31
  "http://www.web.de:80/directory/?querystring#anker",
@@ -48,7 +49,7 @@ class TestRailsUriValidator < Test::Unit::TestCase
48
49
  "urn:oasis:names:specification:docbook:dtd:xml:4.1.2"
49
50
  ].each do |uri|
50
51
  instance.uri = uri
51
- assert instance.valid?, uri
52
+ assert instance.valid?, uri.to_s
52
53
  end
53
54
  end
54
55
 
@@ -66,7 +67,7 @@ class TestRailsUriValidator < Test::Unit::TestCase
66
67
  "http://de.wikipedia.org/wiki/Uniform_Resource_Identifier"
67
68
  ].each do |uri|
68
69
  instance.uri = uri
69
- assert instance.valid?, uri
70
+ assert instance.valid?, uri.to_s
70
71
  end
71
72
 
72
73
  [
@@ -83,7 +84,7 @@ class TestRailsUriValidator < Test::Unit::TestCase
83
84
  "urn:oasis:names:specification:docbook:dtd:xml:4.1.2"
84
85
  ].each do |uri|
85
86
  instance.uri = uri
86
- assert !instance.valid?, uri
87
+ assert !instance.valid?, uri.to_s
87
88
  end
88
89
  end
89
90
 
@@ -94,7 +95,7 @@ class TestRailsUriValidator < Test::Unit::TestCase
94
95
  "mailto:test@example.net?subject=Test"
95
96
  ].each do |uri|
96
97
  instance.uri = uri
97
- assert instance.valid?, uri
98
+ assert instance.valid?, uri.to_s
98
99
  end
99
100
 
100
101
  [
@@ -110,7 +111,7 @@ class TestRailsUriValidator < Test::Unit::TestCase
110
111
  "urn:oasis:names:specification:docbook:dtd:xml:4.1.2"
111
112
  ].each do |uri|
112
113
  instance.uri = uri
113
- assert !instance.valid?, uri
114
+ assert !instance.valid?, uri.to_s
114
115
  end
115
116
  end
116
117
 
@@ -121,7 +122,7 @@ class TestRailsUriValidator < Test::Unit::TestCase
121
122
  "http://example.net/test"
122
123
  ].each do |uri|
123
124
  instance.uri = uri
124
- assert instance.valid?, uri
125
+ assert instance.valid?, uri.to_s
125
126
  end
126
127
 
127
128
  [
@@ -129,7 +130,19 @@ class TestRailsUriValidator < Test::Unit::TestCase
129
130
  "http://test:test@example.net/test"
130
131
  ].each do |uri|
131
132
  instance.uri = uri
132
- assert !instance.valid?, uri
133
+ assert !instance.valid?, uri.to_s
134
+ end
135
+ end
136
+
137
+ def test_invalid
138
+ instance = ValidateDefaultUri.new
139
+ [
140
+ 1,
141
+ 2.2,
142
+ '##'
143
+ ].each do |uri|
144
+ instance.uri = uri
145
+ assert !instance.valid?, uri.to_s
133
146
  end
134
147
  end
135
148
 
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 0
9
- version: 0.1.0
8
+ - 1
9
+ version: 0.1.1
10
10
  platform: ruby
11
11
  authors:
12
12
  - Marco Scholl
@@ -63,8 +63,21 @@ dependencies:
63
63
  prerelease: false
64
64
  version_requirements: *id003
65
65
  - !ruby/object:Gem::Dependency
66
- name: activemodel
66
+ name: cover_me
67
67
  requirement: &id004 !ruby/object:Gem::Requirement
68
+ none: false
69
+ requirements:
70
+ - - ">="
71
+ - !ruby/object:Gem::Version
72
+ segments:
73
+ - 0
74
+ version: "0"
75
+ type: :development
76
+ prerelease: false
77
+ version_requirements: *id004
78
+ - !ruby/object:Gem::Dependency
79
+ name: activemodel
80
+ requirement: &id005 !ruby/object:Gem::Requirement
68
81
  none: false
69
82
  requirements:
70
83
  - - ">="
@@ -76,7 +89,7 @@ dependencies:
76
89
  version: 3.0.0
77
90
  type: :runtime
78
91
  prerelease: false
79
- version_requirements: *id004
92
+ version_requirements: *id005
80
93
  description: a class to validate uris. it builded for rails
81
94
  email: develop@marco-scholl.de
82
95
  executables: []
@@ -113,7 +126,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
113
126
  requirements:
114
127
  - - ">="
115
128
  - !ruby/object:Gem::Version
116
- hash: 238538861103991173
129
+ hash: 3481741287608444591
117
130
  segments:
118
131
  - 0
119
132
  version: "0"