jbox-gitolite 1.2.2 → 1.2.3

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d1d34e58c461358e45e656b0010599e9c38a3f39
4
- data.tar.gz: ea3a1b7090e7bb575f06b9bc81818b715d2f1d95
3
+ metadata.gz: 6f75c8c516f589f46bd632bca406db19dcd203b0
4
+ data.tar.gz: f82ec5ddd831a347a618ea5ca3485e7d9c64967b
5
5
  SHA512:
6
- metadata.gz: 37c0f9b48016346921c5397ea5b95dd1e2ee356f96f4d5400670ce4c2280379feffd39c74df00c68853acc6c93e217dc8b50594506bc164bbcdd302ff60bc0cb
7
- data.tar.gz: be32a6b452143bb8a73a894e2a1c859390abcc19d1f2e9e5aab87e62fba6f61f89eafaabc70f8324f74d6587183a9d608cdfb8f99915e03e3fabf83998cd5a1f
6
+ metadata.gz: 7a57407c0b06c0aa6ccd885a6a3732923fa030edd28fcd920e6d246fa5873d03b4456893df3da25cbeeba06d758ee4d73be7fdf8334efeaf55889e529227eb8f
7
+ data.tar.gz: 95f921301d318b4e7f103da5a0cf79e191de48821478637b2900f54f5b2ea4534a9f6d9ccdb6755af2e9d5dd7250eb1c1a8b4072fc004cdcb5afe8db4002e420
data/Rakefile CHANGED
@@ -44,7 +44,7 @@ desc "Start unit tests"
44
44
  task :test => :default
45
45
  task :default do
46
46
  RSpec::Core::RakeTask.new(:spec) do |config|
47
- config.rspec_opts = "--color --format nested --fail-fast"
47
+ config.rspec_opts = "--color --format documentation"
48
48
  end
49
49
  Rake::Task["spec"].invoke
50
50
  end
@@ -15,21 +15,18 @@ Gem::Specification.new do |s|
15
15
 
16
16
  s.rubyforge_project = "jbox-gitolite"
17
17
 
18
- s.add_development_dependency "rake", "~> 10.3.1"
19
- s.add_development_dependency "rdoc", "~> 4.1.1"
20
- s.add_development_dependency "rspec", "~> 2.14.1"
21
- s.add_development_dependency "guard-rspec", "~> 4.2.8"
22
- s.add_development_dependency "guard-spork", "~> 1.5.1"
23
- s.add_development_dependency "forgery", "~> 0.6.0"
24
- s.add_development_dependency "travis-lint", "~> 1.8.0"
18
+ s.add_development_dependency 'rake', '~> 10.3', '>= 10.3.1'
19
+ s.add_development_dependency 'rdoc', '~> 4.1', '>= 4.1.1'
20
+ s.add_development_dependency 'rspec', '~> 3.0', '>= 3.0.0'
21
+ s.add_development_dependency 'guard-rspec', '~> 4.2', '>= 4.2.8'
22
+ s.add_development_dependency 'guard-spork', '~> 1.5', '>= 1.5.1'
23
+ s.add_development_dependency 'forgery', '~> 0.6', '>= 0.6.0'
24
+ s.add_development_dependency 'simplecov', '~> 0.8', '>= 0.8.2'
25
+ s.add_development_dependency 'simplecov-rcov', '~> 0.2', '>= 0.2.3'
26
+ s.add_development_dependency 'rspec_junit_formatter', '~> 0.2', '>= 0.2.0'
25
27
 
26
- s.add_development_dependency "simplecov", "~> 0.8.2"
27
- s.add_development_dependency "simplecov-rcov", "~> 0.2.3"
28
-
29
- s.add_development_dependency "rspec_junit_formatter", "~> 0.1.6"
30
-
31
- s.add_dependency "gitlab-grit", "~> 2.6.5"
32
- s.add_dependency "gratr19", "~> 0.4.4.1"
28
+ s.add_runtime_dependency 'gitlab-grit', '~> 2.7', '>= 2.7.0'
29
+ s.add_runtime_dependency 'gratr19', '~> 0.4', '>= 0.4.4.1'
33
30
 
34
31
  s.files = `git ls-files`.split("\n")
