216 |
def test_9_slot_links |
def test_9_slot_links |
217 |
bus = FreeBASE::DataBus.new |
bus = FreeBASE::DataBus.new |
218 |
parent = bus["parent"] |
parent = bus["parent"] |
219 |
parent.link("child", "/parent2/child2") |
notify_link = false |
220 |
assert_equal('/parent2/child2/', bus["/parent/child"].path) |
|
221 |
assert(parent.is_linked?('child')) |
bus['parent'].subscribe do |event, slot| |
222 |
parent.unlink('child') |
notify_link = true if link = :notify_slot_link |
223 |
|
end |
224 |
|
child = parent.link("child", "/parent2/child2") |
225 |
assert_equal('/parent/child/', bus["/parent/child"].path) |
assert_equal('/parent/child/', bus["/parent/child"].path) |
226 |
assert(!parent.is_linked?('child')) |
assert_equal('/parent2/child2/subslot/', bus["/parent/child/subslot"].path) |
227 |
|
assert(parent['child'].is_link_slot?) |
228 |
|
assert(notify_link) |
229 |
|
parent['child'].unlink |
230 |
|
assert_equal('/parent/child/subslot/', bus["/parent/child/subslot"].path) |
231 |
|
assert(!parent['child'].is_link_slot?) |
232 |
end |
end |
233 |
|
|
234 |
end |
end |