ghostbuster 0.3.9 → 0.3.10

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/README.md CHANGED
@@ -26,7 +26,7 @@ Your `Ghostfile` handles your configuration. To set the pattern use:
26
26
 
27
27
  To enable (or disable) screenshots use:
28
28
 
29
- ghost.take_screenshots! # or #do_not_takescreenshots! defaults to take_screenshots!
29
+ ghost.take_screenshots! # or #do_not_take_screenshots! defaults to take_screenshots!
30
30
 
31
31
  To set the directory your screenshots will save to use:
32
32
 
@@ -64,7 +64,7 @@ You should get some output that looks something like this.
64
64
  ✓ Form input
65
65
  ✓ Link traversal
66
66
  ✗ Bad link traversal
67
- Assert location failed: Excepted http://127.0.0.1:4567/not-correct, got http://127.0.0.1:4567/
67
+ Assert location failed: Expected http://127.0.0.1:4567/not-correct, got http://127.0.0.1:4567/
68
68
  ✗ Form input not equal
69
69
  Assert first for selector #out did not meet expectations
70
70
 
data/Rakefile CHANGED
@@ -19,7 +19,7 @@ namespace :test do
19
19
  begin
20
20
  matcher.each{|m| out[m] or raise("Couldn't match for #{m.inspect}")}
21
21
  real_size = Dir['*.png'].to_a.size
22
- expected_size = 21
22
+ expected_size = 22
23
23
  raise("There are a weird number of screenshots, expected #{expected_size}, got #{real_size}") unless expected_size == real_size
24
24
  exit
25
25
  rescue
@@ -38,7 +38,7 @@ namespace :test do
38
38
  task :non_working do
39
39
  print "non_working_ghost ... "
40
40
  Dir.chdir("test/non_working_ghost") do
41
- matcher = [/0 success, 10 failure, 1 pending/, /Bad link traversal\s+Assert location failed: Excepted http:\/\/127\.0\.0\.1:4567\/not-correct, got http:\/\/127\.0\.0\.1:4567\//, /Form input not equal\s+Assert first for selector #out did not meet expectations/, /To an invalid URL\s+The request for http:\/\/127\.0\.0\.1:this-url-is-invalid failed/, /This test will explode!\s+I hate you!/, /This test has no succeed\s+This test took too long/, /This test has a custom assertion name\s+Assert first "custom assertion name" did not meet expectations/, /Bad click selector\s+Couldn't find element 0 for selector i-just-made-this-up/, /Bad click follow\s+Assert not location failed: Excepted not http:\/\/127\.0\.0\.1:4567\/, got http:\/\/127\.0\.0\.1:4567\//]
41
+ matcher = [/0 success, 10 failure, 1 pending/m, %r|Bad link traversal\s+Assert location failed: Expected http://127.0.0.1:4567/not-correct, got http://127.0.0.1:4567/|im, /Form input not equal\s+Assert first for selector #out did not meet expectations/m, /To an invalid URL\s+The request for http:\/\/127\.0\.0\.1:this-url-is-invalid failed/m, /This test will explode!\s+I hate you!/m, /This test has no succeed\s+This test took too long/m, /This test has a custom assertion name\s+Assert first "custom assertion name" did not meet expectations/m, /Bad click selector\s+Couldn't find element 0 for selector i-just-made-this-up/m, /Bad click follow\s+Assert not location failed: Expected not http:\/\/127\.0\.0\.1:4567\/, got http:\/\/127\.0\.0\.1:4567\//m]
42
42
  fork {
43
43
  ENV['BUNDLE_GEMFILE'] = File.expand_path("./Gemfile")
44
44
  `bundle install`
@@ -1,4 +1,4 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  require 'ghostbuster'
4
- Ghostbuster::Runner.new(ARGV).run
4
+ exit Ghostbuster::Runner.new(ARGV).run
@@ -248,7 +248,7 @@ class Body
248
248
  location = @test.runner.normalizePath(path)
249
249
  @test.assert opts, (withValue) ->
250
250
  assertionDescription = if opts.name then " \"#{opts.name}\"" else ""
251
- alerter = if test.getLastError()? then "" else "alert('Assert location#{assertionDescription} failed: Excepted #{location}, got '+currentLocation);"
251
+ alerter = if test.getLastError()? then "" else "alert('Assert location#{assertionDescription} failed: Expected #{location}, got '+currentLocation);"
252
252
  eval "
253
253
  var fn = function() {
254
254
  var currentLocation = window.location.href;
@@ -268,7 +268,7 @@ class Body
268
268
  location = @test.runner.normalizePath(path)
269
269
  @test.assert opts, (withValue) ->
270
270
  assertionDescription = if opts.name then " \"#{opts.name}\"" else ""
271
- alerter = if test.getLastError()? then "" else "alert('Assert not location#{assertionDescription} failed: Excepted not #{location}, got '+currentLocation);"
271
+ alerter = if test.getLastError()? then "" else "alert('Assert not location#{assertionDescription} failed: Expected not #{location}, got '+currentLocation);"
272
272
  eval "
273
273
  var fn = function() {
274
274
  var currentLocation = window.location.href;
@@ -63,7 +63,7 @@ class Ghostbuster
63
63
  end
64
64
  end
65
65
  end
66
- exit(status.to_i)
66
+ status.to_i
67
67
  end
68
68
 
69
69
  def self.run(path)
@@ -73,9 +73,9 @@ class Ghostbuster
73
73
  private
74
74
  def compress_and_copy_screenshots
75
75
  FileUtils.rm_f(File.join(@config.screenshot_dir, "*.png"))
76
- files = Dir[File.join(@temporary_screenshot_dir, '*.png')].to_a
76
+ files = Dir[File.join(@temporary_screenshot_dir, '*.png')].to_a.sort
77
77
  files.map{|f| f[/(.*?)-\d+\.png$/, 1]}.uniq.each do |cluster|
78
- images = files.select{|f| f[cluster]}.sort_by{|f| Integer(f[/\-(\d+)\.png$/, 1])}
78
+ images = files.select{|f| f[/#{Regexp.quote(cluster)}-\d+\.png$/]}.sort_by{|f| Integer(f[/\-(\d+)\.png$/, 1])}
79
79
  idx = 0
80
80
  while idx < (images.size - 1)
81
81
  if Digest::MD5.file(images[idx]) == Digest::MD5.file(images[idx + 1])
@@ -1,3 +1,3 @@
1
1
  class Ghostbuster
2
- VERSION = '0.3.9'
2
+ VERSION = '0.3.10'
3
3
  end
@@ -1,4 +1,4 @@
1
1
  ghost.pattern = "test_*.{coffee,js}"
2
- ghost.do_not_take_screenshots! # or do_not_takescreenshots! defaults to true
2
+ ghost.do_not_take_screenshots! # or do_not_take_screenshots! defaults to true
3
3
  ghost.screenshot_dir = '.'
4
4
  ghost.screenshot_dimensions 800, 2000
@@ -1,4 +1,4 @@
1
1
  ghost.pattern = "test_*.{coffee,js}"
2
- ghost.take_screenshots! # or do_not_takescreenshots! defaults to true
2
+ ghost.take_screenshots! # or do_not_take_screenshots! defaults to true
3
3
  ghost.screenshot_dir = '.'
4
4
  ghost.screenshot_dimensions 800, 2000
metadata CHANGED
@@ -1,95 +1,69 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: ghostbuster
3
- version: !ruby/object:Gem::Version
4
- hash: 1
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.3.10
5
5
  prerelease:
6
- segments:
7
- - 0
8
- - 3
9
- - 9
10
- version: 0.3.9
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Josh Hull
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2011-11-03 00:00:00 Z
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
21
- version_requirements: &id001 !ruby/object:Gem::Requirement
12
+ date: 2011-12-07 00:00:00.000000000Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: thin
16
+ requirement: &70342192270060 !ruby/object:Gem::Requirement
22
17
  none: false
23
- requirements:
18
+ requirements:
24
19
  - - ~>
25
- - !ruby/object:Gem::Version
26
- hash: 9
27
- segments:
28
- - 1
29
- - 2
30
- - 11
20
+ - !ruby/object:Gem::Version
31
21
  version: 1.2.11
32
- requirement: *id001
33
22
  type: :development
34
23
  prerelease: false
35
- name: thin
36
- - !ruby/object:Gem::Dependency
37
- version_requirements: &id002 !ruby/object:Gem::Requirement
24
+ version_requirements: *70342192270060
25
+ - !ruby/object:Gem::Dependency
26
+ name: rake
27
+ requirement: &70342192268980 !ruby/object:Gem::Requirement
38
28
  none: false
39
- requirements:
29
+ requirements:
40
30
  - - ~>
41
- - !ruby/object:Gem::Version
42
- hash: 49
43
- segments:
44
- - 0
45
- - 8
46
- - 7
31
+ - !ruby/object:Gem::Version
47
32
  version: 0.8.7
48
- requirement: *id002
49
33
  type: :development
50
34
  prerelease: false
51
- name: rake
52
- - !ruby/object:Gem::Dependency
53
- version_requirements: &id003 !ruby/object:Gem::Requirement
35
+ version_requirements: *70342192268980
36
+ - !ruby/object:Gem::Dependency
37
+ name: bundler
38
+ requirement: &70342192268140 !ruby/object:Gem::Requirement
54
39
  none: false
55
- requirements:
40
+ requirements:
56
41
  - - ~>
57
- - !ruby/object:Gem::Version
58
- hash: 11
59
- segments:
60
- - 1
61
- - 0
62
- - 14
42
+ - !ruby/object:Gem::Version
63
43
  version: 1.0.14
64
- requirement: *id003
65
44
  type: :development
66
45
  prerelease: false
67
- name: bundler
68
- - !ruby/object:Gem::Dependency
69
- version_requirements: &id004 !ruby/object:Gem::Requirement
46
+ version_requirements: *70342192268140
47
+ - !ruby/object:Gem::Dependency
48
+ name: sinatra
49
+ requirement: &70342192266580 !ruby/object:Gem::Requirement
70
50
  none: false
71
- requirements:
72
- - - ">="
73
- - !ruby/object:Gem::Version
74
- hash: 3
75
- segments:
76
- - 0
77
- version: "0"
78
- requirement: *id004
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
79
55
  type: :development
80
56
  prerelease: false
81
- name: sinatra
57
+ version_requirements: *70342192266580
82
58
  description: Integration testing ftw.
83
- email:
59
+ email:
84
60
  - joshbuddy@gmail.com
85
- executables:
61
+ executables:
86
62
  - ghostbuster
87
63
  - setup-ghostbuster
88
64
  extensions: []
89
-
90
65
  extra_rdoc_files: []
91
-
92
- files:
66
+ files:
93
67
  - .gitignore
94
68
  - Gemfile
95
69
  - README.md
@@ -129,38 +103,29 @@ files:
129
103
  - test/working_ghost/test_injs.js
130
104
  homepage: https://github.com/joshbuddy/ghostbuster
131
105
  licenses: []
132
-
133
106
  post_install_message:
134
107
  rdoc_options: []
135
-
136
- require_paths:
108
+ require_paths:
137
109
  - lib
138
- required_ruby_version: !ruby/object:Gem::Requirement
110
+ required_ruby_version: !ruby/object:Gem::Requirement
139
111
  none: false
140
- requirements:
141
- - - ">="
142
- - !ruby/object:Gem::Version
143
- hash: 3
144
- segments:
145
- - 0
146
- version: "0"
147
- required_rubygems_version: !ruby/object:Gem::Requirement
112
+ requirements:
113
+ - - ! '>='
114
+ - !ruby/object:Gem::Version
115
+ version: '0'
116
+ required_rubygems_version: !ruby/object:Gem::Requirement
148
117
  none: false
149
- requirements:
150
- - - ">="
151
- - !ruby/object:Gem::Version
152
- hash: 3
153
- segments:
154
- - 0
155
- version: "0"
118
+ requirements:
119
+ - - ! '>='
120
+ - !ruby/object:Gem::Version
121
+ version: '0'
156
122
  requirements: []
157
-
158
123
  rubyforge_project: ghostbuster
159
124
  rubygems_version: 1.8.10
160
125
  signing_key:
161
126
  specification_version: 3
162
127
  summary: Integration testing ftw
163
- test_files:
128
+ test_files:
164
129
  - test/non_working_ghost/Gemfile
165
130
  - test/non_working_ghost/Ghostfile
166
131
  - test/non_working_ghost/start.sh
@@ -183,3 +148,4 @@ test_files:
183
148
  - test/working_ghost/test_ghost.coffee
184
149
  - test/working_ghost/test_ghostmore.coffee
185
150
  - test/working_ghost/test_injs.js
151
+ has_rdoc: