har 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/har.rb +1 -0
- data/lib/har/version.rb +1 -1
- data/lib/har/viewer.rb +6 -1
- data/spec/har/viewer_spec.rb +20 -8
- metadata +2 -2
data/lib/har.rb
CHANGED
data/lib/har/version.rb
CHANGED
data/lib/har/viewer.rb
CHANGED
data/spec/har/viewer_spec.rb
CHANGED
@@ -3,19 +3,31 @@ require File.expand_path("../../spec_helper", __FILE__)
|
|
3
3
|
module HAR
|
4
4
|
describe Viewer do
|
5
5
|
|
6
|
-
context "
|
7
|
-
it "
|
8
|
-
|
9
|
-
end
|
6
|
+
context "options" do
|
7
|
+
it "has sensible defaults" do
|
8
|
+
v = Viewer.new([google_path])
|
10
9
|
|
11
|
-
|
12
|
-
|
10
|
+
v.options[:port] == 1234
|
11
|
+
v.options[:validate] == true
|
13
12
|
end
|
14
13
|
|
15
|
-
it "parses
|
16
|
-
v = Viewer.new(["-p", "1234",
|
14
|
+
it "parses the port option" do
|
15
|
+
v = Viewer.new(["-p", "1234", google_path])
|
17
16
|
v.options[:port].should == 1234
|
18
17
|
end
|
18
|
+
|
19
|
+
it "parses the --validate option" do
|
20
|
+
v = Viewer.new(["--validate", google_path])
|
21
|
+
v.options[:validate].should be_true
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
it "validates the given HARs if asked to" do
|
26
|
+
lambda { Viewer.new(["--validate", *all_hars]) }.should raise_error(ValidationError)
|
27
|
+
end
|
28
|
+
|
29
|
+
it "has a merged archive" do
|
30
|
+
Viewer.new(good_hars).har.should be_kind_of(Archive)
|
19
31
|
end
|
20
32
|
|
21
33
|
end
|