test_squad 0.1.1 → 0.1.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: 7c19177126b28eaa65b14395b295ffae23f491a5
4
- data.tar.gz: f9eb4ba291ae471d67a59a73793756f8701fef3c
3
+ metadata.gz: fd6d1f777e444f54019cc3946882cbf038b8876d
4
+ data.tar.gz: fa76a75fb4c20264db53e77c3998406b6077222b
5
5
  SHA512:
6
- metadata.gz: ab7f5d2d616c3704295d2956c932cd3e90d616091ef573be17d207c201d089d77706f4614e08a183a2f479c3058802e9ef6b8cac35a7b60a11731cbab847fb77
7
- data.tar.gz: 4fff993c31688c4098f2d260835fceb45f91522f0d7bc4eea019ae10ad9debf9f8c06f23e1d52f8a430ba8be7a26b0ffd71debaf651ab3c2eb329ab86bb4f72d
6
+ metadata.gz: 62b7cb2ec0d24d1724243d967f24997152f89207d8a52cbaad22b446e6f70cc2354acaac6cfa4eb292c4a07a393ee272472916ce8c36fbfcb110d25ba1a8ae9e
7
+ data.tar.gz: ee94d98be1910d7e87767175e75e170de3488dfa921d0d00d1f3eb35bdcd6f85bf941043a6ce723a530c41a13541860a2bc35c7929c9a8eb1236a5fc4c936fa7
data/README.md CHANGED
@@ -145,6 +145,8 @@ window.onload = function(){
145
145
 
146
146
  ## Troubleshooting
147
147
 
148
+ ### Route is not available
149
+
148
150
  If you have a catch-all route, add the following line to your `config/routes.rb` file. This will be required if you configure Ember.js to use `history.pushState`.
149
151
 
150
152
  ```ruby
@@ -153,12 +155,38 @@ get :tests, to: "test_squad#tests" unless Rails.env.production?
153
155
 
154
156
  Otherwise you won't be able to to run your in-browser tests.
155
157
 
158
+ ### Using NPM/Bower instead of rails-assets
159
+
160
+ You may want to use something else (NPM, Bower directly, etc). In this case, the easiest way is adding QUnit's directory to the load path.
161
+
162
+ Let's configure QUnit from NPM. Create the file `package.json` like the following:
163
+
164
+ ```json
165
+ {
166
+ "name": "myapp",
167
+ "version": "0.0.0",
168
+ "private": true
169
+ }
170
+ ```
171
+
172
+ Run the command `npm install qunitjs --save-dev` to install QUnit. The library will be available at `node_modules/qunitjs/qunit`. Now modify `config/initializers/assets.rb`, adding this directory to the load path.
173
+
174
+ ```ruby
175
+ # ...
176
+
177
+ if Rails.env.development?
178
+ Rails.application.config.assets << Rails.root.join("node_modules/qunitjs/qunit").to_s
179
+ end
180
+ ```
181
+
182
+ That's it!
183
+
156
184
  ## Configuration
157
185
 
158
186
  The rake task accepts some env variables.
159
187
 
160
188
  - `TEST_SQUAD_SERVER_HOST`: the binding host. Defaults to `localhost`.
161
- - `TEST_SQUAD_SERVER_PORT`: the server port. Defaults to `50000`.
189
+ - `TEST_SQUAD_SERVER_PORT`: the server port. Defaults to `42424`.
162
190
  - `TEST_SQUAD_SERVER_PATH`: the server path. Defaults to `/tests`.
163
191
  - `TEST_SQUAD_TIMEOUT`: how much time a test can take. Defaults to `10` (seconds).
164
192
  - `TEST_SQUAD_PHANTOMJS_BIN`: set the PhantomJS binary. Defaults to `phantomjs`.
@@ -169,7 +197,7 @@ You can configure these options using the `{test,spec}/javascript/test_squad.rb`
169
197
  TestSquad.configure do |config|
170
198
  config.framework = "qunit"
171
199
  config.server_host = "127.0.0.1"
172
- config.server_port = 50000
200
+ config.server_port = 42424
173
201
  config.server_path = "/tests"
174
202
  config.timeout = 10
175
203
  config.phantomjs_bin = "phantomjs"
@@ -190,7 +218,7 @@ Remember:
190
218
 
191
219
  - Don't mess with versioning.
192
220
  - Follow the code style already present.
193
- - Opening an issue asking if your feature/change will be welcomed it's recommended. That way you don't waste your time.
221
+ - Opening an issue asking if your feature/change will be welcomed it's recommended, so that don't waste your time.
194
222
 
195
223
  ## License
196
224
 
@@ -1,6 +1,6 @@
1
1
  class TestSquadController < ActionController::Base
2
2
  def tests
3
- load Rails.root.join(TestSquad.test_directory, 'test_squad.rb').to_s
3
+ load Rails.root.join(TestSquad.test_directory, "test_squad.rb").to_s
4
4
  render TestSquad.configuration.framework
5
5
  end
6
6
  end
@@ -1,14 +1,14 @@
1
1
  <!DOCTYPE html>
2
- <html>
2
+ <html lang="<%= I18n.locale %>">
3
3
  <head>
4
4
  <meta charset="utf-8">
5
5
  <title>Ember: <%= TestSquad.app_class_name %></title>
6
- <%= stylesheet_link_tag 'qunit', 'test_squad/ember' %>
6
+ <%= stylesheet_link_tag "qunit", "test_squad/ember" %>
7
7
  </head>
8
8
  <body>
9
9
  <div id="qunit"></div>
10
10
  <div id="qunit-fixture"></div>
11
11
  <div id="ember-testing-container"><div id="ember-testing"></div></div>
12
- <%= javascript_include_tag 'qunit', 'test_squad/qunit-phantom', 'test_helper' %>
12
+ <%= javascript_include_tag "qunit", "test_squad/qunit-phantom", "test_helper" %>
13
13
  </body>
14
14
  </html>
@@ -1,12 +1,12 @@
1
1
  <!DOCTYPE html>
2
- <html>
2
+ <html lang="<%= I18n.locale %>">
3
3
  <head>
4
4
  <meta charset="utf-8">
5
5
  <title>Jasmine: <%= TestSquad.app_class_name %></title>
6
6
 
7
- <%= favicon_link_tag 'jasmine/jasmine_favicon.png' %>
8
- <%= stylesheet_link_tag 'jasmine/jasmine' %>
9
- <%= javascript_include_tag 'jasmine/jasmine', 'jasmine/jasmine-html', 'test_squad/jasmine-phantom', 'jasmine/boot', 'spec_helper' %>
7
+ <%= favicon_link_tag "jasmine/jasmine_favicon.png" %>
8
+ <%= stylesheet_link_tag "jasmine/jasmine" %>
9
+ <%= javascript_include_tag "jasmine/jasmine", "jasmine/jasmine-html", "test_squad/jasmine-phantom", "jasmine/boot", "spec_helper" %>
10
10
  </head>
11
11
 
12
12
  <body>
@@ -1,11 +1,12 @@
1
- <html>
1
+ <!DOCTYPE html>
2
+ <html lang="<%= I18n.locale %>">
2
3
  <head>
3
4
  <meta charset="utf-8">
4
5
  <title>Mocha: <%= TestSquad.app_class_name %></title>
5
- <%= stylesheet_link_tag 'mocha' %>
6
+ <%= stylesheet_link_tag "mocha" %>
6
7
  </head>
7
8
  <body>
8
9
  <div id="mocha"></div>
9
- <%= javascript_include_tag 'mocha', 'test_squad/mocha-reporter', 'spec_helper' %>
10
+ <%= javascript_include_tag "mocha", "test_squad/mocha-reporter", "spec_helper" %>
10
11
  </body>
11
12
  </html>
@@ -1,13 +1,13 @@
1
1
  <!DOCTYPE html>
2
- <html>
2
+ <html lang="<%= I18n.locale %>">
3
3
  <head>
4
4
  <meta charset="utf-8">
5
5
  <title>QUnit: <%= TestSquad.app_class_name %></title>
6
- <%= stylesheet_link_tag 'qunit' %>
6
+ <%= stylesheet_link_tag "qunit" %>
7
7
  </head>
8
8
  <body>
9
9
  <div id="qunit"></div>
10
10
  <div id="qunit-fixture"></div>
11
- <%= javascript_include_tag 'qunit', 'test_squad/qunit-phantom', 'test_helper' %>
11
+ <%= javascript_include_tag "qunit", "test_squad/qunit-phantom", "test_helper" %>
12
12
  </body>
13
13
  </html>
data/config/routes.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  Rails.application.routes.draw do
2
2
  unless Rails.env.production?
3
- get 'tests' => 'test_squad#tests', format: false, as: false
3
+ get "tests" => "test_squad#tests", format: false, as: false
4
4
  end
5
5
  end
@@ -35,7 +35,8 @@ module TestSquad
35
35
  Port: config.server_port,
36
36
  Host: config.server_host,
37
37
  Logger: logger,
38
- AccessLog: []
38
+ AccessLog: [],
39
+ Silent: true
39
40
  end
40
41
  end
41
42
 
@@ -1,3 +1,3 @@
1
1
  module TestSquad
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: test_squad
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nando Vieira
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-08 00:00:00.000000000 Z
11
+ date: 2016-04-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails