spec/woyo/world/location_spec.rb in woyo-world-0.0.1 vs spec/woyo/world/location_spec.rb in woyo-world-0.0.2

- old
+ new

@@ -2,9 +2,19 @@ require 'woyo/world/location' require 'woyo/world/way' describe Woyo::Location do + it 'has attributes' do + expected_attrs = [:name,:description] + Woyo::Location.attributes.sort.should eq expected_attrs.sort + end + + it 'name attribute defaults to id' do + wo = Woyo::Location.new(:home) + wo.name.should eq 'Home' + end + it 'accepts world for parameter context:' do wo = nil expect { wo = Woyo::Location.new(:my_id, context: Woyo::World.new) }.to_not raise_error wo.context.should be_instance_of Woyo::World end