woyo-world 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/woyo/world/version.rb +1 -1
- data/spec/woyo/world/character_spec.rb +5 -0
- data/spec/woyo/world/way_spec.rb +23 -5
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 41063454cff975a0e239285995c4458949d3e1bc
|
4
|
+
data.tar.gz: 1a522f3af72fee8f7ecbd05a6051f9ca23722def
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 535354c4f343bd4170b8541a40c5e9138133ee2c37181222fcd314cca57474dce395d313b816ba054983317bc14549691bdd57927fd1ead0378bde8fdfb4d28c
|
7
|
+
data.tar.gz: 102e073c0afc15ef768488ca1bb64f9b55e45d6b86540e7a984506aacbeb4affd4e11fc68147460d8e6570448f927459a683325374e84c3626542c8248fbd9b8
|
data/lib/woyo/world/version.rb
CHANGED
@@ -9,6 +9,11 @@ describe Woyo::Character do
|
|
9
9
|
Woyo::Character.attributes.sort.should eq expected_attrs.sort
|
10
10
|
end
|
11
11
|
|
12
|
+
it 'name attribute defaults to id' do
|
13
|
+
wo = Woyo::Character.new(:boss)
|
14
|
+
wo.name.should eq 'Boss'
|
15
|
+
end
|
16
|
+
|
12
17
|
it 'accepts world for parameter context:' do
|
13
18
|
wo = nil
|
14
19
|
expect { wo = Woyo::Character.new(:my_id, context: Woyo::World.new) }.to_not raise_error
|
data/spec/woyo/world/way_spec.rb
CHANGED
@@ -4,6 +4,16 @@ require 'woyo/world/way'
|
|
4
4
|
|
5
5
|
describe Woyo::Way do
|
6
6
|
|
7
|
+
it 'has attributes' do
|
8
|
+
expected_attrs = [:name,:description]
|
9
|
+
Woyo::Way.attributes.sort.should eq expected_attrs.sort
|
10
|
+
end
|
11
|
+
|
12
|
+
it 'name attribute defaults to id' do
|
13
|
+
wo = Woyo::Way.new(:door)
|
14
|
+
wo.name.should eq 'Door'
|
15
|
+
end
|
16
|
+
|
7
17
|
it 'accepts location for parameter context:' do
|
8
18
|
wo = nil
|
9
19
|
expect { wo = Woyo::Way.new(:my_id, context: Woyo::Location.new(:here)) }.to_not raise_error
|
@@ -11,17 +21,25 @@ describe Woyo::Way do
|
|
11
21
|
wo.context.id.should eq :here
|
12
22
|
end
|
13
23
|
|
24
|
+
it 'is in a world' do
|
25
|
+
world = Woyo::World.new
|
26
|
+
here = Woyo::Location.new :here, context: world
|
27
|
+
door = Woyo::Way.new :door, context: here
|
28
|
+
door.world.should eq world
|
29
|
+
end
|
30
|
+
|
14
31
|
it 'leads from a location' do
|
15
32
|
here = Woyo::Location.new(:here)
|
16
33
|
door = Woyo::Way.new :door, context: here
|
17
34
|
door.from.should eq here
|
18
35
|
end
|
19
36
|
|
20
|
-
it '
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
37
|
+
it 'leads to a location' do
|
38
|
+
here = Woyo::Location.new(:here)
|
39
|
+
door = Woyo::Way.new :door, context: here do
|
40
|
+
to :away
|
41
|
+
end
|
42
|
+
door.to.should be_a Woyo::Location
|
25
43
|
end
|
26
44
|
|
27
45
|
end
|