gatling 1.0.3 → 1.0.4

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.
data/Gemfile CHANGED
@@ -8,4 +8,5 @@ group :development, :test, :smoke do
8
8
  gem 'rack-test'
9
9
  gem 'rake'
10
10
  gem 'rspec-instafail'
11
+ gem 'pry'
11
12
  end
data/foo.rb ADDED
@@ -0,0 +1,9 @@
1
+ puts ENV['GEM_PATH']
2
+ def foo
3
+ puts ">"
4
+ bar = false unless ENV['BARRR']='true'
5
+ puts ">>>"
6
+ puts bar.inspect
7
+ end
8
+
9
+ foo
data/lib/gatling.rb CHANGED
@@ -2,6 +2,7 @@ require 'RMagick'
2
2
  require_relative 'gatling/capture_element'
3
3
  require 'capybara'
4
4
  require 'capybara/dsl'
5
+ require 'gatling/config'
5
6
 
6
7
 
7
8
  module Gatling
@@ -17,14 +18,15 @@ module Gatling
17
18
  @expected = expected
18
19
  @actual = actual
19
20
 
21
+ puts "actual inspect: " + actual.inspect
20
22
  @capture_element = Gatling::CaptureElement.new(@actual)
21
23
 
24
+
22
25
  @reference_image_path = Gatling::Configuration.reference_image_path
23
26
  @trainer_toggle = Gatling::Configuration.trainer_toggle
24
27
 
25
28
  @expected_image = "#{@reference_image_path}/#{@expected}"
26
29
  @expected_filename = "#{@expected}".sub(/\.[a-z]*/,'')
27
-
28
30
  end
29
31
 
30
32
  def create_diff
@@ -48,11 +50,11 @@ module Gatling
48
50
  @capture_element.save_element(element, @expected_filename, @reference_image_path)
49
51
  puts "Saved #{@expected_image} as reference"
50
52
  else
51
- puts "#{@expected_image.upcase} ALREADY EXISTS. REFERENCE IMAGE WAS NOT OVERWRITTEN. PLEASE DELETE OLD FILE TO UPDATE USING TRAINER"
52
- end
53
+ puts "#{@expected_image.upcase} ALREADY EXISTS. REFERENCE IMAGE WAS NOT OVERWRITTEN. PLEASE DELETE THE OLD FILE TO UPDATE USING TRAINER"
54
+ end
53
55
  end
54
56
 
55
- def matches?
57
+ def matches?
56
58
  @cropped_element = @capture_element.crop
57
59
  if !@trainer_toggle
58
60
  if File.exists?(@expected_image)
@@ -1,4 +1,4 @@
1
- module Gatling
1
+ module Gatling
2
2
  class CaptureElement
3
3
 
4
4
  def initialize element_to_capture
@@ -17,7 +17,8 @@ module Gatling
17
17
 
18
18
  #captures the uncropped full screen
19
19
  begin
20
- page.driver.browser.save_screenshot("#{temp_dir}/temp.png")
20
+
21
+ Capybara.page.driver.browser.save_screenshot("#{temp_dir}/temp.png")
21
22
  temp_screenshot = Magick::Image.read("#{temp_dir}/temp.png").first
22
23
  rescue
23
24
  raise "Could not save screenshot to #{temp_dir}. Please make sure you have permission"
@@ -1,3 +1,3 @@
1
1
  module Gatling
2
- VERSION = "1.0.3"
2
+ VERSION = "1.0.4"
3
3
  end
data/spec/spec_helper.rb CHANGED
@@ -13,7 +13,6 @@ require 'capybara/rspec'
13
13
  require 'gatling'
14
14
  require 'gatling/matchers/look_like_matcher'
15
15
  require 'fileutils'
16
- require 'gatling/config'
17
16
 
18
17
  RSpec.configure do |config|
19
18
  config.color_enabled = true
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gatling
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-02-19 00:00:00.000000000Z
12
+ date: 2012-02-21 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rmagick
16
- requirement: &70310393557420 !ruby/object:Gem::Requirement
16
+ requirement: &70217162793980 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70310393557420
24
+ version_requirements: *70217162793980
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rspec-core
27
- requirement: &70310393556960 !ruby/object:Gem::Requirement
27
+ requirement: &70217162793300 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70310393556960
35
+ version_requirements: *70217162793300
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rspec
38
- requirement: &70310393556420 !ruby/object:Gem::Requirement
38
+ requirement: &70217162792460 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *70310393556420
46
+ version_requirements: *70217162792460
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: capybara
49
- requirement: &70310393555900 !ruby/object:Gem::Requirement
49
+ requirement: &70217162791640 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,7 +54,7 @@ dependencies:
54
54
  version: '0'
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *70310393555900
57
+ version_requirements: *70217162791640
58
58
  description: Add visual comparison matchers for rspec
59
59
  email:
60
60
  - grotbart@gmail.com
@@ -69,6 +69,7 @@ files:
69
69
  - LICENSE.txt
70
70
  - README.rdoc
71
71
  - Rakefile
72
+ - foo.rb
72
73
  - gatling.gemspec
73
74
  - lib/gatling.rb
74
75
  - lib/gatling/capture_element.rb
@@ -107,7 +108,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
107
108
  version: '0'
108
109
  requirements: []
109
110
  rubyforge_project: gatling
110
- rubygems_version: 1.8.10
111
+ rubygems_version: 1.8.12
111
112
  signing_key:
112
113
  specification_version: 3
113
114
  summary: Automated visual testing