capybara-screenshot 1.0.5 → 1.0.6

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: c151afcc0d6c03f1b86c6511a847fe34df99fcb9
4
- data.tar.gz: 994a9b0906c3bb53a67c75a942e72df97a9cecec
3
+ metadata.gz: 69ef8524d6a1e9eac83ce7e0118dde66868db2f4
4
+ data.tar.gz: 1b25e9089581366bef163c5c43f138c1a64dc4b6
5
5
  SHA512:
6
- metadata.gz: 6be4e5220d8f8b0abfd84e9c2bd1ef9ec797b19b38160104305db869b6f6f8ec4d27789e02eb6c0dc96dd79cc7af95e8d76b8faa3d690279356fdd8ad39a8e96
7
- data.tar.gz: 27a74af975127375130440a535cd3022d4f4771c29c2c2a4547db6dc5e8ab06063cf7a594b72715c3f987671a6706d34cd7335382a527a8954aaaea39098a3f9
6
+ metadata.gz: dd6b12eda2b5ef9478fc80f23be5180133c6d227056a59e7e8934e79f8eb3530a9030b06ce4bb1883c28d300ed4a689060e60450b8dd379cdd02bd08ef33c068
7
+ data.tar.gz: 495fb5805c72ff2ee19f72cbd90688eea958acada85fb31548f706fa67e7e9f54e925d7a483407571cc9184a2d0fdd6c231419259101fe04cff4563442ac2258
@@ -1,3 +1,10 @@
1
+ 8 March 2015 - 1.0.5 -> 1.0.6
2
+ -----------
3
+
4
+ * Removed dependency on the colored gem
5
+
6
+ Thanks to [François Bernier](https://github.com/fbernier)
7
+
1
8
  10 Feburary 2015 - 1.04 -> 1.0.5
2
9
  -----------
3
10
 
@@ -21,7 +21,6 @@ Gem::Specification.new do |s|
21
21
  s.add_dependency 'capybara', ['>= 1.0', '< 3']
22
22
  end
23
23
  s.add_dependency 'launchy'
24
- s.add_dependency 'colored'
25
24
 
26
25
  s.add_development_dependency 'rspec'
27
26
  s.add_development_dependency 'timecop'
@@ -0,0 +1,28 @@
1
+ class CapybaraScreenshot
2
+ module Helpers
3
+ extend self
4
+
5
+ COLORS =
6
+ {
7
+ "black" => 0,
8
+ "red" => 1,
9
+ "green" => 2,
10
+ "yellow" => 3,
11
+ "blue" => 4,
12
+ "purple" => 5,
13
+ "magenta" => 5,
14
+ "cyan" => 6,
15
+ "white" => 7
16
+ }
17
+
18
+ COLORS.each_pair do |color, value|
19
+ define_method color do |text|
20
+ "\033[0;#{30+value}m#{text}\033[0m"
21
+ end
22
+
23
+ define_method "bright_#{color}" do |text|
24
+ "\033[1;#{30+value}m#{text}\033[0m"
25
+ end
26
+ end
27
+ end
28
+ end
@@ -1,4 +1,5 @@
1
1
  require 'capybara-screenshot/rspec/base_reporter'
2
+ require 'capybara-screenshot/helpers'
2
3
 
3
4
  module Capybara
4
5
  module Screenshot
@@ -25,8 +26,8 @@ module Capybara
25
26
  private
26
27
  def output_screenshot_info(example)
27
28
  return unless (screenshot = example.metadata[:screenshot])
28
- output.puts(long_padding + "HTML screenshot: #{screenshot[:html]}".yellow) if screenshot[:html]
29
- output.puts(long_padding + "Image screenshot: #{screenshot[:image]}".yellow) if screenshot[:image]
29
+ output.puts(long_padding + CapybaraScreenshot::Helpers.yellow("HTML screenshot: #{screenshot[:html]}")) if screenshot[:html]
30
+ output.puts(long_padding + CapybaraScreenshot::Helpers.yellow("Image screenshot: #{screenshot[:image]}")) if screenshot[:image]
30
31
  end
31
32
 
32
33
  def long_padding
@@ -1,11 +1,4 @@
1
- if RUBY_PLATFORM =~ /win32/
2
- begin
3
- require 'Win32/Console/ANSI'
4
- rescue LoadError => e
5
- fail "win32console gem is required to output colorized messages, please add this to your Gemfile or install"
6
- end
7
- end
8
- require 'colored'
1
+ require 'capybara-screenshot/helpers'
9
2
 
10
3
  module Capybara
11
4
  module Screenshot
@@ -89,7 +82,7 @@ module Capybara
89
82
 
90
83
  private
91
84
  def output(message)
92
- puts " #{message.yellow}"
85
+ puts " #{CapybaraScreenshot::Helpers.yellow(message)}"
93
86
  end
94
87
  end
95
88
  end
@@ -1,5 +1,5 @@
1
1
  module Capybara
2
2
  module Screenshot
3
- VERSION = '1.0.5'
3
+ VERSION = '1.0.6'
4
4
  end
5
5
  end
@@ -1,4 +1,5 @@
1
1
  require 'spec_helper'
2
+ require 'capybara-screenshot/helpers'
2
3
 
3
4
  describe Capybara::Screenshot::RSpec::TextReporter do
4
5
  before do
@@ -67,7 +68,7 @@ describe Capybara::Screenshot::RSpec::TextReporter do
67
68
 
68
69
  it 'appends the html file path to the original output' do
69
70
  @reporter.send(example_failed_method, example)
70
- expect(@reporter.output.string).to eql("original failure info\n #{"HTML screenshot: path/to/html".yellow}\n")
71
+ expect(@reporter.output.string).to eql("original failure info\n #{CapybaraScreenshot::Helpers.yellow("HTML screenshot: path/to/html")}\n")
71
72
  end
72
73
  end
73
74
 
@@ -76,7 +77,7 @@ describe Capybara::Screenshot::RSpec::TextReporter do
76
77
 
77
78
  it 'appends the image path to the original output' do
78
79
  @reporter.send(example_failed_method, example)
79
- expect(@reporter.output.string).to eql("original failure info\n #{"HTML screenshot: path/to/html".yellow}\n #{"Image screenshot: path/to/image".yellow}\n")
80
+ expect(@reporter.output.string).to eql("original failure info\n #{CapybaraScreenshot::Helpers.yellow("HTML screenshot: path/to/html")}\n #{CapybaraScreenshot::Helpers.yellow("Image screenshot: path/to/image")}\n")
80
81
  end
81
82
  end
82
83
 
@@ -92,6 +93,6 @@ describe Capybara::Screenshot::RSpec::TextReporter do
92
93
  old_reporter.singleton_class.send :include, described_class
93
94
  example = example_failed_method_argument_double(screenshot: { html: "path/to/html" })
94
95
  old_reporter.send(example_failed_method, example)
95
- expect(old_reporter.output.string).to eql("original failure info\n #{"HTML screenshot: path/to/html".yellow}\n")
96
+ expect(old_reporter.output.string).to eql("original failure info\n #{CapybaraScreenshot::Helpers.yellow("HTML screenshot: path/to/html")}\n")
96
97
  end
97
98
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capybara-screenshot
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthew O'Riordan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-10 00:00:00.000000000 Z
11
+ date: 2015-03-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capybara
@@ -44,20 +44,6 @@ dependencies:
44
44
  - - ">="
45
45
  - !ruby/object:Gem::Version
46
46
  version: '0'
47
- - !ruby/object:Gem::Dependency
48
- name: colored
49
- requirement: !ruby/object:Gem::Requirement
50
- requirements:
51
- - - ">="
52
- - !ruby/object:Gem::Version
53
- version: '0'
54
- type: :runtime
55
- prerelease: false
56
- version_requirements: !ruby/object:Gem::Requirement
57
- requirements:
58
- - - ">="
59
- - !ruby/object:Gem::Version
60
- version: '0'
61
47
  - !ruby/object:Gem::Dependency
62
48
  name: rspec
63
49
  requirement: !ruby/object:Gem::Requirement
@@ -199,6 +185,7 @@ files:
199
185
  - lib/capybara-screenshot.rb
200
186
  - lib/capybara-screenshot/capybara.rb
201
187
  - lib/capybara-screenshot/cucumber.rb
188
+ - lib/capybara-screenshot/helpers.rb
202
189
  - lib/capybara-screenshot/minitest.rb
203
190
  - lib/capybara-screenshot/pruner.rb
204
191
  - lib/capybara-screenshot/rspec.rb