35
32
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
@@ -63,8 +63,8 @@ module Gitolite
63
63
  config = c.to_file(File.join(path, "conf"))
64
64
 
65
65
  gl_admin = Grit::Repo.init(path)
66
- gl_admin.git.native(:add, {:chdir => gl_admin.working_dir}, config)
67
- gl_admin.git.native(:commit, {:chdir => gl_admin.working_dir}, '-a', '-m', options[:message] || "Config bootstrapped by the gitolite gem")
66
+ gl_admin.git.native(:add, {}, config)
67
+ gl_admin.git.native(:commit, {}, '-a', '-m', options[:message] || "Config bootstrapped by the gitolite gem")
68
68
 
69
69
  self.new(path)
70
70
  end
@@ -125,8 +125,8 @@ module Gitolite
125
125
  # git repo to HEAD and reloading the entire repository
126
126
  # Note that this will also delete all untracked files
127
127
  def reset!
128
- @gl_admin.git.native(:reset, {:env => @env, :chdir => @gl_admin.working_dir, :hard => true}, 'HEAD')
129
- @gl_admin.git.native(:clean, {:env => @env, :chdir => @gl_admin.working_dir, :d => true, :q => true, :f => true})
128
+ @gl_admin.git.native(:reset, {:env => @env, :hard => true}, 'HEAD')
129
+ @gl_admin.git.native(:clean, {:env => @env, :d => true, :q => true, :f => true})
130
130
  reload!
131
131
  end
132
132
 
@@ -146,7 +146,7 @@ module Gitolite
146
146
  #Process config file (if loaded, i.e. may be modified)
147
147
  if @config
148
148
  new_conf = @config.to_file(@conf_dir_path)
149
- @gl_admin.git.native(:add, {:env => @env, :chdir => @gl_admin.working_dir}, new_conf)
149
+ @gl_admin.git.native(:add, {:env => @env}, new_conf)
150
150
  end
151
151
 
152
152
  #Process ssh keys (if loaded, i.e. may be modified)
@@ -156,7 +156,7 @@ module Gitolite
156
156
 
157
157
  to_remove = (files - keys).map { |f| File.join(@key_dir, f) }
158
158
  to_remove.each do |key|
159
- @gl_admin.git.native(:rm, {:env => @env, :chdir => @gl_admin.working_dir}, key)
159
+ @gl_admin.git.native(:rm, {:env => @env}, key)
160
160
  end
161
161
 
162
162
  @ssh_keys.each_value do |key|
@@ -164,24 +164,28 @@ module Gitolite
164
164
  next if key.respond_to?(:dirty?) && !key.dirty?
165
165
  key.each do |k|
166
166
  new_key = k.to_file(@key_dir_path)
167
- @gl_admin.git.native(:add, {:env => @env, :chdir => @gl_admin.working_dir}, new_key)
167
+ @gl_admin.git.native(:add, {:env => @env}, new_key)
168
168
  end
169
169
  end
170
170
  end
171
171
 
172
172
  args = []
173
173
 
174
+ args << '-a'
175
+ args << '-m'
176
+ args << commit_message
177
+
174
178
  if options.has_key?(:author) && !options[:author].empty?
175
179
  args << "--author='#{options[:author]}'"
176
180
  end
177
181
 
178
- @gl_admin.git.native(:commit, {:env => @env, :chdir => @gl_admin.working_dir}, '-a', '-m', commit_message, args.join(' '))
182
+ @gl_admin.git.native(:commit, {:env => @env}, *args)
179
183
  end
180
184
 
181
185
 
182
186
  # Push back to origin
183
187
  def apply
184
- @gl_admin.git.native(:push, {:env => @env, :chdir => @gl_admin.working_dir}, "origin", "master")
188
+ @gl_admin.git.native(:push, {:env => @env}, "origin", "master")
185
189
  end
186
190
 
187
191
 
@@ -198,7 +202,7 @@ module Gitolite
198
202
 
199
203
  reset! if options[:reset]
200
204
 
201
- @gl_admin.git.native(:pull, {:env => @env, :chdir => @gl_admin.working_dir, :rebase => options[:rebase]}, "origin", "master")
205
+ @gl_admin.git.native(:pull, {:env => @env, :rebase => options[:rebase]}, "origin", "master")
202
206
 
