Skip to content

Commit 561b9b1

Browse files
authored
Merge pull request #153 from rubycdp/enable_pending_specs
2 parents 7c84cdb + 3ed1b07 commit 561b9b1

File tree

2 files changed

+51
-51
lines changed

2 files changed

+51
-51
lines changed

spec/unit/browser_spec.rb

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
1-
# # frozen_string_literal: true
2-
#
3-
# require "stringio"
4-
#
5-
# module Ferrum
6-
# describe Browser do
7-
# it "logs requests and responses" do
8-
# logger = StringIO.new
9-
# browser = Browser.new(logger: logger)
10-
#
11-
# browser.body
12-
#
13-
# expect(logger.string).to include("return document.documentElement.outerHTML")
14-
# expect(logger.string).to include("<html><head></head><body></body></html>")
15-
# end
16-
#
17-
# it "shows command line options passed" do
18-
# browser = Browser.new(browser_options: { "blink-settings" => "imagesEnabled=false" })
19-
#
20-
# arguments = browser.command("Browser.getBrowserCommandLine")["arguments"]
21-
#
22-
# expect(arguments).to include("--blink-settings=imagesEnabled=false")
23-
# end
24-
# end
25-
# end
1+
# frozen_string_literal: true
2+
3+
require "stringio"
4+
5+
module Ferrum
6+
describe Browser do
7+
it "logs requests and responses" do
8+
logger = StringIO.new
9+
browser = Browser.new(logger: logger)
10+
11+
browser.body
12+
13+
expect(logger.string).to include("return document.documentElement.outerHTML")
14+
expect(logger.string).to include("<html><head></head><body></body></html>")
15+
end
16+
17+
it "shows command line options passed" do
18+
browser = Browser.new(browser_options: { "blink-settings" => "imagesEnabled=false" })
19+
20+
arguments = browser.command("Browser.getBrowserCommandLine")["arguments"]
21+
22+
expect(arguments).to include("--blink-settings=imagesEnabled=false")
23+
end
24+
end
25+
end

spec/unit/process_spec.rb

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
1-
# # frozen_string_literal: true
2-
#
3-
# module Ferrum
4-
# class Browser
5-
# describe Process do
6-
# subject { Browser.new(port: 6000, host: "127.0.0.1") }
7-
#
8-
# unless Ferrum.windows?
9-
# it "forcibly kills the child if it does not respond to SIGTERM" do
10-
# allow(::Process).to receive_messages(spawn: 5678)
11-
# allow(::Process).to receive(:wait).and_return(nil)
12-
# allow(Client).to receive(:new).and_return(double.as_null_object)
13-
#
14-
# allow_any_instance_of(Process).to receive(:parse_ws_url)
15-
#
16-
# subject.send(:start)
17-
#
18-
# expect(::Process).to receive(:kill).with("USR1", 5678).ordered
19-
# expect(::Process).to receive(:kill).with("KILL", 5678).ordered
20-
#
21-
# subject.quit
22-
# end
23-
# end
24-
# end
25-
# end
26-
# end
1+
# frozen_string_literal: true
2+
3+
module Ferrum
4+
class Browser
5+
describe Process do
6+
subject { Browser.new(port: 6000, host: "127.0.0.1") }
7+
8+
unless Ferrum.windows?
9+
it "forcibly kills the child if it does not respond to SIGTERM" do
10+
allow(::Process).to receive_messages(spawn: 5678)
11+
allow(::Process).to receive(:wait).and_return(nil)
12+
allow(Client).to receive(:new).and_return(double.as_null_object)
13+
14+
allow_any_instance_of(Process).to receive(:parse_ws_url)
15+
16+
subject.send(:start)
17+
18+
expect(::Process).to receive(:kill).with("USR1", 5678).ordered
19+
expect(::Process).to receive(:kill).with("KILL", 5678).ordered
20+
21+
subject.quit
22+
end
23+
end
24+
end
25+
end
26+
end

0 commit comments

Comments
 (0)