spec/woyo/world/character_spec.rb in woyo-world-0.0.3 vs spec/woyo/world/character_spec.rb in woyo-world-0.0.4
- old
+ new
@@ -7,9 +7,14 @@
it 'has attributes' do
expected_attrs = [:name,:description]
Woyo::Character.attributes.sort.should eq expected_attrs.sort
end
+ it 'name attribute defaults to id' do
+ wo = Woyo::Character.new(:boss)
+ wo.name.should eq 'Boss'
+ end
+
it 'accepts world for parameter context:' do
wo = nil
expect { wo = Woyo::Character.new(:my_id, context: Woyo::World.new) }.to_not raise_error
wo.context.should be_instance_of Woyo::World
end