konacha 3.2.5 → 3.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/History.md +4 -0
- data/konacha.gemspec +1 -1
- data/lib/konacha.rb +10 -8
- data/lib/konacha/engine.rb +2 -1
- data/spec/dummy/app/sections/my_section/my_section.js.coffee +2 -0
- data/spec/dummy/app/sections/my_section/my_section_spec.js.coffee +6 -0
- data/spec/konacha_spec.rb +25 -0
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8156101061d59bd05a03b424d495add7840d937c
|
4
|
+
data.tar.gz: 42033b36a832484f6af799423b55fe31a8f947f0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 56ed2a6bd7dbaff44fea2718f5d37cfd992f7333b485d5feba5a452bbd772ef1cca438f18c154432139b670105c478ee89e281ded1a113f09590b93dba07b649
|
7
|
+
data.tar.gz: 05c06314f71c147a416b8bb7009e74c6a949f4f7fc99eb8d23f101fd2968944e836e8843c42f624c4a13b19ff405365491889decd002daddd7d4dae9efd546cd
|
data/History.md
CHANGED
data/konacha.gemspec
CHANGED
@@ -17,7 +17,7 @@ the asset pipeline and engines.}
|
|
17
17
|
gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
18
18
|
gem.name = "konacha"
|
19
19
|
gem.require_paths = ["lib"]
|
20
|
-
gem.version = "3.
|
20
|
+
gem.version = "3.3.0"
|
21
21
|
gem.license = "MIT"
|
22
22
|
|
23
23
|
gem.add_dependency "railties", ">= 3.1", "< 5"
|
data/lib/konacha.rb
CHANGED
@@ -32,17 +32,19 @@ module Konacha
|
|
32
32
|
delegate :port, :spec_dir, :spec_matcher, :application, :driver, :runner_port, :formatters, :to => :config
|
33
33
|
|
34
34
|
def spec_root
|
35
|
-
File.join(Rails.root,
|
35
|
+
[config.spec_dir].flatten.map {|d| File.join(Rails.root, d)}
|
36
36
|
end
|
37
37
|
|
38
38
|
def spec_paths
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
39
|
+
spec_root.flat_map do |root|
|
40
|
+
Rails.application.assets.each_entry(root).find_all { |pathname|
|
41
|
+
config.spec_matcher === pathname.basename.to_s &&
|
42
|
+
(pathname.extname == '.js' || Tilt[pathname]) &&
|
43
|
+
Rails.application.assets.content_type_of(pathname) == 'application/javascript'
|
44
|
+
}.map { |pathname|
|
45
|
+
pathname.to_s.gsub(File.join(root, ''), '')
|
46
|
+
}.sort
|
47
|
+
end
|
46
48
|
end
|
47
49
|
end
|
48
50
|
end
|
data/lib/konacha/engine.rb
CHANGED
@@ -44,7 +44,8 @@ module Konacha
|
|
44
44
|
options.runner_port ||= nil
|
45
45
|
options.formatters ||= self.class.formatters
|
46
46
|
|
47
|
-
|
47
|
+
spec_dirs = [options.spec_dir].flatten
|
48
|
+
app.config.assets.paths += spec_dirs.map{|d| app.root.join(d).to_s}
|
48
49
|
app.config.assets.raise_runtime_errors = false
|
49
50
|
end
|
50
51
|
end
|
data/spec/konacha_spec.rb
CHANGED
@@ -98,6 +98,31 @@ describe Konacha do
|
|
98
98
|
subject.size.should == 1
|
99
99
|
end
|
100
100
|
end
|
101
|
+
|
102
|
+
context 'with additional spec directories' do
|
103
|
+
around do |example|
|
104
|
+
begin
|
105
|
+
spec_dir = Konacha.config.spec_dir
|
106
|
+
Konacha.configure {|c| c.spec_dir = ["spec/javascripts", "app/sections"]}
|
107
|
+
example.run
|
108
|
+
Rails.application.config.assets.paths << Rails.root.join("app/sections").to_s
|
109
|
+
ensure
|
110
|
+
Konacha.configure {|c| c.spec_dir = spec_dir}
|
111
|
+
|
112
|
+
end
|
113
|
+
end
|
114
|
+
|
115
|
+
it 'has specs from spec/javascripts' do
|
116
|
+
subject.should include("array_sum_js_spec.js")
|
117
|
+
subject.should include("array_sum_cs_spec.js.coffee")
|
118
|
+
end
|
119
|
+
|
120
|
+
it 'has specs from app/sections' do
|
121
|
+
Konacha.spec_root.should include Rails.root.join("app/sections").to_s
|
122
|
+
subject.should include("my_section/my_section_spec.js.coffee")
|
123
|
+
end
|
124
|
+
end
|
125
|
+
|
101
126
|
end
|
102
127
|
|
103
128
|
it "can be configured in an initializer" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: konacha
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Firebaugh
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-10-
|
11
|
+
date: 2014-10-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|
@@ -254,6 +254,8 @@ files:
|
|
254
254
|
- spec/controllers/specs_controller_spec.rb
|
255
255
|
- spec/dummy/app/assets/javascripts/application.js
|
256
256
|
- spec/dummy/app/assets/javascripts/array_sum.js.coffee
|
257
|
+
- spec/dummy/app/sections/my_section/my_section.js.coffee
|
258
|
+
- spec/dummy/app/sections/my_section/my_section_spec.js.coffee
|
257
259
|
- spec/dummy/config.ru
|
258
260
|
- spec/dummy/config/application.rb
|
259
261
|
- spec/dummy/config/boot.rb
|
@@ -330,6 +332,8 @@ test_files:
|
|
330
332
|
- spec/controllers/specs_controller_spec.rb
|
331
333
|
- spec/dummy/app/assets/javascripts/application.js
|
332
334
|
- spec/dummy/app/assets/javascripts/array_sum.js.coffee
|
335
|
+
- spec/dummy/app/sections/my_section/my_section.js.coffee
|
336
|
+
- spec/dummy/app/sections/my_section/my_section_spec.js.coffee
|
333
337
|
- spec/dummy/config.ru
|
334
338
|
- spec/dummy/config/application.rb
|
335
339
|
- spec/dummy/config/boot.rb
|