Skip to content

Commit

Permalink
Move spec for .gitignore style negation to config_spec.rb.
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian Williams authored and Christian Williams committed Nov 9, 2010
1 parent 473fb49 commit 23adfae
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 31 deletions.
19 changes: 0 additions & 19 deletions spec/config_mod_spec.rb

This file was deleted.

23 changes: 11 additions & 12 deletions spec/config_spec.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
require File.expand_path(File.join(File.dirname(__FILE__), "spec_helper"))

describe Jasmine::Config do

describe "configuration" do

before(:all) do
temp_dir_before

Expand Down Expand Up @@ -34,7 +32,6 @@
end

describe "defaults" do

it "src_dir uses root when src dir is blank" do
@config.stub!(:project_root).and_return('some_project_root')
@config.stub!(:simple_config_file).and_return(File.join(@template_dir, 'spec/javascripts/support/jasmine.yml'))
Expand All @@ -46,10 +43,8 @@
@config.stub!(:project_root).and_return('some_project_root')
@config.simple_config_file.should == (File.join('some_project_root', 'spec/javascripts/support/jasmine.yml'))
end

end


describe "simple_config" do
before(:each) do
@config.stub!(:src_dir).and_return(File.join(@rails_dir, "."))
Expand Down Expand Up @@ -87,7 +82,6 @@
]
end


describe "if sources.yaml not found" do
before(:each) do
File.stub!(:exist?).and_return(false)
Expand All @@ -101,7 +95,6 @@
YAML.stub!(:load).and_return(false)
end
it_should_behave_like "simple_config defaults"

end

# describe "using default jasmine.yml" do
Expand All @@ -113,7 +106,6 @@
# end
#


describe "should use the first appearance of duplicate filenames" do
before(:each) do
Dir.stub!(:glob).and_return { |glob_string| [glob_string] }
Expand Down Expand Up @@ -152,7 +144,18 @@
File.expand_path("spec/javascripts/file2.ext", @rails_dir)
]
end
end

describe "should allow .gitignore style negation (!pattern)" do
before(:each) do
Dir.stub!(:glob).and_return { |glob_string| [glob_string] }
fake_config = Hash.new.stub!(:[]).and_return {|x| ["file1.ext", "!file1.ext", "file2.ext"]}
@config.stub!(:simple_config).and_return(fake_config)
end

it "should not contain negated files" do
@config.src_files.should == [ "file2.ext"]
end
end

it "simple_config stylesheets" do
Expand All @@ -162,7 +165,6 @@
@config.stylesheets.should == ['foo.css', 'bar.css']
end


it "using rails jasmine.yml" do
@config.stub!(:simple_config_file).and_return(File.join(@template_dir, 'spec/javascripts/support/jasmine-rails.yml'))
@config.spec_files.should == ['PlayerSpec.js']
Expand Down Expand Up @@ -196,11 +198,8 @@
'/__spec__/helpers/SpecHelper.js',
'/__spec__/PlayerSpec.js'
]

end

end

end

describe "browser configuration" do
Expand Down

0 comments on commit 23adfae

Please sign in to comment.