Add a case to check session handling
This commit is contained in:
parent
f2926471bd
commit
68d07cd897
@ -44,7 +44,8 @@ module Teamocil
|
||||
@root = attrs["root"]
|
||||
@options = attrs["options"]
|
||||
@filters = attrs["filters"]
|
||||
@splits = attrs["splits"].each_with_index.map { |split, index| Split.new(self, index, split) }
|
||||
@splits = attrs["splits"] || []
|
||||
@splits = @splits.each_with_index.map { |split, index| Split.new(self, index, split) }
|
||||
@index = index
|
||||
@session = session
|
||||
|
||||
|
8
spec/fixtures/layouts.yml
vendored
8
spec/fixtures/layouts.yml
vendored
@ -33,3 +33,11 @@ two-windows-with-filters:
|
||||
- cmd: "echo 'foo'"
|
||||
- cmd: "echo 'foo again'"
|
||||
width: 50
|
||||
|
||||
three-windows-within-a-session:
|
||||
session:
|
||||
name: "my awesome session"
|
||||
windows:
|
||||
- name: "first window"
|
||||
- name: "second window"
|
||||
- name: "third window"
|
||||
|
@ -86,6 +86,13 @@ describe Teamocil::Layout do
|
||||
session.windows.last.splits.first.target.should == "bottom-right"
|
||||
end # }}}
|
||||
|
||||
it "should handle windows within a session" do # {{{
|
||||
layout = Teamocil::Layout.new(layouts["three-windows-within-a-session"], {})
|
||||
session = layout.compile!
|
||||
session.windows.length.should == 3
|
||||
session.name.should == "my awesome session"
|
||||
end # }}}
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user