qunit-rails 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +0 -0
- data/Gemfile.lock +20 -20
- data/{MIT-LICENSE → LICENSE.md} +3 -1
- data/README.md +28 -8
- data/app/views/qunit/rails/test/index.html.erb +2 -1
- data/config/initializers/qunit-rails.rb +1 -1
- data/lib/generators/qunit/install_generator.rb +4 -4
- data/lib/generators/templates/{test_helper.js.coffee → test_helper.coffee} +0 -0
- data/qunit-rails.gemspec +9 -7
- data/vendor/assets/javascripts/qunit.js +393 -173
- data/vendor/assets/stylesheets/qunit.css +20 -7
- metadata +15 -12
- data/lib/qunit/rails/version.rb +0 -5
data/CHANGELOG.md
ADDED
File without changes
|
data/Gemfile.lock
CHANGED
@@ -1,35 +1,35 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
qunit-rails (0.0.
|
5
|
-
railties (
|
4
|
+
qunit-rails (0.0.2)
|
5
|
+
railties (>= 3.2.3)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: http://rubygems.org/
|
9
9
|
specs:
|
10
|
-
actionpack (3.2.
|
11
|
-
activemodel (= 3.2.
|
12
|
-
activesupport (= 3.2.
|
10
|
+
actionpack (3.2.8)
|
11
|
+
activemodel (= 3.2.8)
|
12
|
+
activesupport (= 3.2.8)
|
13
13
|
builder (~> 3.0.0)
|
14
14
|
erubis (~> 2.7.0)
|
15
|
-
journey (~> 1.0.
|
15
|
+
journey (~> 1.0.4)
|
16
16
|
rack (~> 1.4.0)
|
17
17
|
rack-cache (~> 1.2)
|
18
18
|
rack-test (~> 0.6.1)
|
19
|
-
sprockets (~> 2.1.
|
20
|
-
activemodel (3.2.
|
21
|
-
activesupport (= 3.2.
|
19
|
+
sprockets (~> 2.1.3)
|
20
|
+
activemodel (3.2.8)
|
21
|
+
activesupport (= 3.2.8)
|
22
22
|
builder (~> 3.0.0)
|
23
|
-
activesupport (3.2.
|
23
|
+
activesupport (3.2.8)
|
24
24
|
i18n (~> 0.6)
|
25
25
|
multi_json (~> 1.0)
|
26
|
-
builder (3.0.
|
26
|
+
builder (3.0.3)
|
27
27
|
erubis (2.7.0)
|
28
28
|
hike (1.2.1)
|
29
|
-
i18n (0.6.
|
30
|
-
journey (1.0.
|
31
|
-
json (1.7.
|
32
|
-
multi_json (1.3.
|
29
|
+
i18n (0.6.1)
|
30
|
+
journey (1.0.4)
|
31
|
+
json (1.7.5)
|
32
|
+
multi_json (1.3.6)
|
33
33
|
rack (1.4.1)
|
34
34
|
rack-cache (1.2)
|
35
35
|
rack (>= 0.4)
|
@@ -37,13 +37,13 @@ GEM
|
|
37
37
|
rack
|
38
38
|
rack-test (0.6.1)
|
39
39
|
rack (>= 1.0)
|
40
|
-
railties (3.2.
|
41
|
-
actionpack (= 3.2.
|
42
|
-
activesupport (= 3.2.
|
40
|
+
railties (3.2.8)
|
41
|
+
actionpack (= 3.2.8)
|
42
|
+
activesupport (= 3.2.8)
|
43
43
|
rack-ssl (~> 1.3.2)
|
44
44
|
rake (>= 0.8.7)
|
45
45
|
rdoc (~> 3.4)
|
46
|
-
thor (
|
46
|
+
thor (>= 0.14.6, < 2.0)
|
47
47
|
rake (0.9.2.2)
|
48
48
|
rdoc (3.12)
|
49
49
|
json (~> 1.4)
|
@@ -51,7 +51,7 @@ GEM
|
|
51
51
|
hike (~> 1.2)
|
52
52
|
rack (~> 1.0)
|
53
53
|
tilt (~> 1.1, != 1.3.0)
|
54
|
-
thor (0.
|
54
|
+
thor (0.16.0)
|
55
55
|
tilt (1.3.3)
|
56
56
|
|
57
57
|
PLATFORMS
|
data/{MIT-LICENSE → LICENSE.md}
RENAMED
data/README.md
CHANGED
@@ -1,15 +1,18 @@
|
|
1
|
-
|
1
|
+
QUnit on Rails
|
2
|
+
==============
|
2
3
|
|
3
4
|
QUnit JavaScript Unit Testing framework for Rails.
|
4
5
|
|
5
|
-
|
6
|
+
Requirements
|
7
|
+
------------
|
6
8
|
|
7
9
|
* Ruby 1.9.x
|
8
10
|
* Rails 3.2+
|
9
11
|
|
10
|
-
|
12
|
+
Getting Started
|
13
|
+
---------------
|
11
14
|
|
12
|
-
QUnit on Rails works with Rails 3.2.
|
15
|
+
QUnit on Rails works with Rails 3.2. You can add it to your Gemfile with:
|
13
16
|
|
14
17
|
group :development, :test do
|
15
18
|
gem 'qunit-rails'
|
@@ -35,7 +38,7 @@ If you prefer *CoffeeScript*, you can run:
|
|
35
38
|
|
36
39
|
rails g qunit:install -c
|
37
40
|
|
38
|
-
This will generate a `test_helper.
|
41
|
+
This will generate a `test_helper.coffe` file instead of `test_helper.js`.
|
39
42
|
|
40
43
|
## Usage
|
41
44
|
|
@@ -52,6 +55,7 @@ Also, this pulls in all your test files from the `javascripts` folder into
|
|
52
55
|
**QUnit-Rails**:
|
53
56
|
|
54
57
|
test/javascripts/*_test.js
|
58
|
+
test/javascripts/*_test.coffee
|
55
59
|
test/javascripts/*_test.js.coffee
|
56
60
|
test/javascripts/*_test.js.erb
|
57
61
|
|
@@ -65,7 +69,7 @@ Here's an example `test/javascripts/foo_test.js`:
|
|
65
69
|
|
66
70
|
If you're not comfortable with loading all the javascript defined in the
|
67
71
|
`application.js` manifest file, you can delete `//= require application`
|
68
|
-
from `test_helper.js` or `#= require application` from `test_helper.
|
72
|
+
from `test_helper.js` or `#= require application` from `test_helper.coffee`
|
69
73
|
and use the `require` dependency mechanism in your tests to pull the dependencies.
|
70
74
|
|
71
75
|
Here's an example `test/javascripts/foo_test.js`:
|
@@ -89,6 +93,22 @@ directives to include the right css files:
|
|
89
93
|
*= require_tree .
|
90
94
|
*/
|
91
95
|
|
96
|
+
### Overriding `index.html`
|
97
|
+
|
98
|
+
You can set your own custom Test Runner, by overriding
|
99
|
+
the default `index.html.erb`. Create a new file in
|
100
|
+
`app/views/qunit/rails/test/index.html.erb` and edit it
|
101
|
+
whichever you prefer:
|
102
|
+
|
103
|
+
<html>
|
104
|
+
<head>
|
105
|
+
<title>My Custom Test Runner</title>
|
106
|
+
</head>
|
107
|
+
<body>
|
108
|
+
<h1>My Custom Test Runner</h1>
|
109
|
+
</body>
|
110
|
+
</html>
|
111
|
+
|
92
112
|
## Run Tests
|
93
113
|
|
94
114
|
### Start server
|
@@ -101,11 +121,11 @@ Go to `http://localhost:3000/qunit` to see the QUnit Test Runner.
|
|
101
121
|
|
102
122
|
### From the CLI
|
103
123
|
|
104
|
-
[
|
124
|
+
[Eventually](/)
|
105
125
|
|
106
126
|
### Autotest
|
107
127
|
|
108
|
-
[
|
128
|
+
[Eventually](/)
|
109
129
|
|
110
130
|
## What's next?
|
111
131
|
|
@@ -1 +1 @@
|
|
1
|
-
Rails.application.config.assets.paths << Rails.root.join(
|
1
|
+
Rails.application.config.assets.paths << Rails.root.join('test', 'javascripts') << Rails.root.join('test', 'stylesheets')
|
@@ -5,17 +5,17 @@ module Qunit
|
|
5
5
|
|
6
6
|
desc 'Setup Qunit into test'
|
7
7
|
|
8
|
-
class_option :coffee, type: :boolean, aliases:
|
9
|
-
desc:
|
8
|
+
class_option :coffee, type: :boolean, aliases: '-c', default: false,
|
9
|
+
desc: 'Support for CoffeeScript'
|
10
10
|
|
11
11
|
def create_setup_files
|
12
12
|
empty_directory 'test/javascripts'
|
13
13
|
empty_directory 'test/stylesheets'
|
14
14
|
|
15
15
|
if !options[:coffee]
|
16
|
-
template 'test_helper.js',
|
16
|
+
template 'test_helper.js', 'test/javascripts/test_helper.js'
|
17
17
|
else
|
18
|
-
template 'test_helper.
|
18
|
+
template 'test_helper.coffee', 'test/javascripts/test_helper.coffee'
|
19
19
|
end
|
20
20
|
|
21
21
|
template 'test_helper.css', 'test/stylesheets/test_helper.css'
|
File without changes
|
data/qunit-rails.gemspec
CHANGED
@@ -1,17 +1,19 @@
|
|
1
|
-
require File.expand_path('../lib/qunit/rails/version', __FILE__)
|
2
|
-
|
3
1
|
Gem::Specification.new do |gem|
|
4
2
|
gem.name = 'qunit-rails'
|
5
|
-
gem.version =
|
3
|
+
gem.version = '0.0.3'
|
6
4
|
|
7
5
|
gem.authors = ['Francesco Rodriguez']
|
8
6
|
gem.email = ['lrodriguezsanc@gmail.com']
|
9
7
|
gem.homepage = 'https://github.com/frodsan/qunit-rails'
|
10
8
|
gem.summary = 'Qunit for Rails 3.2+'
|
11
|
-
gem.description =
|
9
|
+
gem.description = gem.summary
|
10
|
+
|
11
|
+
gem.files = `git ls-files`.split($\)
|
12
|
+
gem.require_paths = ['lib']
|
13
|
+
gem.extra_rdoc_files = ['CHANGELOG.md', 'LICENSE.md', 'README.md']
|
14
|
+
gem.rdoc_options = ['--charset=UTF-8']
|
12
15
|
|
13
|
-
gem.
|
14
|
-
gem.require_paths = ['lib']
|
16
|
+
gem.required_ruby_version = '>= 1.9.2'
|
15
17
|
|
16
|
-
gem.add_dependency 'railties', '
|
18
|
+
gem.add_dependency 'railties', '>= 3.2.3'
|
17
19
|
end
|