Browse Source

update specs

Brent Cook 2 years ago
parent
commit
11b99d954d
2 changed files with 2 additions and 19 deletions
  1. 2
    2
      msfupdate
  2. 0
    17
      spec/msfupdate_spec.rb

+ 2
- 2
msfupdate View File

@@ -86,7 +86,7 @@ class Msfupdate
86 86
 
87 87
   def validate_args
88 88
     valid = true
89
-    if binary_install?
89
+    if binary_install? || apt?
90 90
       if @git_branch
91 91
         stderr.puts "[-] ERROR: git-branch is not supported on this installation"
92 92
         valid = false
@@ -96,7 +96,7 @@ class Msfupdate
96 96
         valid = false
97 97
       end
98 98
     end
99
-    if git?
99
+    if apt? || git?
100 100
       if @offline_file
101 101
         stderr.puts "[-] ERROR: offline-file option is not supported on this installation"
102 102
         valid = false

+ 0
- 17
spec/msfupdate_spec.rb View File

@@ -49,7 +49,6 @@ RSpec.describe Msfupdate do
49 49
   before(:example) do
50 50
     # By default, we want to ensure tests never actually try to execute any
51 51
     # of the update methods unless we are explicitly testing them
52
-    allow(subject).to receive(:update_apt!)
53 52
     allow(subject).to receive(:update_binary_install!)
54 53
     allow(subject).to receive(:update_git!)
55 54
   end
@@ -219,10 +218,6 @@ RSpec.describe Msfupdate do
219 218
     end
220 219
 
221 220
     context "#run!" do
222
-      it "calls update_apt!" do
223
-        expect(subject).to receive(:update_apt!)
224
-        subject.run!
225
-      end
226 221
       it "does not call update_binary_install!" do
227 222
         expect(subject).not_to receive(:update_binary_install!)
228 223
         subject.run!
@@ -232,10 +227,6 @@ RSpec.describe Msfupdate do
232 227
         subject.run!
233 228
       end
234 229
     end
235
-
236
-    context "#update_apt!" do
237
-      # TODO: Add more tests!
238
-    end
239 230
   end
240 231
 
241 232
   context "in a binary installation" do
@@ -272,10 +263,6 @@ RSpec.describe Msfupdate do
272 263
     end
273 264
 
274 265
     context "#run!" do
275
-      it "does not call update_apt!" do
276
-        expect(subject).not_to receive(:update_apt!)
277
-        subject.run!
278
-      end
279 266
       it "calls update_binary_install!" do
280 267
         expect(subject).to receive(:update_binary_install!)
281 268
         subject.run!
@@ -326,10 +313,6 @@ RSpec.describe Msfupdate do
326 313
     end
327 314
 
328 315
     context "#run!" do
329
-      it "does not call update_apt!" do
330
-        expect(subject).not_to receive(:update_apt!)
331
-        subject.run!
332
-      end
333 316
       it "does not call update_binary_install!" do
334 317
         expect(subject).not_to receive(:update_binary_install!)
335 318
         subject.run!

Loading…
Cancel
Save