chinchilla 0.1.0 → 0.1.1

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.
@@ -1,5 +1,3 @@
1
- (function() {
2
-
3
1
  QUnit.Runner = {
4
2
  done: false,
5
3
  dots: "",
@@ -40,5 +38,3 @@ QUnit.done = function(results) {
40
38
  };
41
39
 
42
40
  QUnit.config.autorun = false;
43
-
44
- })();
@@ -39,6 +39,8 @@ module Chinchilla
39
39
  @results ||= begin
40
40
  session.visit(url)
41
41
 
42
+ session.execute_script(runner_js)
43
+
42
44
  dots_printed = 0
43
45
 
44
46
  begin
@@ -57,6 +59,10 @@ module Chinchilla
57
59
  end
58
60
  end
59
61
 
62
+ def runner_js
63
+ "(function() {"+File.read(File.expand_path("../runner.js", __FILE__))+"})();"
64
+ end
65
+
60
66
  def failed_examples
61
67
  examples.select { |example| not example.passed? }
62
68
  end
@@ -24,6 +24,10 @@ module Chinchilla
24
24
  @driver ||= @options[:driver] || :poltergeist
25
25
  end
26
26
 
27
+ def poltergeist?
28
+ driver == :poltergeist
29
+ end
30
+
27
31
  def application
28
32
  @application ||= @options[:application] || default_application
29
33
  end
@@ -76,7 +80,12 @@ module Chinchilla
76
80
  end
77
81
 
78
82
  def session
79
- @session ||= Capybara::Session.new(driver, application)
83
+ @session ||= begin
84
+ if poltergeist? && !defined?(Capybara::Poltergeist)
85
+ require "capybara/poltergeist"
86
+ end
87
+ Capybara::Session.new(driver, application)
88
+ end
80
89
  end
81
90
  end
82
91
  end
@@ -1,3 +1,3 @@
1
1
  module Chinchilla
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
data/lib/chinchilla.rb CHANGED
@@ -1,7 +1,6 @@
1
1
  require "chinchilla/version"
2
2
 
3
3
  require "capybara"
4
- require "capybara/poltergeist"
5
4
  require "colorize"
6
5
 
7
6
  require "chinchilla/runner"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chinchilla
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-09-28 00:00:00.000000000 Z
12
+ date: 2012-09-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: capybara
@@ -72,10 +72,10 @@ files:
72
72
  - README.md
73
73
  - Rakefile
74
74
  - chinchilla.gemspec
75
- - lib/assets/javascripts/qunit-runner.js
76
75
  - lib/chinchilla.rb
77
76
  - lib/chinchilla/runner.rb
78
77
  - lib/chinchilla/runner/example.rb
78
+ - lib/chinchilla/runner/runner.js
79
79
  - lib/chinchilla/runner/test.rb
80
80
  - lib/chinchilla/version.rb
81
81
  homepage: ''
@@ -92,7 +92,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
92
92
  version: '0'
93
93
  segments:
94
94
  - 0
95
- hash: -3891497850019772180
95
+ hash: 2808188431047913734
96
96
  required_rubygems_version: !ruby/object:Gem::Requirement
97
97
  none: false
98
98
  requirements:
@@ -101,7 +101,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
101
101
  version: '0'
102
102
  segments:
103
103
  - 0
104
- hash: -3891497850019772180
104
+ hash: 2808188431047913734
105
105
  requirements: []
106
106
  rubyforge_project:
107
107
  rubygems_version: 1.8.23