geckodriver-helper 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,27 @@
1
+ require 'spec_helper'
2
+ require 'json'
3
+
4
+ describe Geckodriver::Helper::GeckoReleasePageParser do
5
+
6
+ let!(:data) do
7
+ file = File.read(File.join(File.dirname(__FILE__), 'assets/gecko-releases.json'))
8
+ JSON.parse(file)
9
+ end
10
+
11
+ describe '#download_url' do
12
+ %w(mac linux32 linux64 win).each do |platform|
13
+
14
+ it "returns correspond URL for the #{platform} platform" do
15
+ parser = Geckodriver::Helper::GeckoReleasePageParser.new(platform)
16
+ case platform
17
+ when 'mac' then file = 'macos.tar.gz'
18
+ when 'linux32' then file = 'linux32.tar.gz'
19
+ when 'linux64' then file = 'linux64.tar.gz'
20
+ when 'win' then file = 'win32.zip'
21
+ else raise "#{platform} is not supported"
22
+ end
23
+ expect(parser.download_url(data)).to eq "https://github.com/mozilla/geckodriver/releases/download/v0.11.1/geckodriver-v0.11.1-#{file}"
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,22 @@
1
+ require 'spec_helper'
2
+
3
+ describe Geckodriver::Helper do
4
+ let(:helper) { Geckodriver::Helper.new }
5
+
6
+ describe '#binary_path' do
7
+ context 'on a linux platform' do
8
+ before { allow(helper).to receive(:platform) { 'linux32' } }
9
+ it { expect(helper.binary_path).to match(/geckodriver$/) }
10
+ end
11
+
12
+ context 'on a mac platform' do
13
+ before { allow(helper).to receive(:platform) { 'mac' } }
14
+ it { expect(helper.binary_path).to match(/geckodriver$/) }
15
+ end
16
+
17
+ context 'on a windows platform' do
18
+ before { allow(helper).to receive(:platform) { 'win' } }
19
+ it { expect(helper.binary_path).to match(/geckodriver\.exe$/) }
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,2 @@
1
+ require 'rspec'
2
+ require File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib/geckodriver/helper'))
metadata ADDED
@@ -0,0 +1,138 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: geckodriver-helper
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Devico Solutions
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-11-10 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rspec
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '3.0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '3.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: archive-zip
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: 0.7.0
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: 0.7.0
55
+ - !ruby/object:Gem::Dependency
56
+ name: faraday
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: 0.9.2
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: 0.9.2
69
+ - !ruby/object:Gem::Dependency
70
+ name: faraday_middleware
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: 0.10.0
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: 0.10.0
83
+ description: |-
84
+ Easy installation and use of geckodriver, that provides the HTTP API
85
+ described by the WebDriver protocol to communicate with Gecko browsers, such as Firefox.
86
+ email:
87
+ - info@devico.io
88
+ executables:
89
+ - geckodriver
90
+ - geckodriver-update
91
+ extensions: []
92
+ extra_rdoc_files: []
93
+ files:
94
+ - ".travis.yml"
95
+ - CHANGELOG.md
96
+ - Gemfile
97
+ - LICENSE.txt
98
+ - README.md
99
+ - Rakefile
100
+ - bin/geckodriver
101
+ - bin/geckodriver-update
102
+ - geckodriver-helper.gemspec
103
+ - lib/geckodriver/helper.rb
104
+ - lib/geckodriver/helper/gecko_release_page_parser.rb
105
+ - lib/geckodriver/helper/version.rb
106
+ - spec/assets/gecko-releases.json
107
+ - spec/gecko_release_page_parser_spec.rb
108
+ - spec/helper_spec.rb
109
+ - spec/spec_helper.rb
110
+ homepage: https://github.com/DevicoSolutions/geckodriver-helper
111
+ licenses:
112
+ - MIT
113
+ metadata: {}
114
+ post_install_message:
115
+ rdoc_options: []
116
+ require_paths:
117
+ - lib
118
+ required_ruby_version: !ruby/object:Gem::Requirement
119
+ requirements:
120
+ - - ">="
121
+ - !ruby/object:Gem::Version
122
+ version: '0'
123
+ required_rubygems_version: !ruby/object:Gem::Requirement
124
+ requirements:
125
+ - - ">="
126
+ - !ruby/object:Gem::Version
127
+ version: '0'
128
+ requirements: []
129
+ rubyforge_project:
130
+ rubygems_version: 2.4.8
131
+ signing_key:
132
+ specification_version: 4
133
+ summary: Easy installation and use of geckodriver.
134
+ test_files:
135
+ - spec/assets/gecko-releases.json
136
+ - spec/gecko_release_page_parser_spec.rb
137
+ - spec/helper_spec.rb
138
+ - spec/spec_helper.rb