203
207
  reload!
204
208
  end
@@ -1,3 +1,3 @@
1
1
  module Gitolite
2
- VERSION = "1.2.2"
2
+ VERSION = "1.2.3"
3
3
  end
@@ -9,14 +9,14 @@ describe Gitolite::Config do
9
9
  describe "#new" do
10
10
  it 'should read a simple configuration' do
11
11
  c = Gitolite::Config.new(File.join(conf_dir, 'simple.conf'))
12
- c.repos.length.should == 2
13
- c.groups.length.should == 0
12
+ expect(c.repos.length).to eq 2
13
+ expect(c.groups.length).to eq 0
14
14
  end
15
15
 
16
16
  it 'should read a complex configuration' do
17
17
  c = Gitolite::Config.new(File.join(conf_dir, 'complicated.conf'))
18
- c.groups.length.should == 5
19
- c.repos.length.should == 13
18
+ expect(c.groups.length).to eq 5
19
+ expect(c.repos.length).to eq 13
20
20
  end
21
21
 
22
22
  describe 'gitweb operations' do
@@ -26,26 +26,26 @@ describe Gitolite::Config do
26
26
 
27
27
  it 'should correctly read gitweb options for an existing repo' do
28
28
  r = @config.get_repo('gitolite')
29
- r.owner.should == "Sitaram Chamarty"
30
- r.description.should == "fast, secure, access control for git in a corporate environment"
29
+ expect(r.owner).to eq "Sitaram Chamarty"
30
+ expect(r.description).to eq "fast, secure, access control for git in a corporate environment"
31
31
  end
32
32
 
33
33
  it 'should correctly read a gitweb option with no owner for an existing repo' do
34
34
  r = @config.get_repo('foo')
35
- r.owner.should be nil
36
- r.description.should == "Foo is a nice test repo"
35
+ expect(r.owner).to be nil
36
+ expect(r.description).to eq "Foo is a nice test repo"
37
37
  end
38
38
 
39
39
  it 'should correctly read gitweb options for a new repo' do
40
40
  r = @config.get_repo('foobar')
41
- r.owner.should == "Bob Zilla"
42
- r.description.should == "Foobar is top secret"
41
+ expect(r.owner).to eq "Bob Zilla"
42
+ expect(r.description).to eq "Foobar is top secret"
43
43
  end
44
44
 
45
45
  it 'should correctly read gitweb options with no owner for a new repo' do
46
46
  r = @config.get_repo('bar')
47
- r.owner.should be nil
48
- r.description.should == "A nice place to get drinks"
47
+ expect(r.owner).to be nil
48
+ expect(r.description).to eq "A nice place to get drinks"
49
49
  end
50
50
 
51
51
  it 'should raise a ParseError when a description is not specified' do
@@ -53,7 +53,7 @@ describe Gitolite::Config do
53
53
  t.write('gitolite "Bob Zilla"')
54
54
  t.close
55
55
 
56
- lambda { Gitolite::Config.new(t.path) }.should raise_error(Gitolite::Config::ParseError)
56
+ expect(lambda { Gitolite::Config.new(t.path) }).to raise_error(Gitolite::Config::ParseError)
57
57
 
58
58
  t.unlink
59
59
  end
@@ -63,7 +63,7 @@ describe Gitolite::Config do
63
63
  t.write('@gitolite "Bob Zilla" = "Test description"')
64
64
  t.close
65
65
 
66
- lambda { Gitolite::Config.new(t.path) }.should raise_error(Gitolite::Config::ParseError)
66
+ expect(lambda { Gitolite::Config.new(t.path) }).to raise_error(Gitolite::Config::ParseError)
67
67
 
68
68
  t.unlink
69
69
  end
@@ -76,7 +76,7 @@ describe Gitolite::Config do
76
76
 
77
77
  it 'should correctly read in git config settings' do
78
78
  r = @config.get_repo(:gitolite)
79
- r.config.length.should == 4
79
+ expect(r.config.length).to eq 4
80
80
  end
81
81
  end
82
82
 
@@ -87,7 +87,7 @@ describe Gitolite::Config do
87
87
 
88
88
  it 'should correctly read in gitolite options' do
89
89
  r = @config.get_repo(:foo)
