terminitor 0.2.2 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/Gemfile.lock +6 -6
- data/README.md +57 -13
- data/lib/terminitor/abstract_core.rb +13 -7
- data/lib/terminitor/cores/mac_core.rb +7 -4
- data/lib/terminitor/dsl.rb +39 -37
- data/lib/terminitor/version.rb +1 -1
- data/terminitor.gemspec +2 -2
- data/test/abstract_core_test.rb +119 -60
- data/test/cli_test.rb +116 -83
- data/test/cores/mac_core_test.rb +110 -116
- data/test/dsl_test.rb +17 -3
- data/test/fixtures/bar.term +13 -1
- data/test/runner_test.rb +140 -152
- data/test/teststrap.rb +20 -2
- metadata +7 -17
data/test/cli_test.rb
CHANGED
@@ -1,52 +1,71 @@
|
|
1
1
|
require File.expand_path('../teststrap', __FILE__)
|
2
2
|
|
3
3
|
context "Terminitor" do
|
4
|
-
setup
|
5
|
-
|
6
|
-
|
7
|
-
|
4
|
+
setup do
|
5
|
+
@yaml = File.read(File.expand_path('../fixtures/foo.yml', __FILE__))
|
6
|
+
@template = File.read(File.expand_path('../../lib/templates/example.yml.tt', __FILE__))
|
7
|
+
FakeFS.activate!
|
8
|
+
FileUtils.mkdir_p(File.join(ENV["HOME"],'.terminitor'))
|
9
|
+
end
|
8
10
|
teardown { FakeFS.deactivate! }
|
9
11
|
|
10
12
|
context "help" do
|
11
13
|
setup { capture(:stdout) { Terminitor::Cli.start(['-h']) } }
|
12
|
-
asserts_topic.matches
|
13
|
-
asserts_topic.matches
|
14
|
-
asserts_topic.matches
|
14
|
+
asserts_topic.matches %r{start PROJECT_NAME}
|
15
|
+
asserts_topic.matches %r{init}
|
16
|
+
asserts_topic.matches %r{edit PROJECT_NAME}
|
15
17
|
end
|
16
18
|
|
17
19
|
context "list" do
|
18
|
-
setup
|
19
|
-
|
20
|
-
|
21
|
-
|
20
|
+
setup do
|
21
|
+
@path = "#{ENV['HOME']}/.terminitor/"
|
22
|
+
File.open(File.join(@path,'foo.yml'),"w") { |f| f.puts @template }
|
23
|
+
File.open(File.join(@path,'bar.yml'),"w") { |f| f.puts @template }
|
24
|
+
capture(:stdout) { Terminitor::Cli.start(['list']) }
|
25
|
+
end
|
22
26
|
asserts_topic.matches %r{foo - COMMENT OF SCRIPT HERE}
|
23
27
|
asserts_topic.matches %r{bar - COMMENT OF SCRIPT HERE}
|
24
28
|
end
|
25
29
|
|
26
|
-
|
27
|
-
|
28
|
-
|
30
|
+
asserts "#init creates .terminitor" do
|
31
|
+
capture(:stdout) { Terminitor::Cli.start(['init']) }
|
32
|
+
File.exists?("#{ENV['HOME']}/.terminitor")
|
29
33
|
end
|
30
34
|
|
31
35
|
context "edit" do
|
32
|
-
setup
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
36
|
+
setup do
|
37
|
+
FakeFS.deactivate!
|
38
|
+
`rm -rf #{ENV['HOME']}/.terminitor/test_foo_bar2.yml`
|
39
|
+
`rm -rf #{ENV['HOME']}/.terminitor/test_foo_bar2.term`
|
40
|
+
end
|
41
|
+
|
42
|
+
teardown do
|
43
|
+
`rm -rf /tmp/sample_project`
|
44
|
+
`rm -rf #{ENV['HOME']}/.terminitor/test_foo_bar2.yml`
|
45
|
+
`rm -rf #{ENV['HOME']}/.terminitor/test_foo_bar2.term`
|
46
|
+
end
|
47
|
+
|
38
48
|
context "for project" do
|
49
|
+
|
39
50
|
context "for yaml" do
|
40
|
-
setup
|
41
|
-
|
51
|
+
setup do
|
52
|
+
capture(:stdout) do
|
53
|
+
mock.instance_of(Terminitor::Cli).open_in_editor("#{ENV['HOME']}/.terminitor/test_foo_bar2.yml",nil) { true }.once
|
54
|
+
Terminitor::Cli.start(['edit','test_foo_bar2', '-s=yml'])
|
55
|
+
end
|
56
|
+
end
|
42
57
|
asserts_topic.matches %r{create}
|
43
58
|
asserts_topic.matches %r{test_foo_bar2.yml}
|
44
|
-
asserts("has
|
59
|
+
asserts("has yml template") { File.read(File.join(ENV['HOME'],'.terminitor','test_foo_bar2.yml')) }.matches %r{- tab1}
|
45
60
|
end
|
46
61
|
|
47
62
|
context "for term" do
|
48
|
-
setup
|
49
|
-
|
63
|
+
setup do
|
64
|
+
capture(:stdout) do
|
65
|
+
mock.instance_of(Terminitor::Cli).open_in_editor("#{ENV['HOME']}/.terminitor/test_foo_bar2.term",nil) { true }.once
|
66
|
+
Terminitor::Cli.start(['edit','test_foo_bar2', '-s=term'])
|
67
|
+
end
|
68
|
+
end
|
50
69
|
asserts_topic.matches %r{create}
|
51
70
|
asserts_topic.matches %r{test_foo_bar2.term}
|
52
71
|
asserts("has term template") { File.read(File.join(ENV['HOME'],'.terminitor','test_foo_bar2.term')) }.matches %r{setup}
|
@@ -55,93 +74,107 @@ context "Terminitor" do
|
|
55
74
|
end
|
56
75
|
|
57
76
|
context "for Termfile" do
|
58
|
-
setup
|
59
|
-
|
77
|
+
setup do
|
78
|
+
capture(:stdout) do
|
79
|
+
mock.instance_of(Terminitor::Cli).open_in_editor("/tmp/sample_project/Termfile",nil) { true }.once
|
80
|
+
Terminitor::Cli.start ['edit','-s=yml','-r=/tmp/sample_project']
|
81
|
+
end
|
82
|
+
end
|
60
83
|
asserts_topic.matches %r{create}
|
61
84
|
asserts_topic.matches %r{Termfile}
|
62
85
|
asserts("has term template") { File.read('/tmp/sample_project/Termfile') }.matches %r{setup}
|
63
86
|
end
|
64
87
|
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
88
|
+
should "accept editor flag" do
|
89
|
+
FileUtils.mkdir_p('/tmp/sample_project')
|
90
|
+
capture(:stdout) do
|
91
|
+
mock.instance_of(Terminitor::Cli).open_in_editor('/tmp/sample_project/Termfile','nano') { true }.once
|
92
|
+
Terminitor::Cli.start(['edit','-r=/tmp/sample_project','-c=nano'])
|
93
|
+
end
|
69
94
|
end
|
70
95
|
|
71
|
-
context "for capture flag" do
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
end
|
96
|
+
context "for capture flag" do
|
97
|
+
|
98
|
+
asserts "yaml returns a message that" do
|
99
|
+
capture(:stdout) { Terminitor::Cli.start(['edit','foobar', '-s=yml', '--capture']) }
|
100
|
+
end.matches %r{Terminal settings can be captured only to DSL format.}
|
76
101
|
|
77
|
-
context "for term" do
|
78
|
-
context "with no core returned" do
|
79
|
-
setup { mock.instance_of(Terminitor::Cli).capture_core(anything) { nil } }
|
80
|
-
setup { FileUtils.touch("#{ENV['HOME']}/.terminitor/delete_this.term") }
|
81
|
-
setup { capture(:stdout) { Terminitor::Cli.start(['edit', 'test_foo_bar2', '--capture']) } }
|
82
|
-
asserts_topic.matches %r{No suitable core found!}
|
83
|
-
end
|
102
|
+
context "for term" do
|
84
103
|
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
mock.instance_of(Terminitor::Cli).open_in_editor("#{ENV['HOME']}/.terminitor/test_foo_bar2.term",nil) { true }
|
104
|
+
asserts "with no core returns a message that" do
|
105
|
+
capture(:stdout) do
|
106
|
+
mock.instance_of(Terminitor::Cli).capture_core(anything) { nil }
|
107
|
+
FileUtils.touch("#{ENV['HOME']}/.terminitor/delete_this.term")
|
108
|
+
Terminitor::Cli.start(['edit', 'test_foo_bar2', '--capture'])
|
91
109
|
end
|
92
|
-
|
110
|
+
end.matches %r{No suitable core found!}
|
111
|
+
|
112
|
+
|
113
|
+
asserts "with core that it executes" do
|
114
|
+
mock.instance_of(Terminitor::Cli).capture_core(anything) { mock!.new.mock!.capture_settings { "settings"} }
|
115
|
+
mock.instance_of(Terminitor::Cli).open_in_editor("#{ENV['HOME']}/.terminitor/test_foo_bar2.term",nil) { true }
|
116
|
+
Terminitor::Cli.start(['edit','test_foo_bar2', '--capture'])
|
93
117
|
end
|
118
|
+
|
94
119
|
end
|
95
120
|
end
|
96
121
|
|
97
122
|
end
|
98
123
|
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
context "open" do
|
106
|
-
setup { mock.instance_of(Terminitor::Cli).invoke(:edit, [""], {'syntax' => 'term', 'root' => '/tmp/sample_project'}) { true }.once }
|
107
|
-
setup { capture(:stdout) { Terminitor::Cli.start(['open','-r=/tmp/sample_project']) } }
|
108
|
-
asserts_topic.matches %r{'open' is now deprecated. Please use 'edit' instead}
|
124
|
+
asserts "#create calls edit" do
|
125
|
+
capture(:stdout) do
|
126
|
+
mock.instance_of(Terminitor::Cli).invoke(:edit, [], 'root' => '/tmp/sample_project') { true }.once
|
127
|
+
Terminitor::Cli.start(['create','-r=/tmp/sample_project'])
|
128
|
+
end
|
109
129
|
end
|
110
130
|
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
131
|
+
asserts "#open returns a message that" do
|
132
|
+
capture(:stdout) do
|
133
|
+
mock.instance_of(Terminitor::Cli).invoke(:edit, [""], {'syntax' => 'term', 'root' => '/tmp/sample_project'}) { true }.once
|
134
|
+
Terminitor::Cli.start(['open','-r=/tmp/sample_project'])
|
135
|
+
end
|
136
|
+
end.matches %r{'open' is now deprecated. Please use 'edit' instead}
|
137
|
+
|
138
|
+
context "#delete" do
|
139
|
+
denies "Termfile exists" do
|
140
|
+
FileUtils.mkdir_p '/tmp/sample_project'
|
141
|
+
FileUtils.touch "/tmp/sample_project/Termfile"
|
142
|
+
capture(:stdout) { Terminitor::Cli.start(['delete',"-r=/tmp/sample_project"]) }
|
143
|
+
File.exists? "/tmp/sample_project/Termfile"
|
117
144
|
end
|
118
145
|
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
146
|
+
denies "yaml exists" do
|
147
|
+
FileUtils.touch "#{ENV['HOME']}/.terminitor/delete_this.yml"
|
148
|
+
capture(:stdout) { Terminitor::Cli.start(['delete','delete_this', '-s=yml']) }
|
149
|
+
File.exists? "#{ENV['HOME']}/.terminitor/delete_this.yml"
|
123
150
|
end
|
124
151
|
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
152
|
+
denies "term exists" do
|
153
|
+
FileUtils.touch "#{ENV['HOME']}/.terminitor/delete_this.term"
|
154
|
+
capture(:stdout) { Terminitor::Cli.start(['delete','delete_this']) }
|
155
|
+
File.exists? "#{ENV['HOME']}/.terminitor/delete_this.term"
|
129
156
|
end
|
130
157
|
end
|
131
158
|
|
132
|
-
|
133
|
-
|
134
|
-
|
159
|
+
asserts "#setup calls #execute_core" do
|
160
|
+
capture(:stdout) do
|
161
|
+
mock.instance_of(Terminitor::Cli).execute_core(:setup!,'project') { true }
|
162
|
+
Terminitor::Cli.start(['setup','project'])
|
163
|
+
end
|
135
164
|
end
|
136
165
|
|
137
166
|
|
138
|
-
|
139
|
-
|
140
|
-
|
167
|
+
asserts "#start calls #execute_core" do
|
168
|
+
capture(:stdout) do
|
169
|
+
mock.instance_of(Terminitor::Cli).execute_core(:process!,'project') { true }
|
170
|
+
Terminitor::Cli.start(['start','project'])
|
171
|
+
end
|
141
172
|
end
|
142
173
|
|
143
|
-
|
144
|
-
|
145
|
-
|
174
|
+
asserts "#fetch runs setup in project diretory" do
|
175
|
+
capture(:stdout) do
|
176
|
+
mock.instance_of(Terminitor::Cli).github_repo('achiu','terminitor', 'root' => '.', 'setup' => true) { true }
|
177
|
+
Terminitor::Cli.start ['fetch','achiu','terminitor']
|
178
|
+
end
|
146
179
|
end
|
147
180
|
end
|
data/test/cores/mac_core_test.rb
CHANGED
@@ -2,161 +2,155 @@ require File.expand_path('../../teststrap',__FILE__)
|
|
2
2
|
|
3
3
|
if platform?("darwin") # Only run test if it's darwin
|
4
4
|
context "MacCore" do
|
5
|
-
# Stub out the initialization
|
6
5
|
setup do
|
7
|
-
terminal = Object.new
|
8
|
-
stub(terminal).windows { true }
|
9
6
|
any_instance_of(Terminitor::MacCore) do |core|
|
10
|
-
stub(core).app('Terminal')
|
11
|
-
stub(core).load_termfile('/path/to')
|
12
|
-
end
|
7
|
+
stub(core).app('Terminal') { mock!.windows { true } }
|
8
|
+
stub(core).load_termfile('/path/to') { true }
|
9
|
+
end
|
10
|
+
@mac_core = Terminitor::MacCore.new('/path/to')
|
13
11
|
end
|
14
|
-
setup { @mac_core = Terminitor::MacCore.new('/path/to') }
|
15
12
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
mock(@mac_core).app('System Events') { process }
|
21
|
-
end
|
22
|
-
asserts("calls System Events") { @mac_core.terminal_process }
|
13
|
+
asserts "#terminal_process calls System Events" do
|
14
|
+
core = topic.dup
|
15
|
+
mock(core).app('System Events') { mock!.application_processes.returns("Terminal.app" => true) }
|
16
|
+
core.terminal_process
|
23
17
|
end
|
24
18
|
|
25
|
-
context "open_tab" do
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
mock(
|
30
|
-
mock(
|
19
|
+
context "#open_tab" do
|
20
|
+
|
21
|
+
should "return the last tab" do
|
22
|
+
core = topic.dup
|
23
|
+
mock(core).return_last_tab { true }
|
24
|
+
mock(core).terminal_process { mock!.keystroke('t', :using => :command_down) }
|
25
|
+
core.open_tab
|
31
26
|
end
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
mock(@mac_core).set_options(true, :option1 => '1', :option2 => '2')
|
40
|
-
mock(@mac_core).return_last_tab.times(2) { true }
|
41
|
-
mock(@mac_core).terminal_process { process }
|
27
|
+
|
28
|
+
should "return last tab with options" do
|
29
|
+
core = topic.dup
|
30
|
+
mock(core).set_options(true, :option1 => '1', :option2 => '2')
|
31
|
+
mock(core).return_last_tab.times(2) { true }
|
32
|
+
mock(core).terminal_process { mock!.keystroke('t', :using => :command_down) }
|
33
|
+
core.open_tab(:option1 => '1', :option2 => '2')
|
42
34
|
end
|
43
|
-
asserts("returns last tab") { @mac_core.open_tab(:option1 => '1', :option2 => '2') }
|
44
35
|
end
|
45
36
|
|
46
|
-
context "open_window" do
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
mock(
|
51
|
-
mock(
|
37
|
+
context "#open_window" do
|
38
|
+
|
39
|
+
should "return the last tab" do
|
40
|
+
core = topic.dup
|
41
|
+
mock(core).return_last_tab { true }
|
42
|
+
mock(core).terminal_process { mock!.keystroke('n', :using => :command_down) }
|
43
|
+
core.open_window
|
52
44
|
end
|
53
|
-
asserts("returns last tab") { @mac_core.open_window }
|
54
|
-
end
|
55
45
|
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
mock(
|
62
|
-
mock(
|
63
|
-
|
64
|
-
mock(@mac_core).active_window { window }
|
65
|
-
mock(@mac_core).return_last_tab { tab }.times(2)
|
66
|
-
mock(@mac_core).terminal_process { process }
|
46
|
+
should "open window with options" do
|
47
|
+
core, window, tab = topic.dup, stub!, stub!
|
48
|
+
mock(core).set_options(window, :bounds => '1')
|
49
|
+
mock(core).set_options(tab, :settings => "2")
|
50
|
+
mock(core).active_window { window }
|
51
|
+
mock(core).return_last_tab { tab }.times(2)
|
52
|
+
mock(core).terminal_process { mock!.keystroke('n', :using => :command_down) }
|
53
|
+
core.open_window :bounds => '1', :settings => '2'
|
67
54
|
end
|
68
|
-
asserts("opens window with options") { @mac_core.open_window(:bounds => '1', :settings => '2')}
|
69
55
|
end
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
mock(window).tabs { [tab] }
|
77
|
-
mock(@mac_core).active_window { window }
|
78
|
-
end
|
79
|
-
asserts("returns tab") { @mac_core.return_last_tab }
|
56
|
+
|
57
|
+
asserts "#return_last_tab returns the last tab" do
|
58
|
+
core, tab = topic.dup, mock!
|
59
|
+
mock(tab).get { true }
|
60
|
+
mock(core).active_window { mock!.tabs.returns([tab]) }
|
61
|
+
core.return_last_tab
|
80
62
|
end
|
81
63
|
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
mock(@mac_core).active_window { window }
|
87
|
-
end
|
88
|
-
asserts("baby") { @mac_core.execute_command('hasta', :in => :la_vista) }
|
64
|
+
asserts "#execute_command executes" do
|
65
|
+
core = topic.dup
|
66
|
+
mock(core).active_window { mock!.do_script("hasta", :in => :la_vista).returns(true) }
|
67
|
+
core.execute_command('hasta', :in => :la_vista)
|
89
68
|
end
|
90
69
|
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
stub(
|
97
|
-
stub(
|
98
|
-
any_instance_of(Terminitor::MacCore) do |core|
|
99
|
-
stub(core).app('Terminal') { terminal }
|
100
|
-
stub(core).load_termfile('/path/to') { true }
|
101
|
-
end
|
70
|
+
asserts "#active_window gives window" do
|
71
|
+
window, app_object = Object.new, Object.new
|
72
|
+
mock(app_object).get { {:frontmost => true} }
|
73
|
+
mock(window).properties_ { app_object }
|
74
|
+
any_instance_of(Terminitor::MacCore) do |core|
|
75
|
+
stub(core).app('Terminal') { stub!.windows { stub!.get.returns([window]) } }
|
76
|
+
stub(core).load_termfile('/path/to') { true }
|
102
77
|
end
|
103
|
-
|
78
|
+
Terminitor::MacCore.new('/path/to').active_window
|
104
79
|
end
|
105
|
-
|
80
|
+
|
81
|
+
|
106
82
|
context "set_options" do
|
107
83
|
setup do
|
108
|
-
@object, @terminal, @windows= 3.times.collect { Object.new }
|
84
|
+
@object, @terminal, @windows= 3.times.collect { Object.new }
|
85
|
+
stub(@terminal).windows { @windows }
|
109
86
|
any_instance_of(Terminitor::MacCore) do |core|
|
110
|
-
stub(core).app('Terminal')
|
111
|
-
stub(core).load_termfile('/path/to')
|
87
|
+
stub(core).app('Terminal') { @terminal }
|
88
|
+
stub(core).load_termfile('/path/to') { true }
|
112
89
|
end
|
113
|
-
stub(@terminal).windows { @windows }
|
114
90
|
end
|
115
91
|
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
context "invalid settings set" do
|
125
|
-
setup do
|
92
|
+
should "apply known valid settings" do
|
93
|
+
stub(@terminal).settings_sets { { :valid_settings => true } }
|
94
|
+
stub(@object).current_settings.stub!.set(anything) { true }
|
95
|
+
Terminitor::MacCore.new('/path/to').set_options(@object, :settings => :valid_settings)
|
96
|
+
end
|
97
|
+
|
98
|
+
context "invalid settings" do
|
99
|
+
should "return a error message that" do
|
126
100
|
stub(@terminal).settings_sets {{:invalid_settings => true}}
|
127
101
|
stub(Object).raise
|
128
102
|
stub(@object).current_settings.stub!.set(anything) { raise Appscript::CommandError.new("code","error","object","reference", "command") }
|
129
|
-
|
130
|
-
|
131
|
-
asserts_topic.matches %r{invalid settings set}
|
103
|
+
capture(:stdout) { Terminitor::MacCore.new('/path/to').set_options(@object, :settings => :invalid_settings) }
|
104
|
+
end.matches %r{Error: invalid settings}
|
132
105
|
end
|
133
|
-
|
134
|
-
context "
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
106
|
+
|
107
|
+
context "name option" do
|
108
|
+
should "ignore :name" do
|
109
|
+
capture(:stdout) { Terminitor::MacCore.new('/path/to').set_options(@object, :name => 'hihi') }
|
110
|
+
end.matches ""
|
111
|
+
end
|
112
|
+
|
113
|
+
context "bounds" do
|
114
|
+
|
115
|
+
should "set bounds" do
|
116
|
+
stub(@object).bounds.stub!.set(true)
|
117
|
+
stub(@object).frame.stub!.set(true)
|
118
|
+
stub(@object).position.stub!.set(true)
|
119
|
+
Terminitor::MacCore.new('/path/to').set_options(@object, :bounds => true)
|
120
|
+
end
|
121
|
+
|
141
122
|
end
|
142
123
|
|
143
|
-
context "unknown option" do
|
144
|
-
|
124
|
+
context "unknown option" do
|
125
|
+
|
126
|
+
should "return a message" do
|
145
127
|
stub(Object).raise
|
146
128
|
stub(@object).unknown_option.stub!.set(anything) { raise Appscript::CommandError.new("code","error","object","reference", "command") }
|
147
|
-
|
148
|
-
|
149
|
-
|
129
|
+
capture(:stdout) { Terminitor::MacCore.new('/path/to').set_options(@object, :unknown_option => true)}
|
130
|
+
end.matches %r{Error}
|
131
|
+
|
150
132
|
end
|
151
133
|
|
152
|
-
context "
|
153
|
-
|
154
|
-
|
155
|
-
|
134
|
+
context "selected" do
|
135
|
+
should "set :selected" do
|
136
|
+
mock(@object).selected.mock!.set(true)
|
137
|
+
core = Terminitor::MacCore.new('/path/to')
|
138
|
+
core.set_options(@object, :selected => true)
|
139
|
+
core.set_delayed_options
|
140
|
+
end
|
141
|
+
end
|
142
|
+
|
143
|
+
context "miniaturized" do
|
144
|
+
should "set :miniaturized" do
|
145
|
+
mock(@object).miniaturized.mock!.set(true)
|
146
|
+
core = Terminitor::MacCore.new('/path/to')
|
147
|
+
core.set_options(@object, :miniaturized => true)
|
148
|
+
core.set_delayed_options
|
156
149
|
end
|
157
|
-
asserts("sets delayed options") { @mac_core.set_delayed_options }
|
158
150
|
end
|
151
|
+
|
159
152
|
end
|
153
|
+
|
160
154
|
end
|
161
155
|
else
|
162
156
|
context "MacCore" do
|