Checked 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +5 -0
- data/.gitignore +4 -0
- data/Checked.gemspec +30 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +20 -0
- data/README.rdoc +19 -0
- data/Rakefile +1 -0
- data/lib/Checked/Args.rb +55 -0
- data/lib/Checked/Ask/DSL.rb +31 -0
- data/lib/Checked/Ask/Mods/Arrays.rb +25 -0
- data/lib/Checked/Ask/Mods/Strings.rb +26 -0
- data/lib/Checked/Ask/Mods/Vars.rb +12 -0
- data/lib/Checked/Ask.rb +69 -0
- data/lib/Checked/Base.rb +119 -0
- data/lib/Checked/Clean/DSL.rb +16 -0
- data/lib/Checked/Clean/Mods/Strings.rb +98 -0
- data/lib/Checked/Clean.rb +41 -0
- data/lib/Checked/Demand/DSL.rb +29 -0
- data/lib/Checked/Demand/Mods/Arrays.rb +72 -0
- data/lib/Checked/Demand/Mods/Bools.rb +37 -0
- data/lib/Checked/Demand/Mods/File_Addresses.rb +56 -0
- data/lib/Checked/Demand/Mods/Strings.rb +51 -0
- data/lib/Checked/Demand/Mods/Symbols.rb +20 -0
- data/lib/Checked/Demand/Mods/Vars.rb +91 -0
- data/lib/Checked/Demand.rb +46 -0
- data/lib/Checked/version.rb +3 -0
- data/lib/Checked.rb +14 -0
- data/spec/helper.rb +15 -0
- data/spec/main.rb +32 -0
- data/spec/tests/Ask.rb +13 -0
- data/spec/tests/Ask_Strings.rb +57 -0
- data/spec/tests/Checked.rb +43 -0
- data/spec/tests/Clean.rb +13 -0
- data/spec/tests/Clean_Strings.rb +76 -0
- data/spec/tests/Demand.rb +39 -0
- data/spec/tests/Demand_Arrays.rb +31 -0
- data/spec/tests/Demand_File_Addresses.rb +37 -0
- data/spec/tests/Demand_Vars.rb +19 -0
- metadata +117 -0
@@ -0,0 +1,19 @@
|
|
1
|
+
|
2
|
+
describe "demand a! (certain class)" do
|
3
|
+
|
4
|
+
before do
|
5
|
+
@fail = Checked::Demand::Failed
|
6
|
+
@d = lambda { |val, k|
|
7
|
+
d = Checked::Demand.new(val)
|
8
|
+
d.a! k
|
9
|
+
d.target
|
10
|
+
}
|
11
|
+
end
|
12
|
+
|
13
|
+
it 'must fail if invalid class' do
|
14
|
+
should.raise(@fail) {
|
15
|
+
@d.call('', Symbol)
|
16
|
+
}.message.should.include 'can only be of class/module: Symbol'
|
17
|
+
end
|
18
|
+
|
19
|
+
end # === describe demand a! (certain class)
|
metadata
ADDED
@@ -0,0 +1,117 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: Checked
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- da99
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2011-10-13 00:00:00.000000000Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: rake
|
16
|
+
requirement: &14888840 !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :development
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: *14888840
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: bacon
|
27
|
+
requirement: &14888280 !ruby/object:Gem::Requirement
|
28
|
+
none: false
|
29
|
+
requirements:
|
30
|
+
- - ! '>='
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0'
|
33
|
+
type: :development
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: *14888280
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: Bacon_Colored
|
38
|
+
requirement: &14887680 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
41
|
+
- - ! '>='
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '0'
|
44
|
+
type: :development
|
45
|
+
prerelease: false
|
46
|
+
version_requirements: *14887680
|
47
|
+
description: ! "\n Various DSLs to clean, question (Ask), and validate (Demand)
|
48
|
+
your objects,\n their classes (data types), and their properties.\n "
|
49
|
+
email:
|
50
|
+
- i-hate-spam-45671204@mailinator.com
|
51
|
+
executables: []
|
52
|
+
extensions: []
|
53
|
+
extra_rdoc_files: []
|
54
|
+
files:
|
55
|
+
- .document
|
56
|
+
- .gitignore
|
57
|
+
- Checked.gemspec
|
58
|
+
- Gemfile
|
59
|
+
- LICENSE.txt
|
60
|
+
- README.rdoc
|
61
|
+
- Rakefile
|
62
|
+
- lib/Checked.rb
|
63
|
+
- lib/Checked/Args.rb
|
64
|
+
- lib/Checked/Ask.rb
|
65
|
+
- lib/Checked/Ask/DSL.rb
|
66
|
+
- lib/Checked/Ask/Mods/Arrays.rb
|
67
|
+
- lib/Checked/Ask/Mods/Strings.rb
|
68
|
+
- lib/Checked/Ask/Mods/Vars.rb
|
69
|
+
- lib/Checked/Base.rb
|
70
|
+
- lib/Checked/Clean.rb
|
71
|
+
- lib/Checked/Clean/DSL.rb
|
72
|
+
- lib/Checked/Clean/Mods/Strings.rb
|
73
|
+
- lib/Checked/Demand.rb
|
74
|
+
- lib/Checked/Demand/DSL.rb
|
75
|
+
- lib/Checked/Demand/Mods/Arrays.rb
|
76
|
+
- lib/Checked/Demand/Mods/Bools.rb
|
77
|
+
- lib/Checked/Demand/Mods/File_Addresses.rb
|
78
|
+
- lib/Checked/Demand/Mods/Strings.rb
|
79
|
+
- lib/Checked/Demand/Mods/Symbols.rb
|
80
|
+
- lib/Checked/Demand/Mods/Vars.rb
|
81
|
+
- lib/Checked/version.rb
|
82
|
+
- spec/helper.rb
|
83
|
+
- spec/main.rb
|
84
|
+
- spec/tests/Ask.rb
|
85
|
+
- spec/tests/Ask_Strings.rb
|
86
|
+
- spec/tests/Checked.rb
|
87
|
+
- spec/tests/Clean.rb
|
88
|
+
- spec/tests/Clean_Strings.rb
|
89
|
+
- spec/tests/Demand.rb
|
90
|
+
- spec/tests/Demand_Arrays.rb
|
91
|
+
- spec/tests/Demand_File_Addresses.rb
|
92
|
+
- spec/tests/Demand_Vars.rb
|
93
|
+
homepage: ''
|
94
|
+
licenses: []
|
95
|
+
post_install_message:
|
96
|
+
rdoc_options: []
|
97
|
+
require_paths:
|
98
|
+
- lib
|
99
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
100
|
+
none: false
|
101
|
+
requirements:
|
102
|
+
- - ! '>='
|
103
|
+
- !ruby/object:Gem::Version
|
104
|
+
version: '0'
|
105
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
106
|
+
none: false
|
107
|
+
requirements:
|
108
|
+
- - ! '>='
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
requirements: []
|
112
|
+
rubyforge_project: Checked
|
113
|
+
rubygems_version: 1.8.11
|
114
|
+
signing_key:
|
115
|
+
specification_version: 3
|
116
|
+
summary: Check your types and more.
|
117
|
+
test_files: []
|