summaryrefslogtreecommitdiffstats
path: root/spec/spot_spec.rb
blob: 1ed2b0381c6b71a4f487da0ffe9c3b9781d5632c (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 Iotas::Iota do
    #
    it "path construction" do
        class S<Iotas::Iota
            def add_iota s
            end
        end
        s0 = S.new 'top', nil
        s1 = S.new 'room0', s0
        s2 = S.new 'room1', s1
        s3 = S.new 'door', s2
        s3.path.should eql 'top/room0/room1/door'
        lambda { Iotas::Iota.new('do/or0', nil) }.should raise_error(Iotas::Exception)
        lambda { Iotas::Iota.new('/door0', nil) }.should raise_error(Iotas::Exception)
        lambda { Iotas::Iota.new('door0/', nil) }.should raise_error(Iotas::Exception)
    end
    #
end
#
# EOF