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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: edd8af266742263966f5cfce748a1dfa276cbd7e
4
- data.tar.gz: 471350862730c78129810d10441f59f3c93ed63e
3
+ metadata.gz: 41063454cff975a0e239285995c4458949d3e1bc
4
+ data.tar.gz: 1a522f3af72fee8f7ecbd05a6051f9ca23722def
5
5
  SHA512:
6
- metadata.gz: 840c1abdbd7f6119007bee50e8c9918ee223ad6bbb6c71ce9f71343bb5e146fa4e045b585ff3728f805c9b412d9bc9fd6d9a683d2e6efb48e3d8ffac8c8df94e
7
- data.tar.gz: b2fbd2587c3fa998da13095dade3a362f58f426a71b23eebb6dac5536466bd1e847ec779826998f4121c1fb79a8816294208b96dd8aacb1315aa477fcc6d6de8
6
+ metadata.gz: 535354c4f343bd4170b8541a40c5e9138133ee2c37181222fcd314cca57474dce395d313b816ba054983317bc14549691bdd57927fd1ead0378bde8fdfb4d28c
7
+ data.tar.gz: 102e073c0afc15ef768488ca1bb64f9b55e45d6b86540e7a984506aacbeb4affd4e11fc68147460d8e6570448f927459a683325374e84c3626542c8248fbd9b8
@@ -1,3 +1,3 @@
1
1
  module Woyo
2
- WORLD_VERSION = "0.0.3"
2
+ WORLD_VERSION = "0.0.4"
3
3
  end
@@ -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
@@ -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 'is in a world' do
21
- world = Woyo::World.new
22
- here = Woyo::Location.new :here, context: world
23
- door = Woyo::Way.new :door, context: here
24
- door.world.should eq world
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: woyo-world
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gerard Fowley