wraith 3.1.5 → 3.1.6
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 +4 -4
- data/lib/wraith/validate.rb +6 -6
- data/lib/wraith/version.rb +1 -1
- data/spec/validate_spec.rb +11 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e5827f2c5d55c875d5318a17cfdc13076ed555a2
|
4
|
+
data.tar.gz: a2518470c451b11cdf5bf9a1204c1873761c1ab1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f043f4f16c2bffaa810cae36a8d9bfde3e8b05fdb4867dbc4458e0b38cec937f6a5515b92355d3d1dc85a20b4f0d21c03f29794748c5b29e567a538b8d88635b
|
7
|
+
data.tar.gz: 37dea7edb15a164c1da1199e0b11cfd10fec8bb4764bb8c1d9a3c7aab5fb485fb29463489b332379073ef37ab5de58d730ff64139a049cb87a5f80f5984c975a
|
data/lib/wraith/validate.rb
CHANGED
@@ -19,12 +19,12 @@ class Wraith::Validate
|
|
19
19
|
end
|
20
20
|
|
21
21
|
def validate_basic_properties
|
22
|
-
if wraith.engine.nil?
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
22
|
+
fail MissingRequiredPropertyError, "You must specify a browser engine! #{docs_prompt}" if wraith.engine.nil?
|
23
|
+
|
24
|
+
fail MissingRequiredPropertyError, "You must specify at least one domain for Wraith to do anything! #{docs_prompt}" unless wraith.domains
|
25
|
+
|
26
|
+
fail MissingRequiredPropertyError, "You must specify a directory for capture! #{docs_prompt}" if wraith.directory.nil?
|
27
|
+
|
28
28
|
# @TODO validate fuzz is not nil, etc
|
29
29
|
end
|
30
30
|
|
data/lib/wraith/version.rb
CHANGED
data/spec/validate_spec.rb
CHANGED
@@ -7,6 +7,8 @@ describe "Wraith config validator" do
|
|
7
7
|
test: http://www.bbc.com
|
8
8
|
|
9
9
|
browser: "casperjs"
|
10
|
+
|
11
|
+
directory: some/dir
|
10
12
|
')
|
11
13
|
end
|
12
14
|
|
@@ -47,6 +49,15 @@ describe "Wraith config validator" do
|
|
47
49
|
')
|
48
50
|
Wraith::Validate.new(config, true).validate("capture")
|
49
51
|
end
|
52
|
+
|
53
|
+
it "should fail if no directory is specified" do
|
54
|
+
config["domains"] = YAML.load('
|
55
|
+
test: http://something.bbc.com
|
56
|
+
live: http://www.bbc.com
|
57
|
+
')
|
58
|
+
config["directory"] = nil
|
59
|
+
expect { Wraith::Validate.new(config, true).validate("capture") }.to raise_error MissingRequiredPropertyError
|
60
|
+
end
|
50
61
|
end
|
51
62
|
|
52
63
|
describe "validations specific to history mode" do
|