hashema 0.0.0 → 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +3 -6
- data/lib/hashema/conform_to_schema.rb +8 -0
- data/lib/hashema/version.rb +1 -1
- metadata +5 -5
data/README.md
CHANGED
@@ -13,12 +13,10 @@ validator = Hashema::Validator.new(
|
|
13
13
|
{ url: 'http://www.blagoblag.com',
|
14
14
|
posts: [
|
15
15
|
{ title: 'hello',
|
16
|
-
|
17
|
-
comment_count: 1
|
16
|
+
published: true
|
18
17
|
},
|
19
18
|
{ title: 'test',
|
20
|
-
|
21
|
-
comment_count: 0
|
19
|
+
published: false
|
22
20
|
}
|
23
21
|
]
|
24
22
|
}
|
@@ -29,8 +27,7 @@ validator = Hashema::Validator.new(
|
|
29
27
|
{ url: /^https?:\/\//,
|
30
28
|
posts: [
|
31
29
|
{ title: String,
|
32
|
-
|
33
|
-
comment_count: Numeric
|
30
|
+
published: [true, false]
|
34
31
|
}
|
35
32
|
]
|
36
33
|
}
|
@@ -8,7 +8,15 @@ RSpec::Matchers.define :conform_to_schema do |schema|
|
|
8
8
|
@validator.failure_message
|
9
9
|
end
|
10
10
|
|
11
|
+
def failure_message_for_should
|
12
|
+
failure_message
|
13
|
+
end
|
14
|
+
|
11
15
|
def failure_message_when_negated
|
12
16
|
"expected\n#{actual.inspect}\nnot to match schema\n#{schema.inspect}"
|
13
17
|
end
|
18
|
+
|
19
|
+
def failure_message_for_should_not
|
20
|
+
failure_message_when_negated
|
21
|
+
end
|
14
22
|
end
|
data/lib/hashema/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hashema
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-08-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
@@ -18,7 +18,7 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version:
|
21
|
+
version: 2.0.0
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -26,7 +26,7 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - ! '>='
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version:
|
29
|
+
version: 2.0.0
|
30
30
|
description: Assert that JSONable objects conform to a schema
|
31
31
|
email:
|
32
32
|
executables: []
|
@@ -65,5 +65,5 @@ rubyforge_project:
|
|
65
65
|
rubygems_version: 1.8.23
|
66
66
|
signing_key:
|
67
67
|
specification_version: 3
|
68
|
-
summary: hashema-0.0.
|
68
|
+
summary: hashema-0.0.1
|
69
69
|
test_files: []
|