shoot 0.2.0 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: aa001afe6a8a35dde26b5eeba9151f245ee1736e
4
- data.tar.gz: 75ea88b0c093cea26a72f6f1bb53c31f2a3a73f1
3
+ metadata.gz: 481486a2446a53d6b2bde074a155edbaa2b56e81
4
+ data.tar.gz: f77ab42fb88e621cf40af833d46f56a65a8f382c
5
5
  SHA512:
6
- metadata.gz: 92466e634907b357cf47ba9f3f71538ee616e511a235292471cce8968ff887c8f623d526c474e86b2cb6e45af0fdfcdb9d5dc8dd4fb2cef8a5f7ec8368d74fe3
7
- data.tar.gz: abad6c48e58b3eccb46a14c2bf959c36391c947e2cb98789d6def263708396558bb333d6ecbd9b3b354689e551d57a30ff9a33259b3be40802f427fde9a7be66
6
+ metadata.gz: b9dd3b4c732bc39c04b2766a1103bee644396c618ad6233f91effebf719420b37b67ddf45b52117c7dd688b296978e38b0887727f6b883d96955cf62ec5b2d2c
7
+ data.tar.gz: f19d120611d6220a4f845449a95c2f7830b9ac21ce5ec52a2675a1ce4aed9ee185ada5cf665d8d1715b956afeb4fbb221c04cf4dd17a9750a0bd2e4c0c2faf75
data/README.md CHANGED
@@ -1,3 +1,6 @@
1
+ ![](https://img.shields.io/gem/v/shoot.svg)
2
+ ![](https://img.shields.io/codeclimate/github/joaomilho/shoot.svg)
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.dump(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
@@ -1,3 +1,3 @@
1
1
  module Shoot
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.2"
3
3
  end
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.0
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-03-02 00:00:00.000000000 Z
11
+ date: 2015-04-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler