Skip to content

Commit 3aa862b

Browse files
author
Brent Cook
committed
Fix rapid7#8464, update specs
2 parents ec5a3ab + 11b99d9 commit 3aa862b

File tree

2 files changed

+2
-19
lines changed

2 files changed

+2
-19
lines changed

msfupdate

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ class Msfupdate
8686

8787
def validate_args
8888
valid = true
89-
if binary_install?
89+
if binary_install? || apt?
9090
if @git_branch
9191
stderr.puts "[-] ERROR: git-branch is not supported on this installation"
9292
valid = false
@@ -96,7 +96,7 @@ class Msfupdate
9696
valid = false
9797
end
9898
end
99-
if git?
99+
if apt? || git?
100100
if @offline_file
101101
stderr.puts "[-] ERROR: offline-file option is not supported on this installation"
102102
valid = false

spec/msfupdate_spec.rb

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ def dummy_apt_pathname
4949
before(:example) do
5050
# By default, we want to ensure tests never actually try to execute any
5151
# of the update methods unless we are explicitly testing them
52-
allow(subject).to receive(:update_apt!)
5352
allow(subject).to receive(:update_binary_install!)
5453
allow(subject).to receive(:update_git!)
5554
end
@@ -219,10 +218,6 @@ def dummy_apt_pathname
219218
end
220219

221220
context "#run!" do
222-
it "calls update_apt!" do
223-
expect(subject).to receive(:update_apt!)
224-
subject.run!
225-
end
226221
it "does not call update_binary_install!" do
227222
expect(subject).not_to receive(:update_binary_install!)
228223
subject.run!
@@ -232,10 +227,6 @@ def dummy_apt_pathname
232227
subject.run!
233228
end
234229
end
235-
236-
context "#update_apt!" do
237-
# TODO: Add more tests!
238-
end
239230
end
240231

241232
context "in a binary installation" do
@@ -272,10 +263,6 @@ def dummy_apt_pathname
272263
end
273264

274265
context "#run!" do
275-
it "does not call update_apt!" do
276-
expect(subject).not_to receive(:update_apt!)
277-
subject.run!
278-
end
279266
it "calls update_binary_install!" do
280267
expect(subject).to receive(:update_binary_install!)
281268
subject.run!
@@ -326,10 +313,6 @@ def dummy_apt_pathname
326313
end
327314

328315
context "#run!" do
329-
it "does not call update_apt!" do
330-
expect(subject).not_to receive(:update_apt!)
331-
subject.run!
332-
end
333316
it "does not call update_binary_install!" do
334317
expect(subject).not_to receive(:update_binary_install!)
335318
subject.run!

0 commit comments

Comments
 (0)