page_magic 1.0.0.alpha8 → 1.0.0.alpha9
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/VERSION +1 -1
- data/lib/page_magic/driver.rb +1 -3
- data/lib/page_magic/drivers/poltergeist.rb +2 -2
- data/lib/page_magic/drivers/rack_test.rb +2 -2
- data/lib/page_magic/drivers/selenium.rb +2 -2
- data/spec/page_magic/driver_spec.rb +15 -20
- data/spec/page_magic/drivers/selenium_spec.rb +9 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 913ffb021a5d651dd495d38676e28a3db2d0f51d
|
4
|
+
data.tar.gz: b61ef053d8a6de10e24386904f5e469f5a34e72e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ae0c743e1683f12841c77ba81d53ebe985faedbf0cd71d9560abe898a6b7f5473feb4ac256c58e8d1f2b3998843a32b7bc3665cc414e88f9502f584c832d86ef
|
7
|
+
data.tar.gz: 48d8d12ad1dbb5008987e0fca4a78b897c84001826a72069ecf605b3412cb4c89c809473e0ad77168757ca236ef2ebbbdca967449b6319b42598f680d73be08f
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.0.
|
1
|
+
1.0.0.alpha9
|
data/lib/page_magic/driver.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
module PageMagic
|
2
2
|
class Drivers
|
3
|
-
Poltergeist = Driver.new(:poltergeist) do
|
3
|
+
Poltergeist = Driver.new(:poltergeist) do |app, options|
|
4
4
|
require 'capybara/poltergeist'
|
5
|
-
Capybara::Poltergeist::Driver
|
5
|
+
Capybara::Poltergeist::Driver.new(app, options)
|
6
6
|
end
|
7
7
|
end
|
8
8
|
end
|
@@ -1,8 +1,8 @@
|
|
1
1
|
module PageMagic
|
2
2
|
class Drivers
|
3
|
-
Selenium = Driver.new(:chrome, :firefox) do
|
3
|
+
Selenium = Driver.new(:chrome, :firefox) do |app, options, browser|
|
4
4
|
require 'watir-webdriver'
|
5
|
-
Capybara::Selenium::Driver
|
5
|
+
Capybara::Selenium::Driver.new(app, options.dup.merge(browser: browser))
|
6
6
|
end
|
7
7
|
end
|
8
8
|
end
|
@@ -2,23 +2,8 @@ require 'page_magic/driver'
|
|
2
2
|
|
3
3
|
module PageMagic
|
4
4
|
describe Driver do
|
5
|
-
let(:driver_class) do
|
6
|
-
Class.new do
|
7
|
-
attr_reader :rack_app, :options
|
8
|
-
def initialize(rack_app, options)
|
9
|
-
@rack_app = rack_app
|
10
|
-
@options = options
|
11
|
-
end
|
12
|
-
|
13
|
-
def ==(driver)
|
14
|
-
driver.rack_app == rack_app && driver.options == options
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
5
|
subject do
|
19
|
-
described_class.new :custom_browser
|
20
|
-
driver_class
|
21
|
-
end
|
6
|
+
described_class.new :custom_browser
|
22
7
|
end
|
23
8
|
|
24
9
|
describe '#supports?' do
|
@@ -35,12 +20,22 @@ module PageMagic
|
|
35
20
|
end
|
36
21
|
end
|
37
22
|
describe '#build' do
|
38
|
-
|
39
|
-
|
23
|
+
|
24
|
+
it 'returns the result of the block passed to the driver class constructor' do
|
25
|
+
subject = described_class.new(:custom_browser)do
|
26
|
+
:driver
|
27
|
+
end
|
28
|
+
expect(subject.build(:rack_app, browser: :custom_browser, options: :options)).to eq(:driver)
|
40
29
|
end
|
41
30
|
|
42
|
-
it '
|
43
|
-
|
31
|
+
it 'passes rack app to the handler' do
|
32
|
+
subject = described_class.new(:custom_browser) do |app, options, browser|
|
33
|
+
expect(app).to eq(:rack_app)
|
34
|
+
expect(options).to eq(:options)
|
35
|
+
expect(browser).to eq(:browser)
|
36
|
+
end
|
37
|
+
|
38
|
+
subject.build(:rack_app, options: :options, browser: :browser)
|
44
39
|
end
|
45
40
|
end
|
46
41
|
end
|
@@ -2,9 +2,16 @@ require 'page_magic/drivers/selenium'
|
|
2
2
|
module PageMagic
|
3
3
|
class Drivers
|
4
4
|
describe Selenium do
|
5
|
+
subject do
|
6
|
+
described_class.build(:app, browser: :selenium, options: {})
|
7
|
+
end
|
8
|
+
|
5
9
|
it 'is selenium' do
|
6
|
-
|
7
|
-
|
10
|
+
expect(subject).to be_a(Capybara::Selenium::Driver)
|
11
|
+
end
|
12
|
+
|
13
|
+
it 'sets the browser option' do
|
14
|
+
expect(subject.options[:browser]).to be(:selenium)
|
8
15
|
end
|
9
16
|
end
|
10
17
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: page_magic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0.
|
4
|
+
version: 1.0.0.alpha9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Leon Davis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-09-
|
11
|
+
date: 2015-09-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capybara
|