Permalink
Browse files

Merge pull request #35 from joliss/test-suffix

Allow for _test suffix in addition to _spec
  • Loading branch information...
spicycode committed May 9, 2012
2 parents 7a64dd9 + d5e4750 commit 4046d5e01e89ca3eeade7c5aabd1f13340a3af88
Showing with 10 additions and 4 deletions.
  1. +1 −0 History.md
  2. +4 −3 README.md
  3. +1 −1 lib/konacha.rb
  4. 0 spec/dummy/spec/javascripts/file_ending_in_test.js
  5. +4 −0 spec/konacha_spec.rb
View
@@ -1,6 +1,7 @@
# master
* Update mocha (1.0.3) and chai (1.0.0-rc1)
+* Find files ending in `_test.*` as well as `_spec.*`
# 1.1.3
View
@@ -31,9 +31,10 @@ end
## Usage
-Create a `spec/javascripts` directory and name the files in it with a `_spec` suffix.
-You can write the specs in either JavaScript or CoffeeScript, using a `.js` or
-`.js.coffee` extension respectively, like you would any other script asset.
+Create a `spec/javascripts` directory and name the files in it with a `_spec`
+(or `_test`) suffix. You can write the specs in either JavaScript or
+CoffeeScript, using a `.js` or `.js.coffee` extension respectively, like you
+would any other script asset.
Require the assets under test and any other dependencies using Sprockets directives.
For example, suppose you wanted to test your cool JavaScript `Array#sum` method, which
View
@@ -33,7 +33,7 @@ def spec_root
end
def spec_paths
- Dir[File.join(spec_root, "**/*_spec.*")].map do |path|
+ Dir[File.join(spec_root, "**/*{_spec,_test}.*")].map do |path|
path.gsub(File.join(spec_root, ''), '')
end
end
View
@@ -26,6 +26,10 @@
it "does not include spec_helper" do
subject.should_not include("spec_helper.js")
end
+
+ it "includes *_test.* files" do
+ subject.should include("file_ending_in_test.js")
+ end
end
it "can be configured in an initializer" do

0 comments on commit 4046d5e

Please sign in to comment.