shoot 0.2.0 → 0.2.2
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/README.md +15 -0
- data/lib/shoot/cli.rb +9 -1
- data/lib/shoot/version.rb +1 -1
- data/spec/cli_spec.rb +12 -1
- 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: 481486a2446a53d6b2bde074a155edbaa2b56e81
|
4
|
+
data.tar.gz: f77ab42fb88e621cf40af833d46f56a65a8f382c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b9dd3b4c732bc39c04b2766a1103bee644396c618ad6233f91effebf719420b37b67ddf45b52117c7dd688b296978e38b0887727f6b883d96955cf62ec5b2d2c
|
7
|
+
data.tar.gz: f19d120611d6220a4f845449a95c2f7830b9ac21ce5ec52a2675a1ce4aed9ee185ada5cf665d8d1715b956afeb4fbb221c04cf4dd17a9750a0bd2e4c0c2faf75
|
data/README.md
CHANGED
@@ -1,3 +1,6 @@
|
|
1
|
+

|
2
|
+

|
3
|
+
|
1
4
|
# Shoot
|
2
5
|
|
3
6
|
Shoot is a helper library to take screenshots using BrowserStack. If you don't need a full integration test coupled with screenshots, it's a simpler choice.
|
@@ -62,6 +65,18 @@ Now run:
|
|
62
65
|
|
63
66
|
This will run all the methods of MyScenario and generate screenshots for all active browsers.
|
64
67
|
|
68
|
+
The resulting images will be saved on <font size="7"> `.screenshots`</font> folder.
|
69
|
+
|
70
|
+
You can choose to deactivate the browsers you don't wanna use, based on id as well. Example:
|
71
|
+
|
72
|
+
$ shoot deactivate 2
|
73
|
+
|
74
|
+
This will deactivate (given your output is the same as above) chrome 16 on OS X Snow Leopard.
|
75
|
+
|
76
|
+
If you want to deactivate all the active browsers at once you can run:
|
77
|
+
|
78
|
+
$ shoot deactivate_all
|
79
|
+
|
65
80
|
|
66
81
|
## Contributing
|
67
82
|
|
data/lib/shoot/cli.rb
CHANGED
@@ -49,6 +49,14 @@ module Shoot
|
|
49
49
|
table json[id.to_i - 2, 5]
|
50
50
|
end
|
51
51
|
|
52
|
+
desc 'deactivate_all', 'Deactivate all the platforms'
|
53
|
+
def deactivate_all
|
54
|
+
_active.each do |child|
|
55
|
+
child['active'] = false
|
56
|
+
end
|
57
|
+
save_json
|
58
|
+
end
|
59
|
+
|
52
60
|
no_commands do
|
53
61
|
def require_file(file)
|
54
62
|
require Dir.pwd + '/' + file
|
@@ -80,7 +88,7 @@ module Shoot
|
|
80
88
|
end
|
81
89
|
|
82
90
|
def save_json
|
83
|
-
File.write(BROWSERS_PATH, JSON.
|
91
|
+
File.write(BROWSERS_PATH, JSON.pretty_generate(json))
|
84
92
|
end
|
85
93
|
|
86
94
|
def fetch_json_and_prepare
|
data/lib/shoot/version.rb
CHANGED
data/spec/cli_spec.rb
CHANGED
@@ -18,7 +18,6 @@ describe 'Shoot::CLI' do
|
|
18
18
|
|
19
19
|
describe 'list' do
|
20
20
|
before do
|
21
|
-
allow(cli).to receive(:json).and_return(mock_json)
|
22
21
|
allow(cli).to receive(:table) {|arg| arg }
|
23
22
|
end
|
24
23
|
|
@@ -70,6 +69,18 @@ describe 'Shoot::CLI' do
|
|
70
69
|
end
|
71
70
|
end
|
72
71
|
|
72
|
+
describe 'deactivate_all' do
|
73
|
+
before do
|
74
|
+
allow(cli).to receive(:table) {|arg| arg }
|
75
|
+
allow(cli).to receive(:save_json)
|
76
|
+
end
|
77
|
+
|
78
|
+
it 'deactivates the browser' do
|
79
|
+
expect{ cli.deactivate_all }.to change{ mock_json[1]['active'] }.from(true).to(false)
|
80
|
+
expect(cli).to have_received(:save_json)
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
73
84
|
describe 'scenario' do
|
74
85
|
before do
|
75
86
|
class Foo
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shoot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Juan Lulkin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-04-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|