t 2.0.1 → 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/spec/delete_spec.rb CHANGED
@@ -4,7 +4,7 @@ require 'helper'
4
4
  describe T::Delete do
5
5
 
6
6
  before :each do
7
- T::RCFile.instance.path = fixture_path + "/.trc"
7
+ T::RCFile.instance.path = fixture_path + '/.trc'
8
8
  @delete = T::Delete.new
9
9
  @old_stderr = $stderr
10
10
  $stderr = StringIO.new
@@ -18,218 +18,218 @@ describe T::Delete do
18
18
  $stdout = @old_stdout
19
19
  end
20
20
 
21
- describe "#block" do
21
+ describe '#block' do
22
22
  before do
23
- @delete.options = @delete.options.merge("profile" => fixture_path + "/.trc")
24
- stub_post("/1.1/blocks/destroy.json").with(:body => {:screen_name => "sferik"}).to_return(:body => fixture("sferik.json"))
23
+ @delete.options = @delete.options.merge('profile' => fixture_path + '/.trc')
24
+ stub_post('/1.1/blocks/destroy.json').with(:body => {:screen_name => 'sferik'}).to_return(:body => fixture('sferik.json'))
25
25
  end
26
- it "requests the correct resource" do
27
- @delete.block("sferik")
28
- expect(a_post("/1.1/blocks/destroy.json").with(:body => {:screen_name => "sferik"})).to have_been_made
26
+ it 'requests the correct resource' do
27
+ @delete.block('sferik')
28
+ expect(a_post('/1.1/blocks/destroy.json').with(:body => {:screen_name => 'sferik'})).to have_been_made
29
29
  end
30
- it "has the correct output" do
31
- @delete.block("sferik")
30
+ it 'has the correct output' do
31
+ @delete.block('sferik')
32
32
  expect($stdout.string).to match /^@testcli unblocked 1 user\.$/
33
33
  end
34
- context "--id" do
34
+ context '--id' do
35
35
  before do
36
- @delete.options = @delete.options.merge("id" => true)
37
- stub_post("/1.1/blocks/destroy.json").with(:body => {:user_id => "7505382"}).to_return(:body => fixture("sferik.json"))
36
+ @delete.options = @delete.options.merge('id' => true)
37
+ stub_post('/1.1/blocks/destroy.json').with(:body => {:user_id => '7505382'}).to_return(:body => fixture('sferik.json'))
38
38
  end
39
- it "requests the correct resource" do
40
- @delete.block("7505382")
41
- expect(a_post("/1.1/blocks/destroy.json").with(:body => {:user_id => "7505382"})).to have_been_made
39
+ it 'requests the correct resource' do
40
+ @delete.block('7505382')
41
+ expect(a_post('/1.1/blocks/destroy.json').with(:body => {:user_id => '7505382'})).to have_been_made
42
42
  end
43
43
  end
44
44
  end
45
45
 
46
- describe "#dm" do
46
+ describe '#dm' do
47
47
  before do
48
- @delete.options = @delete.options.merge("profile" => fixture_path + "/.trc")
49
- stub_get("/1.1/direct_messages/show.json").with(:query => {:id => "1773478249"}).to_return(:body => fixture("direct_message.json"))
50
- stub_post("/1.1/direct_messages/destroy.json").with(:body => {:id => "1773478249"}).to_return(:body => fixture("direct_message.json"))
48
+ @delete.options = @delete.options.merge('profile' => fixture_path + '/.trc')
49
+ stub_get('/1.1/direct_messages/show.json').with(:query => {:id => '1773478249'}).to_return(:body => fixture('direct_message.json'))
50
+ stub_post('/1.1/direct_messages/destroy.json').with(:body => {:id => '1773478249'}).to_return(:body => fixture('direct_message.json'))
51
51
  end
52
- it "requests the correct resource" do
52
+ it 'requests the correct resource' do
53
53
  expect($stdout).to receive(:print).with("Are you sure you want to permanently delete the direct message to @pengwynn: \"Creating a fixture for the Twitter gem\"? [y/N] ")
