Sha256: e0ab2fd7c2de38e6fae3e4eeefda7138f4fa727990815ef268606c77d55d4806

Contents?: true

Size: 994 Bytes

Versions: 1

Compression:

Stored size: 994 Bytes

Contents

require 'spec_helper'
require 'woyo/world/world'
require 'woyo/world/item'

describe Woyo::Item do

  context 'in world' do

    let(:item) { Woyo::Item.new :thing, context: Woyo::World.new }

    it 'accepts world for parameter context' do
      expect(item.context).to be_instance_of Woyo::World
    end

    it '#world' do
      expect(item.world).to be_instance_of Woyo::World
    end

    it '#location' do
      expect(item.location).to be_nil
    end

  end

  context 'in a location' do

    let(:item) { Woyo::Item.new :thing, context: Woyo::Location.new(:here, context: Woyo::World.new) }

    it 'accepts location for parameter context:' do
      expect(item.context).to be_instance_of Woyo::Location
      expect(item.context.id).to eq :here
    end

    it '#location' do
      expect(item.location).to be_instance_of Woyo::Location
      expect(item.location.id).to eq :here
    end

    it '#world' do
      expect(item.world).to be_instance_of Woyo::World
    end

  end

end
 

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
woyo-world-0.0.7 spec/woyo/world/item_spec.rb