michael-ken 0.1.0 → 0.1.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.textile +3 -0
- data/Rakefile +2 -0
- data/VERSION +1 -1
- data/examples/artist.rb +1 -0
- data/ken.gemspec +8 -2
- data/lib/ken.rb +31 -4
- data/lib/ken/resource.rb +26 -27
- data/test/fixtures/music_artist.json +1 -1
- data/test/fixtures/the_police.json +935 -938
- data/test/integration/ken_test.rb +2 -2
- data/test/unit/attribute_test.rb +7 -6
- metadata +22 -2
@@ -22,7 +22,7 @@ class KenTest < Test::Unit::TestCase
|
|
22
22
|
resources.should be_kind_of(Ken::Collection)
|
23
23
|
resources.first.should be_kind_of(Ken::Resource)
|
24
24
|
end
|
25
|
-
|
25
|
+
|
26
26
|
should "work with a limit specified" do
|
27
27
|
resources = Ken.all(:name => "Apple", :limit => 3)
|
28
28
|
resources.length.should == 3
|
@@ -48,7 +48,7 @@ class KenTest < Test::Unit::TestCase
|
|
48
48
|
],
|
49
49
|
:type => "/film/film"
|
50
50
|
}
|
51
|
-
|
51
|
+
|
52
52
|
resources = Ken.all(query)
|
53
53
|
resources.length.should == 3
|
54
54
|
resources.first.name.should == "Star Wars Episode IV: A New Hope"
|
data/test/unit/attribute_test.rb
CHANGED
@@ -5,18 +5,19 @@ class AttributeTest < Test::Unit::TestCase
|
|
5
5
|
setup do
|
6
6
|
data = load_fixture('the_police')
|
7
7
|
@the_police = Ken::Resource.new(data)
|
8
|
-
|
9
|
-
@attribute = @unique_value_attribute = @the_police.
|
10
|
-
@unique_object_attribute = @the_police.
|
11
|
-
@
|
12
|
-
@
|
8
|
+
|
9
|
+
@attribute = @unique_value_attribute = @the_police.views[0].active_start
|
10
|
+
@unique_object_attribute = @the_police.views[0].origin
|
11
|
+
@unique_object_attribute.unique?
|
12
|
+
@non_unique_value_attribute = @the_police.views[1].alias
|
13
|
+
@non_unique_object_attribute = @the_police.views[0].album
|
13
14
|
end
|
14
15
|
|
15
16
|
should "should have values" do
|
16
17
|
@attribute.should have(1).values
|
17
18
|
@non_unique_object_attribute.should have(14).values
|
18
19
|
end
|
19
|
-
|
20
|
+
|
20
21
|
context "with unique value type" do
|
21
22
|
should "be unique and no object_type" do
|
22
23
|
@unique_value_attribute.unique?.should == true
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: michael-ken
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- michael
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-07-
|
12
|
+
date: 2009-07-24 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -22,6 +22,26 @@ dependencies:
|
|
22
22
|
- !ruby/object:Gem::Version
|
23
23
|
version: "0"
|
24
24
|
version:
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: json
|
27
|
+
type: :runtime
|
28
|
+
version_requirement:
|
29
|
+
version_requirements: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: "0"
|
34
|
+
version:
|
35
|
+
- !ruby/object:Gem::Dependency
|
36
|
+
name: addressable
|
37
|
+
type: :runtime
|
38
|
+
version_requirement:
|
39
|
+
version_requirements: !ruby/object:Gem::Requirement
|
40
|
+
requirements:
|
41
|
+
- - ">="
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: "0"
|
44
|
+
version:
|
25
45
|
description:
|
26
46
|
email: ma[at]zive[dot]at
|
27
47
|
executables: []
|