54
- expect($stdin).to receive(:gets).and_return("yes")
55
- @delete.dm("1773478249")
56
- expect(a_get("/1.1/direct_messages/show.json").with(:query => {:id => "1773478249"})).to have_been_made
57
- expect(a_post("/1.1/direct_messages/destroy.json").with(:body => {:id => "1773478249"})).to have_been_made
54
+ expect($stdin).to receive(:gets).and_return('yes')
55
+ @delete.dm('1773478249')
56
+ expect(a_get('/1.1/direct_messages/show.json').with(:query => {:id => '1773478249'})).to have_been_made
57
+ expect(a_post('/1.1/direct_messages/destroy.json').with(:body => {:id => '1773478249'})).to have_been_made
58
58
  end
59
- context "yes" do
60
- it "has the correct output" do
59
+ context 'yes' do
60
+ it 'has the correct output' do
61
61
  expect($stdout).to receive(:print).with("Are you sure you want to permanently delete the direct message to @pengwynn: \"Creating a fixture for the Twitter gem\"? [y/N] ")
62
- expect($stdin).to receive(:gets).and_return("yes")
63
- @delete.dm("1773478249")
62
+ expect($stdin).to receive(:gets).and_return('yes')
63
+ @delete.dm('1773478249')
64
64
  expect($stdout.string.chomp).to eq "@testcli deleted the direct message sent to @pengwynn: \"Creating a fixture for the Twitter gem\""
65
65
  end
66
66
  end
67
- context "no" do
68
- it "has the correct output" do
67
+ context 'no' do
68
+ it 'has the correct output' do
69
69
  expect($stdout).to receive(:print).with("Are you sure you want to permanently delete the direct message to @pengwynn: \"Creating a fixture for the Twitter gem\"? [y/N] ")
70
- expect($stdin).to receive(:gets).and_return("no")
71
- @delete.dm("1773478249")
70
+ expect($stdin).to receive(:gets).and_return('no')
71
+ @delete.dm('1773478249')
72
72
  expect($stdout.string.chomp).to be_empty
73
73
  end
74
74
  end
75
- context "--force" do
75
+ context '--force' do
76
76
  before do
77
- @delete.options = @delete.options.merge("force" => true)
77
+ @delete.options = @delete.options.merge('force' => true)
78
78
  end
79
- it "requests the correct resource" do
80
- @delete.dm("1773478249")
81
- expect(a_post("/1.1/direct_messages/destroy.json").with(:body => {:id => "1773478249"})).to have_been_made
79
+ it 'requests the correct resource' do
80
+ @delete.dm('1773478249')
81
+ expect(a_post('/1.1/direct_messages/destroy.json').with(:body => {:id => '1773478249'})).to have_been_made
82
82
  end
83
- it "has the correct output" do
84
- @delete.dm("1773478249")
83
+ it 'has the correct output' do
84
+ @delete.dm('1773478249')
85
85
  expect($stdout.string.chomp).to eq "@testcli deleted the direct message sent to @pengwynn: \"Creating a fixture for the Twitter gem\""
86
86
  end
87
87
  end
88
88
  end
89
89
 
90
- describe "#favorite" do
90
+ describe '#favorite' do
91
91
  before do
92
- @delete.options = @delete.options.merge("profile" => fixture_path + "/.trc")
93
- stub_get("/1.1/statuses/show/28439861609.json").with(:query => {:include_my_retweet => "false"}).to_return(:body => fixture("status.json"))
94
- stub_post("/1.1/favorites/destroy.json").with(:body => {:id => "28439861609"}).to_return(:body => fixture("status.json"))
92
+ @delete.options = @delete.options.merge('profile' => fixture_path + '/.trc')
93
+ stub_get('/1.1/statuses/show/28439861609.json').with(:query => {:include_my_retweet => 'false'}).to_return(:body => fixture('status.json'))
94
+ stub_post('/1.1/favorites/destroy.json').with(:body => {:id => '28439861609'}).to_return(:body => fixture('status.json'))
95
95
  end
96
- it "requests the correct resource" do
96
+ it 'requests the correct resource' do
97
97
  expect($stdout).to receive(:print).with("Are you sure you want to remove @sferik's status: \"The problem with your code is that it's doing exactly what you told it to do.\" from your favorites? [y/N] ")
98
- expect($stdin).to receive(:gets).and_return("yes")
99
- @delete.favorite("28439861609")
100
- expect(a_get("/1.1/statuses/show/28439861609.json").with(:query => {:include_my_retweet => "false"})).to have_been_made
101
- expect(a_post("/1.1/favorites/destroy.json").with(:body => {:id => "28439861609"})).to have_been_made
98
+ expect($stdin).to receive(:gets).and_return('yes')
99
+ @delete.favorite('28439861609')
100
+ expect(a_get('/1.1/statuses/show/28439861609.json').with(:query => {:include_my_retweet => 'false'})).to have_been_made
101
+ expect(a_post('/1.1/favorites/destroy.json').with(:body => {:id => '28439861609'})).to have_been_made
102
102
  end
103
- context "yes" do
104
- it "has the correct output" do
103
+ context 'yes' do
104
+ it 'has the correct output' do
105
105
  expect($stdout).to receive(:print).with("Are you sure you want to remove @sferik's status: \"The problem with your code is that it's doing exactly what you told it to do.\" from your favorites? [y/N] ")
106
- expect($stdin).to receive(:gets).and_return("yes")
107
- @delete.favorite("28439861609")
106
+ expect($stdin).to receive(:gets).and_return('yes')
107
+ @delete.favorite('28439861609')
108
108
  expect($stdout.string).to match /^@testcli unfavorited @sferik's status: "The problem with your code is that it's doing exactly what you told it to do\."$/
109
109
  end
110
110
  end
111
- context "no" do
112
- it "has the correct output" do
111
+ context 'no' do
112
+ it 'has the correct output' do
113
113
  expect($stdout).to receive(:print).with("Are you sure you want to remove @sferik's status: \"The problem with your code is that it's doing exactly what you told it to do.\" from your favorites? [y/N] ")
114
- expect($stdin).to receive(:gets).and_return("no")
115
- @delete.favorite("28439861609")
114
+ expect($stdin).to receive(:gets).and_return('no')
115
+ @delete.favorite('28439861609')
116
116
  expect($stdout.string.chomp).to be_empty
117
117
  end
118
118
  end
119
- context "--force" do
119
+ context '--force' do
120
120
  before do
121
- @delete.options = @delete.options.merge("force" => true)
121
+ @delete.options = @delete.options.merge('force' => true)
122
122
  end
123
- it "requests the correct resource" do
124
- @delete.favorite("28439861609")
125
- expect(a_post("/1.1/favorites/destroy.json").with(:body => {:id => "28439861609"})).to have_been_made
123
+ it 'requests the correct resource' do
124
+ @delete.favorite('28439861609')
125
+ expect(a_post('/1.1/favorites/destroy.json').with(:body => {:id => '28439861609'})).to have_been_made
126
126
  end
127
- it "has the correct output" do
128
- @delete.favorite("28439861609")
127
+ it 'has the correct output' do
128
+ @delete.favorite('28439861609')
129
129
  expect($stdout.string).to match /^@testcli unfavorited @sferik's status: "The problem with your code is that it's doing exactly what you told it to do\."$/
130
130
  end
131
131
  end
132
132
  end
133
133
 
134
- describe "#list" do
134
+ describe '#list' do
135
135
  before do
