jay_z 0.0.1 → 0.0.2
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/Rakefile +2 -0
- data/jay_z.gemspec +4 -2
- data/lib/jay_z/version.rb +1 -1
- data/spec/jay_z/blueprint_spec.rb +6 -3
- data/spec/jay_z/ghost_spec.rb +1 -1
- data/spec/jay_z_spec.rb +5 -5
- metadata +7 -3
data/Rakefile
CHANGED
data/jay_z.gemspec
CHANGED
@@ -14,7 +14,9 @@ Gem::Specification.new do |s|
|
|
14
14
|
s.rubyforge_project = "jay_z"
|
15
15
|
|
16
16
|
s.files = `git ls-files`.split("\n")
|
17
|
-
s.test_files = `git ls-files --
|
18
|
-
s.executables = `git ls-files -- bin/*`.split("\n").map
|
17
|
+
s.test_files = `git ls-files -- spec/*`.split("\n")
|
18
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map do |f|
|
19
|
+
File.basename(f)
|
20
|
+
end
|
19
21
|
s.require_paths = ["lib"]
|
20
22
|
end
|
data/lib/jay_z/version.rb
CHANGED
@@ -123,6 +123,10 @@ describe JayZ::Blueprint do
|
|
123
123
|
it "returns the correct object" do
|
124
124
|
JayZ::User.make.new.must_be_instance_of(User)
|
125
125
|
end
|
126
|
+
|
127
|
+
it "populates the returned object with the defined values" do
|
128
|
+
JayZ::User.make.new.name.must_equal 'Anders'
|
129
|
+
end
|
126
130
|
end
|
127
131
|
|
128
132
|
describe "when a message is sent to the instance" do
|
@@ -130,10 +134,9 @@ describe JayZ::Blueprint do
|
|
130
134
|
JayZ::User.default do
|
131
135
|
name { 'Anders' }
|
132
136
|
end
|
133
|
-
@jayz_user = JayZ::User.make
|
134
137
|
end
|
135
138
|
it "delegates that message" do
|
136
|
-
|
139
|
+
JayZ::User.make.save.must_equal 1
|
137
140
|
end
|
138
141
|
end
|
139
142
|
|
@@ -147,7 +150,7 @@ describe JayZ::Blueprint do
|
|
147
150
|
end
|
148
151
|
end
|
149
152
|
|
150
|
-
it "executes the block when called" do
|
153
|
+
it "executes the defined block when its method is called" do
|
151
154
|
User.counter.must_equal nil
|
152
155
|
JayZ::Comment.default
|
153
156
|
User.counter.must_equal 1
|
data/spec/jay_z/ghost_spec.rb
CHANGED
@@ -7,7 +7,7 @@ describe JayZ::Ghost do
|
|
7
7
|
end
|
8
8
|
|
9
9
|
describe "#keys" do
|
10
|
-
it "returns a collection of all
|
10
|
+
it "returns a collection of all messages sent to the object" do
|
11
11
|
@ghost.title { 'block' }
|
12
12
|
@ghost.body { 'block' }
|
13
13
|
@ghost.keys.must_equal [:title, :body]
|
data/spec/jay_z_spec.rb
CHANGED
@@ -39,24 +39,24 @@ end
|
|
39
39
|
|
40
40
|
describe JayZ do
|
41
41
|
describe "when extending a class with the JayZ module" do
|
42
|
-
it "adds a
|
42
|
+
it "adds a .make method" do
|
43
43
|
Post.make.must_be_instance_of(JayZ::Post)
|
44
44
|
end
|
45
45
|
|
46
|
-
describe "
|
46
|
+
describe ".make" do
|
47
47
|
it "creates a blueprint proxy object" do
|
48
48
|
Post.make.must_be_instance_of(JayZ::Post)
|
49
49
|
end
|
50
50
|
end
|
51
51
|
|
52
52
|
describe "blueprint proxy object" do
|
53
|
-
it "
|
53
|
+
it "delegate all messages" do
|
54
54
|
Post.make.save.must_equal 'save in post called'
|
55
55
|
end
|
56
56
|
end
|
57
57
|
|
58
58
|
describe "before it delegates a message" do
|
59
|
-
it "populates the receiver with
|
59
|
+
it "populates the receiver with values from the blueprint" do
|
60
60
|
Post.make.save!.body.must_equal 'I am a default post body'
|
61
61
|
end
|
62
62
|
end
|
@@ -67,7 +67,7 @@ describe JayZ do
|
|
67
67
|
@video.url.must_equal 'http://www.youtube.com/watch?v=g5950v0kTJg'
|
68
68
|
end
|
69
69
|
|
70
|
-
it %q{populates the receiver with values from default block if not
|
70
|
+
it %q{populates the receiver with values from the default block if not
|
71
71
|
defined in video block} do
|
72
72
|
@video.body.must_equal 'I am a default post body'
|
73
73
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jay_z
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
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: 2011-09-
|
12
|
+
date: 2011-09-24 00:00:00.000000000 +02:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
description: A model factory. Say no to fixtures.
|
@@ -61,4 +61,8 @@ rubygems_version: 1.6.2
|
|
61
61
|
signing_key:
|
62
62
|
specification_version: 3
|
63
63
|
summary: A model factory
|
64
|
-
test_files:
|
64
|
+
test_files:
|
65
|
+
- spec/jay_z/blueprint_spec.rb
|
66
|
+
- spec/jay_z/ghost_spec.rb
|
67
|
+
- spec/jay_z/serial_number_spec.rb
|
68
|
+
- spec/jay_z_spec.rb
|