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 +4 -4
- data/README.md +31 -3
- data/app/controllers/test_squad_controller.rb +1 -1
- data/app/views/test_squad/ember.html.erb +3 -3
- data/app/views/test_squad/jasmine.html.erb +4 -4
- data/app/views/test_squad/mocha.html.erb +4 -3
- data/app/views/test_squad/qunit.html.erb +3 -3
- data/config/routes.rb +1 -1
- data/lib/test_squad/runner.rb +2 -1
- data/lib/test_squad/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fd6d1f777e444f54019cc3946882cbf038b8876d
|
4
|
+
data.tar.gz: fa76a75fb4c20264db53e77c3998406b6077222b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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 `
|
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 =
|
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
|
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,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
|
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
|
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
|
8
|
-
<%= stylesheet_link_tag
|
9
|
-
<%= javascript_include_tag
|
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
|
-
|
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
|
6
|
+
<%= stylesheet_link_tag "mocha" %>
|
6
7
|
</head>
|
7
8
|
<body>
|
8
9
|
<div id="mocha"></div>
|
9
|
-
<%= javascript_include_tag
|
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
|
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
|
11
|
+
<%= javascript_include_tag "qunit", "test_squad/qunit-phantom", "test_helper" %>
|
12
12
|
</body>
|
13
13
|
</html>
|
data/config/routes.rb
CHANGED
data/lib/test_squad/runner.rb
CHANGED
data/lib/test_squad/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2016-04-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|