90
- r.options.length.should == 3
90
+ expect(r.options.length).to eq 3
91
91
  end
92
92
 
93
93
  it 'should raise a ParseError when a value is not specified' do
@@ -95,7 +95,7 @@ describe Gitolite::Config do
95
95
  t.write("repo foobar\n option mirror.master =")
96
96
  t.close
97
97
 
98
- lambda { Gitolite::Config.new(t.path) }.should raise_error(Gitolite::Config::ParseError)
98
+ expect(lambda { Gitolite::Config.new(t.path) }).to raise_error(Gitolite::Config::ParseError)
99
99
 
100
100
  t.unlink
101
101
  end
@@ -106,24 +106,24 @@ describe Gitolite::Config do
106
106
  it 'should create a valid, blank Gitolite::Config' do
107
107
  c = Gitolite::Config.init
108
108
 
109
- c.should be_an_instance_of Gitolite::Config
110
- c.repos.should_not be nil
111
- c.repos.length.should be 0
112
- c.groups.should_not be nil
113
- c.groups.length.should be 0
114
- c.filename.should == "gitolite.conf"
109
+ expect(c).to be_an_instance_of Gitolite::Config
110
+ expect(c.repos).to_not be nil
111
+ expect(c.repos.length).to be 0
112
+ expect(c.groups).to_not be nil
113
+ expect(c.groups.length).to be 0
114
+ expect(c.filename).to eq "gitolite.conf"
115
115
  end
116
116
 
117
117
  it 'should create a valid, blank Gitolite::Config with the given filename' do
118
118
  filename = "test.conf"
119
119
  c = Gitolite::Config.init(filename)
120
120
 
121
- c.should be_an_instance_of Gitolite::Config
122
- c.repos.should_not be nil
123
- c.repos.length.should be 0
124
- c.groups.should_not be nil
125
- c.groups.length.should be 0
126
- c.filename.should == filename
121
+ expect(c).to be_an_instance_of Gitolite::Config
122
+ expect(c.repos).to_not be nil
123
+ expect(c.repos.length).to be 0
124
+ expect(c.groups).to_not be nil
125
+ expect(c.groups.length).to be 0
126
+ expect(c.filename).to eq filename
127
127
  end
128
128
  end
129
129
 
@@ -134,40 +134,40 @@ describe Gitolite::Config do
134
134
 
135
135
  describe "#get_repo" do
136
136
  it 'should fetch a repo by a string containing the name' do
137
- @config.get_repo('gitolite').should be_an_instance_of Gitolite::Config::Repo
137
+ expect(@config.get_repo('gitolite')).to be_an_instance_of Gitolite::Config::Repo
138
138
  end
139
139
 
140
140
  it 'should fetch a repo via a symbol representing the name' do
141
- @config.get_repo(:gitolite).should be_an_instance_of Gitolite::Config::Repo
141
+ expect(@config.get_repo(:gitolite)).to be_an_instance_of Gitolite::Config::Repo
142
142
  end
143
143
 
144
144
  it 'should return nil for a repo that does not exist' do
145
- @config.get_repo(:glite).should be nil
145
+ expect(@config.get_repo(:glite)).to be nil
146
146
  end
147
147
  end
148
148
 
149
149
  describe "#has_repo?" do
150
150
  it 'should return false for a repo that does not exist' do
151
- @config.has_repo?(:glite).should be false
151
+ expect(@config.has_repo?(:glite)).to be false
152
152
  end
153
153
 
154
154
  it 'should check for the existance of a repo given a repo object' do
155
155
  r = @config.repos["gitolite"]
156
- @config.has_repo?(r).should be true
156
+ expect(@config.has_repo?(r)).to be true
157
157
  end
158
158
 
159
159
  it 'should check for the existance of a repo given a string containing the name' do
160
- @config.has_repo?('gitolite').should be true
160
+ expect(@config.has_repo?('gitolite')).to be true
161
161
  end
162
162
 
163
163
  it 'should check for the existance of a repo given a symbol representing the name' do
164
- @config.has_repo?(:gitolite).should be true
164
+ expect(@config.has_repo?(:gitolite)).to be true
165
165
  end
166
166
  end
167
167
 
168
168
  describe "#add_repo" do
169
169
  it 'should throw an ArgumentError for non-Gitolite::Config::Repo objects passed in' do
170
- lambda{ @config.add_repo("not-a-repo") }.should raise_error(ArgumentError)
170
+ expect(lambda{ @config.add_repo("not-a-repo") }).to raise_error(ArgumentError)
171
171
  end
172
172
 
173
173
  it 'should add a given repo to the list of repos' do
@@ -175,8 +175,8 @@ describe Gitolite::Config do
175
175
  nrepos = @config.repos.size
176
176
  @config.add_repo(r)
177
177
 
178
- @config.repos.size.should == nrepos + 1
179
- @config.has_repo?(:cool_repo).should be true
178
+ expect(@config.repos.size).to eq nrepos + 1
179
+ expect(@config.has_repo?(:cool_repo)).to be true
180
180
  end
181
181
 
182
182
  it 'should merge a given repo with an existing repo' do
@@ -227,28 +227,28 @@ describe Gitolite::Config do
227
227
  it 'should remove a repo for the Gitolite::Config::Repo object given' do
228
228
  r = @config.get_repo(:gitolite)
229
229
  r2 = @config.rm_repo(r)
230
- r2.name.should == r.name
231
- r2.permissions.length.should == r.permissions.length
232
- r2.owner.should == r.owner
233
- r2.description.should == r.description
230
+ expect(r2.name).to eq r.name
231
+ expect(r2.permissions.length).to eq r.permissions.length
232
+ expect(r2.owner).to eq r.owner
233
+ expect(r2.description).to eq r.description
234
234
  end
235
235
 
236
236
  it 'should remove a repo given a string containing the name' do
237
237
  r = @config.get_repo(:gitolite)
238
238
  r2 = @config.rm_repo('gitolite')
239
- r2.name.should == r.name
240
- r2.permissions.length.should == r.permissions.length
241
- r2.owner.should == r.owner
242
- r2.description.should == r.description
239
+ expect(r2.name).to eq r.name
240
+ expect(r2.permissions.length).to eq r.permissions.length
241
+ expect(r2.owner).to eq r.owner
242
+ expect(r2.description).to eq r.description
243
243
  end
244
244
 
245
245
  it 'should remove a repo given a symbol representing the name' do
246
246
  r = @config.get_repo(:gitolite)
247
247
  r2 = @config.rm_repo(:gitolite)
248
- r2.name.should == r.name
249
- r2.permissions.length.should == r.permissions.length
250
- r2.owner.should == r.owner
251
- r2.description.should == r.description
248
+ expect(r2.name).to eq r.name
249
+ expect(r2.permissions.length).to eq r.permissions.length
250
+ expect(r2.owner).to eq r.owner
251
+ expect(r2.description).to eq r.description
252
252
  end
253
253
  end
254
254
  end
@@ -260,44 +260,44 @@ describe Gitolite::Config do
260
260
 
261
261
  describe "#has_group?" do
262
262
  it 'should find the staff group using a symbol' do
263
- @config.has_group?(:staff).should be true
263
+ expect(@config.has_group?(:staff)).to be true
264
264
  end
265
265
 
266
266
  it 'should find the staff group using a string' do
267
- @config.has_group?('staff').should be true
267
+ expect(@config.has_group?('staff')).to be true
268
268
  end
269
269
 
270
270
  it 'should find the staff group using a Gitolite::Config::Group object' do
271
271
  g = Gitolite::Config::Group.new("staff")
272
- @config.has_group?(g).should be true
272
+ expect(@config.has_group?(g)).to be true
273
273
  end
274
274
  end
275
275
 
276
276
  describe "#get_group" do
277
277
  it 'should return the Gitolite::Config::Group object for the group name String' do
278
278
  g = @config.get_group("staff")
279
- g.is_a?(Gitolite::Config::Group).should be true
280
- g.size.should == 6
279
+ expect(g.is_a?(Gitolite::Config::Group)).to be true
280
+ expect(g.size).to eq 6
281
281
  end
282
282
 
283
283
  it 'should return the Gitolite::Config::Group object for the group name Symbol' do
284
284
  g = @config.get_group(:staff)
285
- g.is_a?(Gitolite::Config::Group).should be true
286
- g.size.should == 6
285
+ expect(g.is_a?(Gitolite::Config::Group)).to be true
286
+ expect(g.size).to eq 6
287
287
  end
288
288
  end
289
289
 
290
290
  describe "#add_group" do
291
291
  it 'should throw an ArgumentError for non-Gitolite::Config::Group objects passed in' do
292
- lambda{ @config.add_group("not-a-group") }.should raise_error(ArgumentError)
292
+ expect(lambda{ @config.add_group("not-a-group") }).to raise_error(ArgumentError)
293
293
  end
294
294
 
295
295
  it 'should add a given group to the groups list' do
296
296
  g = Gitolite::Config::Group.new('cool_group')
297
297
  ngroups = @config.groups.size
298
298
  @config.add_group(g)
299
- @config.groups.size.should be ngroups + 1
300
- @config.has_group?(:cool_group).should be true
299
+ expect(@config.groups.size).to be ngroups + 1
300
+ expect(@config.has_group?(:cool_group)).to be true
301
301
  end
302
302
 
303
303
  end
@@ -306,20 +306,20 @@ describe Gitolite::Config do
306
306
  it 'should remove a group for the Gitolite::Config::Group object given' do
307
307
  g = @config.get_group(:oss_repos)
308
308
  g2 = @config.rm_group(g)
309
- g.should_not be nil
310
- g2.name.should == g.name
309
+ expect(g).to_not be nil
310
+ expect(g2.name).to eq g.name
311
311
  end
312
312
 
313
313
  it 'should remove a group given a string containing the name' do
314
314
  g = @config.get_group(:oss_repos)
315
315
  g2 = @config.rm_group('oss_repos')
316
- g2.name.should == g.name
316
+ expect(g2.name).to eq g.name
317
317
  end
318
318
 
319
319
  it 'should remove a group given a symbol representing the name' do
320
320
  g = @config.get_group(:oss_repos)
321
321
  g2 = @config.rm_group(:oss_repos)
322
- g2.name.should == g.name
322
+ expect(g2.name).to eq g.name
323
323
  end
324
324
  end
325
325
 
@@ -329,14 +329,14 @@ describe Gitolite::Config do
329
329
  it 'should create a file at the given path with the config\'s file name' do
330
330
  c = Gitolite::Config.init
331
331
  file = c.to_file(output_dir)
332
- File.file?(File.join(output_dir, c.filename)).should be true
332
+ expect(File.file?(File.join(output_dir, c.filename))).to be true
333
333
  File.unlink(file)
334
334
  end
335
335
 
336
336
  it 'should create a file at the given path with the config file passed' do
337
337
  c = Gitolite::Config.new(File.join(conf_dir, 'complicated.conf'))
338
338
  file = c.to_file(output_dir)
339
- File.file?(File.join(output_dir, c.filename)).should be true
339
+ expect(File.file?(File.join(output_dir, c.filename))).to be true
340
340
  end
341
341
 
342
342
  it 'should create a file at the given path when a different filename is specified' do
@@ -344,18 +344,18 @@ describe Gitolite::Config do
344
344
  c = Gitolite::Config.init
345
345
  c.filename = filename
346
346
  file = c.to_file(output_dir)
347
- File.file?(File.join(output_dir, filename)).should be true
347
+ expect(File.file?(File.join(output_dir, filename))).to be true
348
348
  File.unlink(file)
349
349
  end
350
350
 
351
351
  it 'should raise an ArgumentError when an invalid path is specified' do
352
352
  c = Gitolite::Config.init
353
- lambda { c.to_file('/does/not/exist') }.should raise_error(ArgumentError)
353
+ expect(lambda { c.to_file('/does/not/exist') }).to raise_error(ArgumentError)
354
354
  end
355
355
 
356
356
  it 'should raise an ArgumentError when a filename is specified in the path' do
357
357
  c = Gitolite::Config.init
358
- lambda{ c.to_file('/home/test.rb') }.should raise_error(ArgumentError)
358
+ expect(lambda{ c.to_file('/home/test.rb') }).to raise_error(ArgumentError)
359
359
  end
360
360
 
361
361
  it 'should resolve group dependencies such that all groups are defined before they are used' do
@@ -387,10 +387,10 @@ describe Gitolite::Config do
387
387
  lines = f.lines.map {|l| l.strip}
388
388
 
389
389
  # Compare the file lines. Spacing is important here since we are doing a direct comparision
390
- lines[0].should == "@groupb = andrew joe sam susan"
391
- lines[1].should == "@groupc = @groupb brandon jane"
392
- lines[2].should == "@groupd = @groupc larry"
393
- lines[3].should == "@groupa = @groupb bob"
390
+ expect(lines[0]).to eq "@groupb = andrew joe sam susan"
391
+ expect(lines[1]).to eq "@groupc = @groupb brandon jane"
392
+ expect(lines[2]).to eq "@groupd = @groupc larry"
393
+ expect(lines[3]).to eq "@groupa = @groupb bob"
394
394
 
395
395
  # Cleanup
396
396
  File.unlink(file)
@@ -418,7 +418,7 @@ describe Gitolite::Config do
418
418
  c.add_group(g)
419
419
 
420
420
  # Attempt to write the config file
421
- lambda{ c.to_file(output_dir)}.should raise_error(Gitolite::Config::GroupDependencyError)
421
+ expect(lambda{ c.to_file(output_dir)}).to raise_error(Gitolite::Config::GroupDependencyError)
422
422
  end
423
423
 
424
424
  it 'should resolve group dependencies even when there are disconnected portions of the graph' do
@@ -450,10 +450,10 @@ describe Gitolite::Config do
450
450
  lines = f.lines.map {|l| l.strip}
451
451
 
452
452
  # Compare the file lines. Spacing is important here since we are doing a direct comparision
453
- lines[0].should == "@groupd = chris emily larry"
454
- lines[1].should == "@groupb = andrew joe sam susan"
455
- lines[2].should == "@groupa = bob stephanie timmy"
456
- lines[3].should == "@groupc = @groupa brandon earl jane"
453
+ expect(lines[0]).to eq "@groupd = chris emily larry"
454
+ expect(lines[1]).to eq "@groupb = andrew joe sam susan"
455
+ expect(lines[2]).to eq "@groupa = bob stephanie timmy"
456
+ expect(lines[3]).to eq "@groupc = @groupa brandon earl jane"
457
457
 
458
458
  # Cleanup
459
459
  File.unlink(file)
@@ -467,32 +467,32 @@ describe Gitolite::Config do
467
467
 
468
468
  it 'should remove comments' do
469
469
  s = "#comment"
470
- @config.instance_eval { cleanup_config_line(s) }.empty?.should == true
470
+ expect(@config.instance_eval { cleanup_config_line(s) }.empty?).to eq true
471
471
  end
472
472
 
473
473
  it 'should remove inline comments, keeping content before the comment' do
474
474
  s = "blablabla #comment"
475
- @config.instance_eval { cleanup_config_line(s) }.should == "blablabla"
475
+ expect(@config.instance_eval { cleanup_config_line(s) }).to eq "blablabla"
476
476
  end
477
477
 
478
478
  it 'should pad = with spaces on each side' do
479
479
  s = "bob=joe"
480
- @config.instance_eval { cleanup_config_line(s) }.should == "bob = joe"
480
+ expect(@config.instance_eval { cleanup_config_line(s) }).to eq "bob = joe"
481
481
  end
482
482
 
483
483
  it 'should replace multiple space characters with a single space' do
484
484
  s = "bob = joe"
485
- @config.instance_eval { cleanup_config_line(s) }.should == "bob = joe"
485
+ expect(@config.instance_eval { cleanup_config_line(s) }).to eq "bob = joe"
486
486
  end
487
487
 
488
488
  it 'should cleanup whitespace at the beginning and end of lines' do
489
489
  s = " bob = joe "
490
- @config.instance_eval { cleanup_config_line(s) }.should == "bob = joe"
490
+ expect(@config.instance_eval { cleanup_config_line(s) }).to eq "bob = joe"
491
491
  end
492
492
 
493
493
  it 'should cleanup whitespace and comments effectively' do
494
494
  s = " bob = joe #comment"
495
- @config.instance_eval { cleanup_config_line(s) }.should == "bob = joe"
495
+ expect(@config.instance_eval { cleanup_config_line(s) }).to eq "bob = joe"
496
496
  end
497
497
  end
498
498
  end