Checked 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -11,7 +11,7 @@ module File_Addresses
11
11
  def hostname!
12
12
  string!
13
13
  not_empty!
14
- contain_only! %r![\dA-Za-z_-]!
14
+ matches_only! %r![\dA-Za-z_-]!
15
15
  end
16
16
 
17
17
  def not_dir!
@@ -35,7 +35,7 @@ module Strings
35
35
  def matches_only! matcher
36
36
  str = target.gsub(matcher, '')
37
37
  if !str.empty?
38
- fail!( "...invalid characters: #{str.inspect}" )
38
+ fail!( "...has invalid characters: #{str.inspect}" )
39
39
  end
40
40
  end
41
41
 
@@ -1,3 +1,3 @@
1
1
  module Checked
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
@@ -47,3 +47,15 @@ describe "Demand :file_content!" do
47
47
  end
48
48
 
49
49
  end # === describe Demand :file_content!
50
+
51
+ describe "Demand :hostname!" do
52
+
53
+ it 'must not contain whitespace' do
54
+ lambda {
55
+ d = Checked::Demand.new('some name')
56
+ d.<< :hostname!
57
+ }.should.raise(Checked::Demand::Failed)
58
+ .message.should.be == 'String, "some name", has invalid characters: " "'
59
+ end
60
+
61
+ end # === describe Demand :hostname!
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: Checked
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-10-16 00:00:00.000000000Z
12
+ date: 2011-12-29 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
16
- requirement: &16940640 !ruby/object:Gem::Requirement
16
+ requirement: &11239380 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *16940640
24
+ version_requirements: *11239380
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: bacon
27
- requirement: &16939800 !ruby/object:Gem::Requirement
27
+ requirement: &11238020 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *16939800
35
+ version_requirements: *11238020
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: Bacon_Colored
38
- requirement: &16938980 !ruby/object:Gem::Requirement
38
+ requirement: &11199900 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,7 +43,7 @@ dependencies:
43
43
  version: '0'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *16938980
46
+ version_requirements: *11199900
47
47
  description: ! "\n Various DSLs to clean, question (Ask), and validate (Demand)
48
48
  your objects,\n their classes (data types), and their properties.\n "
49
49
  email: