jasmine-blanket 2.0.2 → 2.0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +16 -0
- data/lib/jasmine-blanket.rb +44 -0
- data/lib/jasmine-blanket/configuration.rb +7 -0
- data/lib/jasmine-blanket/version.rb +1 -1
- data/lib/run.html.erb +25 -0
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cfc7a45a66b1bf0a2ab128a0516ffbf8c94caa50
|
4
|
+
data.tar.gz: 9e58a5b967956bc4c1bfb5e9bab3fa049a7f7306
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cdf0fac467600670de8116ce20d9ef791109b9a64b5d78d155a692e847beeb71b098e2d9c5114d118e650eff889640d817ecebd145537e4e0cbac43662f03b94
|
7
|
+
data.tar.gz: 90725bc9d01fdecfdedc2cf0c9816360ccac143fd3e77914dea2157c7a84a468fbd6515d9a59ffbc53ecd06e1b1aab0a551f3d47627b148eb919c2f93f893aa3
|
data/README.md
CHANGED
@@ -27,8 +27,24 @@ Or directly include it in your test runner with `/assets/blanket.js` and `/asset
|
|
27
27
|
|
28
28
|
## Usage
|
29
29
|
|
30
|
+
For Blanket.js
|
30
31
|
[Blanket JS Usage](http://blanketjs.org/)
|
31
32
|
|
33
|
+
Adding JS Folders that you want covered by Blanket. Note: it's not very smart at the moment.
|
34
|
+
|
35
|
+
In jasmine.yml
|
36
|
+
|
37
|
+
included_blanket_folders:
|
38
|
+
- '/backbone/'
|
39
|
+
|
40
|
+
excluded_blanket_folders:
|
41
|
+
- '__spec__'
|
42
|
+
- '/templates/'
|
43
|
+
|
44
|
+
In jasmine_helper.rb
|
45
|
+
|
46
|
+
Jasmine::Blanket.load_configuration_from_yaml
|
47
|
+
|
32
48
|
## Version
|
33
49
|
|
34
50
|
Matches Jasmine version
|
data/lib/jasmine-blanket.rb
CHANGED
@@ -1,9 +1,53 @@
|
|
1
1
|
require 'rails'
|
2
2
|
require 'blanket/rails'
|
3
|
+
require "jasmine-blanket/configuration"
|
3
4
|
require "jasmine-blanket/engine"
|
4
5
|
require "jasmine-blanket/version"
|
5
6
|
|
6
7
|
module Jasmine
|
7
8
|
module Blanket
|
9
|
+
require 'yaml'
|
10
|
+
|
11
|
+
def self.configure(&block)
|
12
|
+
block.call(self.config)
|
13
|
+
end
|
14
|
+
|
15
|
+
def self.initialize_config
|
16
|
+
@config = Jasmine::Blanket::Configuration.new
|
17
|
+
end
|
18
|
+
|
19
|
+
def self.config
|
20
|
+
initialize_config
|
21
|
+
@config
|
22
|
+
end
|
23
|
+
|
24
|
+
def self.load_configuration_from_yaml(path = nil)
|
25
|
+
path ||= File.join(Dir.pwd, 'spec', 'javascripts', 'support', 'jasmine.yml')
|
26
|
+
if File.exist?(path)
|
27
|
+
yaml_config = YAML::load(File.read(path))
|
28
|
+
|
29
|
+
Jasmine::Blanket.configure do |config|
|
30
|
+
config.included_folders = yaml_config["included_blanket_folders"] if yaml_config["included_blanket_folders"].any?
|
31
|
+
config.excluded_folders = yaml_config["excluded_blanket_folders"] if yaml_config["excluded_blanket_folders"].any?
|
32
|
+
end
|
33
|
+
else
|
34
|
+
raise ConfigNotFound, "Unable to load jasmine config from #{path}"
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
# Temporary hacks
|
39
|
+
def self.included_folders
|
40
|
+
@config.included_folders
|
41
|
+
end
|
42
|
+
|
43
|
+
def self.excluded_folders
|
44
|
+
@config.excluded_folders
|
45
|
+
end
|
46
|
+
|
47
|
+
end
|
48
|
+
|
49
|
+
# Monkey Patch to use our template
|
50
|
+
def self.runner_template
|
51
|
+
File.read(File.join(File.dirname(__FILE__), "run.html.erb"))
|
8
52
|
end
|
9
53
|
end
|
data/lib/run.html.erb
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
|
2
|
+
<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
|
3
|
+
<head>
|
4
|
+
<meta content="text/html;charset=UTF-8" http-equiv="Content-Type"/>
|
5
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
6
|
+
<title>Jasmine suite</title>
|
7
|
+
<link rel="shortcut icon" type="image/png" href="/__images__/jasmine_favicon.png">
|
8
|
+
<% css_files.each do |css_file| %>
|
9
|
+
<link rel="stylesheet" href="<%= css_file %>" type="text/css" media="screen"/>
|
10
|
+
<% end %>
|
11
|
+
|
12
|
+
<% js_files.each do |js_file| %>
|
13
|
+
<% cover = false %>
|
14
|
+
<% Jasmine::Blanket.included_folders.each {|folder| cover = true if js_file.include?(folder)} %>
|
15
|
+
<% Jasmine::Blanket.excluded_folders.each {|folder| cover = false if js_file.include?(folder)} %>
|
16
|
+
|
17
|
+
<script src="<%= js_file %>" type="text/javascript" <%= 'data-cover' if cover %>></script>
|
18
|
+
<% end %>
|
19
|
+
|
20
|
+
</head>
|
21
|
+
<!-- TODO: turbolinks breaks spec filter links -->
|
22
|
+
<body data-no-turbolink>
|
23
|
+
<div id="jasmine_content"></div>
|
24
|
+
</body>
|
25
|
+
</html>
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jasmine-blanket
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.2
|
4
|
+
version: 2.0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Scott Carleton
|
@@ -66,8 +66,10 @@ files:
|
|
66
66
|
- Rakefile
|
67
67
|
- jasmine-blanket.gemspec
|
68
68
|
- lib/jasmine-blanket.rb
|
69
|
+
- lib/jasmine-blanket/configuration.rb
|
69
70
|
- lib/jasmine-blanket/engine.rb
|
70
71
|
- lib/jasmine-blanket/version.rb
|
72
|
+
- lib/run.html.erb
|
71
73
|
- vendor/assets/javascripts/jasmine-blanket.js
|
72
74
|
homepage: https://github.com/ScotterC/jasmine-blanket
|
73
75
|
licenses:
|