summaryrefslogtreecommitdiffstats
path: root/spec/spot_spec.rb
blob: b33acb2291de5ba359cf447e176abeacc3e2edb7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#! /usr/bin/env ruby
# -*- coding: UTF-8 -*-
#

require 'spec_helper'
#
describe EvenDoors::Spot do
    #
    before(:each) do
        EvenDoors::Spin.clear!
    end
    #
    it "path construction" do
        s0 = EvenDoors::Spot.new 'top', nil
        s1 = EvenDoors::Spot.new 'room0', s0
        s2 = EvenDoors::Spot.new 'room1', s1
        s3 = EvenDoors::Spot.new 'door', s2
        s3.path.should eql 'top/room0/room1/door'
        lambda { EvenDoors::Spot.new('do/or0', nil) }.should raise_error(EvenDoors::Exception)
        lambda { EvenDoors::Spot.new('/door0', nil) }.should raise_error(EvenDoors::Exception)
        lambda { EvenDoors::Spot.new('door0/', nil) }.should raise_error(EvenDoors::Exception)
    end
    #
end
#
# EOF