Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Support the inclusion of files that exist only via the asset pipeline

  • Loading branch information...
commit 14e8ee9156094a016c92f43a20ccee83aa8b68a6 1 parent 0a2a9d2
Davis W. Frank & Rajan Agaskar authored
View
4 generators/jasmine/templates/jasmine-example/SpecRunner.html
@@ -10,11 +10,11 @@
<script type="text/javascript" src="lib/jasmine-1.1.0.rc1/jasmine.js"></script>
<script type="text/javascript" src="lib/jasmine-1.1.0.rc1/jasmine-html.js"></script>
- <!-- include spec files here... -->
+ <!-- include source files here... -->
<script type="text/javascript" src="spec/SpecHelper.js"></script>
<script type="text/javascript" src="spec/PlayerSpec.js"></script>
- <!-- include source files here... -->
+ <!-- include spec files here... -->
<script type="text/javascript" src="src/Player.js"></script>
<script type="text/javascript" src="src/Song.js"></script>
View
4 lib/jasmine/config.rb
@@ -70,7 +70,7 @@ def match_files(dir, patterns)
chosen, negated = [positive, negative].collect do |patterns|
patterns.collect do |pattern|
matches = Dir.glob(File.join(dir, pattern.gsub(/^!/,'')))
- matches.collect {|f| f.sub("#{dir}/", "")}.sort
+ matches.empty? && !(pattern =~ /\*|^\!/) ? pattern : matches.collect {|f| f.sub("#{dir}/", "")}.sort
end.flatten.uniq
end
chosen - negated
@@ -159,4 +159,4 @@ def stylesheets
end
end
end
-end
+end
View
1  lib/jasmine/server.rb
@@ -74,7 +74,6 @@ def call(env)
def self.app(config)
Rack::Builder.app do
use Rack::Head
-
if Jasmine::Dependencies.rails_3_asset_pipeline?
map('/assets') do
run Rails.application.assets
View
13 spec/config_spec.rb
@@ -162,6 +162,18 @@
end
end
+ describe "should permit explicity-declared filenames to pass through regardless of their existence" do
+ before(:each) do
+ Dir.stub!(:glob).and_return { |glob_string| [] }
+ fake_config = Hash.new.stub!(:[]).and_return { |x| ["file1.ext", "!file2.ext", "**/*file3.ext"] }
+ @config.stub!(:simple_config).and_return(fake_config)
+ end
+
+ it "should contain explicitly files" do
+ @config.src_files.should == ["file1.ext"]
+ end
+ end
+
describe "should allow .gitignore style negation (!pattern)" do
before(:each) do
Dir.stub!(:glob).and_return { |glob_string| [glob_string] }
@@ -305,4 +317,5 @@ def stub_env_hash(hash)
end
end
end
+
end
Please sign in to comment.
Something went wrong with that request. Please try again.