136
- @delete.options = @delete.options.merge("profile" => fixture_path + "/.trc")
137
- stub_get("/1.1/account/verify_credentials.json").to_return(:body => fixture("sferik.json"))
138
- stub_get("/1.1/lists/show.json").with(:query => {:owner_screen_name => "sferik", :slug => 'presidents'}).to_return(:body => fixture("list.json"))
139
- stub_post("/1.1/lists/destroy.json").with(:body => {:owner_id => "7505382", :list_id => "8863586"}).to_return(:body => fixture("list.json"))
136
+ @delete.options = @delete.options.merge('profile' => fixture_path + '/.trc')
137
+ stub_get('/1.1/account/verify_credentials.json').to_return(:body => fixture('sferik.json'))
138
+ stub_get('/1.1/lists/show.json').with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents'}).to_return(:body => fixture('list.json'))
139
+ stub_post('/1.1/lists/destroy.json').with(:body => {:owner_id => '7505382', :list_id => '8863586'}).to_return(:body => fixture('list.json'))
140
140
  end
141
- it "requests the correct resource" do
141
+ it 'requests the correct resource' do
142
142
  expect($stdout).to receive(:print).with("Are you sure you want to permanently delete the list \"presidents\"? [y/N] ")
143
- expect($stdin).to receive(:gets).and_return("yes")
144
- @delete.list("presidents")
145
- expect(a_get("/1.1/account/verify_credentials.json")).to have_been_made
146
- expect(a_post("/1.1/lists/destroy.json").with(:body => {:owner_id => "7505382", :list_id => "8863586"})).to have_been_made
143
+ expect($stdin).to receive(:gets).and_return('yes')
144
+ @delete.list('presidents')
145
+ expect(a_get('/1.1/account/verify_credentials.json')).to have_been_made
146
+ expect(a_post('/1.1/lists/destroy.json').with(:body => {:owner_id => '7505382', :list_id => '8863586'})).to have_been_made
147
147
  end
148
- context "yes" do
149
- it "has the correct output" do
148
+ context 'yes' do
149
+ it 'has the correct output' do
150
150
  expect($stdout).to receive(:print).with("Are you sure you want to permanently delete the list \"presidents\"? [y/N] ")
151
- expect($stdin).to receive(:gets).and_return("yes")
152
- @delete.list("presidents")
151
+ expect($stdin).to receive(:gets).and_return('yes')
152
+ @delete.list('presidents')
153
153
  expect($stdout.string.chomp).to eq "@testcli deleted the list \"presidents\"."
154
154
  end
155
155
  end
156
- context "no" do
157
- it "has the correct output" do
156
+ context 'no' do
157
+ it 'has the correct output' do
158
158
  expect($stdout).to receive(:print).with("Are you sure you want to permanently delete the list \"presidents\"? [y/N] ")
159
- expect($stdin).to receive(:gets).and_return("no")
160
- @delete.list("presidents")
159
+ expect($stdin).to receive(:gets).and_return('no')
160
+ @delete.list('presidents')
161
161
  expect($stdout.string.chomp).to be_empty
162
162
  end
163
163
  end
164
- context "--force" do
164
+ context '--force' do
165
165
  before do
166
- @delete.options = @delete.options.merge("force" => true)
166
+ @delete.options = @delete.options.merge('force' => true)
167
167
  end
168
- it "requests the correct resource" do
169
- @delete.list("presidents")
170
- expect(a_get("/1.1/account/verify_credentials.json")).to have_been_made
171
- expect(a_post("/1.1/lists/destroy.json").with(:body => {:owner_id => "7505382", :list_id => "8863586"})).to have_been_made
168
+ it 'requests the correct resource' do
169
+ @delete.list('presidents')
170
+ expect(a_get('/1.1/account/verify_credentials.json')).to have_been_made
171
+ expect(a_post('/1.1/lists/destroy.json').with(:body => {:owner_id => '7505382', :list_id => '8863586'})).to have_been_made
172
172
  end
173
- it "has the correct output" do
174
- @delete.list("presidents")
173
+ it 'has the correct output' do
174
+ @delete.list('presidents')
175
175
  expect($stdout.string.chomp).to eq "@testcli deleted the list \"presidents\"."
176
176
  end
177
177
  end
178
- context "--id" do
178
+ context '--id' do
179
179
  before do
180
- @delete.options = @delete.options.merge("id" => true)
181
- stub_get("/1.1/lists/show.json").with(:query => {:owner_screen_name => "sferik", :list_id => "8863586"}).to_return(:body => fixture("list.json"))
180
+ @delete.options = @delete.options.merge('id' => true)
181
+ stub_get('/1.1/lists/show.json').with(:query => {:owner_screen_name => 'sferik', :list_id => '8863586'}).to_return(:body => fixture('list.json'))
182
182
  end
183
- it "requests the correct resource" do
183
+ it 'requests the correct resource' do
184
184
  expect($stdout).to receive(:print).with("Are you sure you want to permanently delete the list \"presidents\"? [y/N] ")
185
- expect($stdin).to receive(:gets).and_return("yes")
186
- @delete.list("8863586")
187
- expect(a_get("/1.1/lists/show.json").with(:query => {:owner_screen_name => "sferik", :list_id => "8863586"})).to have_been_made
188
- expect(a_get("/1.1/account/verify_credentials.json")).to have_been_made
189
- expect(a_post("/1.1/lists/destroy.json").with(:body => {:owner_id => "7505382", :list_id => "8863586"})).to have_been_made
185
+ expect($stdin).to receive(:gets).and_return('yes')
186
+ @delete.list('8863586')
187
+ expect(a_get('/1.1/lists/show.json').with(:query => {:owner_screen_name => 'sferik', :list_id => '8863586'})).to have_been_made
188
+ expect(a_get('/1.1/account/verify_credentials.json')).to have_been_made
189
+ expect(a_post('/1.1/lists/destroy.json').with(:body => {:owner_id => '7505382', :list_id => '8863586'})).to have_been_made
190
190
  end
191
191
  end
192
192
  end
193
193
 
194
- describe "#status" do
194
+ describe '#status' do
195
195
  before do
196
- @delete.options = @delete.options.merge("profile" => fixture_path + "/.trc")
197
- stub_get("/1.1/statuses/show/26755176471724032.json").with(:query => {:include_my_retweet => "false"}).to_return(:body => fixture("status.json"))
198
- stub_post("/1.1/statuses/destroy/26755176471724032.json").with(:body => {:trim_user => "true"}).to_return(:body => fixture("status.json"))
196
+ @delete.options = @delete.options.merge('profile' => fixture_path + '/.trc')
197
+ stub_get('/1.1/statuses/show/26755176471724032.json').with(:query => {:include_my_retweet => 'false'}).to_return(:body => fixture('status.json'))
198
+ stub_post('/1.1/statuses/destroy/26755176471724032.json').with(:body => {:trim_user => 'true'}).to_return(:body => fixture('status.json'))
199
199
  end
200
- it "requests the correct resource" do
200
+ it 'requests the correct resource' do
201
201
  expect($stdout).to receive(:print).with("Are you sure you want to permanently delete @sferik's status: \"The problem with your code is that it's doing exactly what you told it to do.\"? [y/N] ")
202
- expect($stdin).to receive(:gets).and_return("yes")
203
- @delete.status("26755176471724032")
204
- expect(a_get("/1.1/statuses/show/26755176471724032.json").with(:query => {:include_my_retweet => "false"})).to have_been_made
205
- expect(a_post("/1.1/statuses/destroy/26755176471724032.json").with(:body => {:trim_user => "true"})).to have_been_made
202
+ expect($stdin).to receive(:gets).and_return('yes')
203
+ @delete.status('26755176471724032')
204
+ expect(a_get('/1.1/statuses/show/26755176471724032.json').with(:query => {:include_my_retweet => 'false'})).to have_been_made
205
+ expect(a_post('/1.1/statuses/destroy/26755176471724032.json').with(:body => {:trim_user => 'true'})).to have_been_made
206
206
  end
207
- context "yes" do
208
- it "has the correct output" do
207
+ context 'yes' do
208
+ it 'has the correct output' do
209
209
  expect($stdout).to receive(:print).with("Are you sure you want to permanently delete @sferik's status: \"The problem with your code is that it's doing exactly what you told it to do.\"? [y/N] ")
210
- expect($stdin).to receive(:gets).and_return("yes")
211
- @delete.status("26755176471724032")
210
+ expect($stdin).to receive(:gets).and_return('yes')
211
+ @delete.status('26755176471724032')
212
212
  expect($stdout.string.chomp).to eq "@testcli deleted the Tweet: \"The problem with your code is that it's doing exactly what you told it to do.\""
213
213
  end
214
214
  end
215
- context "no" do
216
- it "has the correct output" do
215
+ context 'no' do
216
+ it 'has the correct output' do
217
217
  expect($stdout).to receive(:print).with("Are you sure you want to permanently delete @sferik's status: \"The problem with your code is that it's doing exactly what you told it to do.\"? [y/N] ")
218
- expect($stdin).to receive(:gets).and_return("no")
219
- @delete.status("26755176471724032")
218
+ expect($stdin).to receive(:gets).and_return('no')
219
+ @delete.status('26755176471724032')
220
220
  expect($stdout.string.chomp).to be_empty
221
221
  end
222
222
  end
223
- context "--force" do
223
+ context '--force' do
224
224
  before do
225
- @delete.options = @delete.options.merge("force" => true)
225
+ @delete.options = @delete.options.merge('force' => true)
226
226
  end
227
- it "requests the correct resource" do
228
- @delete.status("26755176471724032")
229
- expect(a_post("/1.1/statuses/destroy/26755176471724032.json").with(:body => {:trim_user => "true"})).to have_been_made
227
+ it 'requests the correct resource' do
228
+ @delete.status('26755176471724032')
229
+ expect(a_post('/1.1/statuses/destroy/26755176471724032.json').with(:body => {:trim_user => 'true'})).to have_been_made
230
230
  end
231
- it "has the correct output" do
232
- @delete.status("26755176471724032")
231
+ it 'has the correct output' do
232
+ @delete.status('26755176471724032')
233
233
  expect($stdout.string.chomp).to eq "@testcli deleted the Tweet: \"The problem with your code is that it's doing exactly what you told it to do.\""
234
234
  end
235
235
  end
data/spec/editor_spec.rb CHANGED
@@ -3,98 +3,98 @@ require 'helper'
3
3
 
4
4
  describe T::Editor do
5
5
 
6
- context "when editing a file" do
6
+ context 'when editing a file' do
7
7
  before do
8
8
  T::Editor.stub(:edit) do |path|
9
- File.open(path, "wb") do |f|
10
- f.write("A tweet!!!!")
9
+ File.open(path, 'wb') do |f|
10
+ f.write('A tweet!!!!')
11
11
  end
12
12
  end
13
13
  end
14
14
 
15
- it "fetches your tweet content without comments" do
16
- expect(T::Editor.gets).to eq("A tweet!!!!")
15
+ it 'fetches your tweet content without comments' do
16
+ expect(T::Editor.gets).to eq('A tweet!!!!')
17
17
  end
18
18
  end
19
19
 
20
- context "when fetching the editor to write in" do
21
- context "no $VISUAL or $EDITOR set" do
20
+ context 'when fetching the editor to write in' do
21
+ context 'no $VISUAL or $EDITOR set' do
22
22
  before do
23
- ENV["EDITOR"] = ENV["VISUAL"] = nil
23
+ ENV['EDITOR'] = ENV['VISUAL'] = nil
24
24
  end
25
25
 
26
- context "host_os is Mac OSX" do
27
- it "returns the system editor" do
28
- RbConfig::CONFIG['host_os'] = "darwin12.2.0"
29
- expect(T::Editor.editor).to eq("vi")
26
+ context 'host_os is Mac OSX' do
27
+ it 'returns the system editor' do
28
+ RbConfig::CONFIG['host_os'] = 'darwin12.2.0'
29
+ expect(T::Editor.editor).to eq('vi')
30
30
  end
31
31
  end
32
32
 
33
- context "host_os is Linux" do
34
- it "returns the system editor" do
35
- RbConfig::CONFIG['host_os'] = "3.2.0-4-amd64"
36
- expect(T::Editor.editor).to eq("vi")
33
+ context 'host_os is Linux' do
34
+ it 'returns the system editor' do
35
+ RbConfig::CONFIG['host_os'] = '3.2.0-4-amd64'
36
+ expect(T::Editor.editor).to eq('vi')
37
37
  end
38
38
  end
39
39
 
40
- context "host_os is Windows" do
41
- it "returns the system editor" do
42
- RbConfig::CONFIG['host_os'] = "mswin"
43
- expect(T::Editor.editor).to eq("notepad")
40
+ context 'host_os is Windows' do
41
+ it 'returns the system editor' do
42
+ RbConfig::CONFIG['host_os'] = 'mswin'
43
+ expect(T::Editor.editor).to eq('notepad')
44
44
  end
45
45
  end
46
46
  end
47
47
 
48
- context "$VISUAL is set" do
48
+ context '$VISUAL is set' do
49
49
  before do
50
- ENV["EDITOR"] = nil
51
- ENV["VISUAL"] = "/my/vim/install"
50
+ ENV['EDITOR'] = nil
51
+ ENV['VISUAL'] = '/my/vim/install'
52
52
  end
53
53
 
54
- it "returns the system editor" do
55
- expect(T::Editor.editor).to eq("/my/vim/install")
54
+ it 'returns the system editor' do
55
+ expect(T::Editor.editor).to eq('/my/vim/install')
56
56
  end
57
57
  end
58
58
 
59
- context "$EDITOR is set" do
59
+ context '$EDITOR is set' do
60
60
  before do
61
- ENV["EDITOR"] = "/usr/bin/subl"
62
- ENV["VISUAL"] = nil
61
+ ENV['EDITOR'] = '/usr/bin/subl'
62
+ ENV['VISUAL'] = nil
63
63
  end
64
64
 
65
- it "returns the system editor" do
66
- expect(T::Editor.editor).to eq("/usr/bin/subl")
65
+ it 'returns the system editor' do
66
+ expect(T::Editor.editor).to eq('/usr/bin/subl')
67
67
  end
68
68
  end
69
69
 
70
- context "$VISUAL and $EDITOR are set" do
70
+ context '$VISUAL and $EDITOR are set' do
71
71
  before do
72
- ENV["EDITOR"] = "/my/vastly/superior/editor"
73
- ENV["VISUAL"] = "/usr/bin/emacs"
72
+ ENV['EDITOR'] = '/my/vastly/superior/editor'
73
+ ENV['VISUAL'] = '/usr/bin/emacs'
74
74
  end
75
75
 
76
- it "returns the system editor" do
77
- expect(T::Editor.editor).to eq("/usr/bin/emacs")
76
+ it 'returns the system editor' do
77
+ expect(T::Editor.editor).to eq('/usr/bin/emacs')
78
78
  end
79
79
  end
80
80
  end
81
81
 
82
- context "when fetching system editor" do
83
- context "on a mac" do
82
+ context 'when fetching system editor' do
83
+ context 'on a mac' do
84
84
  before do
85
- RbConfig::CONFIG['host_os'] = "darwin12.2.0"
85
+ RbConfig::CONFIG['host_os'] = 'darwin12.2.0'
86
86
  end
87
87
  it "returns 'vi' on a unix machine" do
88
- expect(T::Editor.system_editor).to eq("vi")
88
+ expect(T::Editor.system_editor).to eq('vi')
89
89
  end
90
90
  end
91
91
 
92
- context "on a Windows POC" do
92
+ context 'on a Windows POC' do
93
93
  before do
94
- RbConfig::CONFIG['host_os'] = "mswin"
94
+ RbConfig::CONFIG['host_os'] = 'mswin'
95
95
  end
96
96
  it "returns 'notepad' on a windows box" do
97
- expect(T::Editor.system_editor).to eq("notepad")
97
+ expect(T::Editor.system_editor).to eq('notepad')
98
98
  end
99
99
  end
100
100
  end