Skip to content
This repository
Browse code

Rename jasmine.yaml to jasmine.yml.

  • Loading branch information...
commit 1b8a4804b7fb8335f9c14c17540f210d56b51bba 1 parent 6562230
Rajan Agaskar authored January 27, 2010
4  bin/jasmine
@@ -37,9 +37,9 @@ if ARGV[0] == 'init'
37 37
   rails_tasks_dir = dest_path('lib/tasks')
38 38
   if File.exist?(rails_tasks_dir)
39 39
     copy_unless_exists('lib/tasks/jasmine.rake')
40  
-    copy_unless_exists('spec/javascripts/support/jasmine-rails.yaml', 'spec/javascripts/support/jasmine.yaml')
  40
+    copy_unless_exists('spec/javascripts/support/jasmine-rails.yml', 'spec/javascripts/support/jasmine.yml')
41 41
   else
42  
-    copy_unless_exists('spec/javascripts/support/jasmine.yaml')
  42
+    copy_unless_exists('spec/javascripts/support/jasmine.yml')
43 43
     write_mode = 'w'
44 44
     if File.exist?(dest_path('Rakefile'))
45 45
       load dest_path('Rakefile')
2  generators/jasmine/jasmine_generator.rb
@@ -9,7 +9,7 @@ def manifest
9 9
       m.directory "spec/javascripts/support"
10 10
       m.file "spec/javascripts/support/jasmine_config.rb", "spec/javascripts/support/jasmine_config.rb"
11 11
       m.file "spec/javascripts/support/jasmine_spec.rb", "spec/javascripts/support/jasmine_spec.rb"
12  
-      m.file "spec/javascripts/support/jasmine-rails.yaml", "spec/javascripts/support/jasmine.yaml"
  12
+      m.file "spec/javascripts/support/jasmine-rails.yml", "spec/javascripts/support/jasmine.yml"
13 13
 
14 14
       m.directory "lib/tasks"
15 15
       m.file "lib/tasks/jasmine.rake", "lib/tasks/jasmine.rake"
10  generators/jasmine/templates/spec/javascripts/support/jasmine-rails.yaml
... ...
@@ -1,10 +0,0 @@
1  
-src_files:
2  
-  - javascripts/prototype.js
3  
-  - javascripts/effects.js
4  
-  - javascripts/controls.js
5  
-  - javascripts/dragdrop.js
6  
-  - javascripts/application.js
7  
-spec_files:
8  
-  - **/*.js
9  
-src_dir: public
10  
-spec_dir: spec/javascripts
20  generators/jasmine/templates/spec/javascripts/support/jasmine-rails.yml
... ...
@@ -0,0 +1,20 @@
  1
+#  Return an array of filepaths relative to src_dir to include before jasmine specs.
  2
+src_files:
  3
+  - javascripts/prototype.js
  4
+  - javascripts/effects.js
  5
+  - javascripts/controls.js
  6
+  - javascripts/dragdrop.js
  7
+  - javascripts/application.js
  8
+
  9
+#  Return an array of stylesheet filepaths relative to src_dir to include before jasmine specs.
  10
+stylesheets:
  11
+  - stylesheets/**/*.css
  12
+#  Return an array of filepaths relative to spec_dir to include before jasmine specs.
  13
+spec_files:
  14
+  - **/*.js
  15
+
  16
+#  Source directory path. Your src_files must be returned relative to this path. Will use root if left blank.
  17
+src_dir: public
  18
+
  19
+#  Spec directory path. Your spec_files must be returned relative to this path.
  20
+spec_dir: spec/javascripts
10  generators/jasmine/templates/spec/javascripts/support/jasmine.yaml
... ...
@@ -1,10 +0,0 @@
1  
-#src_files:
2  
-#  - lib/source1.js
3  
-#  - lib/source2.js
4  
-#  - dist/**/*.js
5  
-#stylesheets:
6  
-#  - css/style.css
7  
-#spec_files:
8  
-#  -
9  
-#src_dir:
10  
-#spec_dir: spec/javascripts
20  generators/jasmine/templates/spec/javascripts/support/jasmine.yml
... ...
@@ -0,0 +1,20 @@
  1
+#  Return an array of filepaths relative to src_dir to include before jasmine specs.
  2
+#src_files:
  3
+#  - lib/source1.js
  4
+#  - lib/source2.js
  5
+#  - dist/**/*.js
  6
+
  7
+#  Return an array of stylesheet filepaths relative to src_dir to include before jasmine specs.
  8
+#stylesheets:
  9
+#  - css/style.css
  10
+#  - stylesheets/*.css
  11
+
  12
+#  Return an array of filepaths relative to spec_dir to include before jasmine specs.
  13
+#spec_files:
  14
+#  - **/*.js
  15
+
  16
+#  Source directory path. Your src_files must be returned relative to this path. Will use root if left blank.
  17
+#src_dir:
  18
+
  19
+#  Spec directory path. Your spec_files must be returned relative to this path.
  20
+#spec_dir: spec/javascripts
6  jasmine.gemspec
@@ -9,7 +9,7 @@ Gem::Specification.new do |s|
9 9
 
10 10
   s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11 11
   s.authors = ["Rajan Agaskar", "Christian Williams"]
12  
-  s.date = %q{2010-01-26}
  12
+  s.date = %q{2010-01-27}
13 13
   s.default_executable = %q{jasmine}
14 14
   s.description = %q{Javascript BDD test framework}
15 15
   s.email = %q{ragaskar@gmail.com}
@@ -23,8 +23,8 @@ Gem::Specification.new do |s|
23 23
      "generators/jasmine/templates/lib/tasks/jasmine.rake",
24 24
      "generators/jasmine/templates/spec/javascripts/ExampleSpec.js",
25 25
      "generators/jasmine/templates/spec/javascripts/SpecHelper.js",
26  
-     "generators/jasmine/templates/spec/javascripts/support/jasmine-rails.yaml",
27  
-     "generators/jasmine/templates/spec/javascripts/support/jasmine.yaml",
  26
+     "generators/jasmine/templates/spec/javascripts/support/jasmine-rails.yml",
  27
+     "generators/jasmine/templates/spec/javascripts/support/jasmine.yml",
28 28
      "generators/jasmine/templates/spec/javascripts/support/jasmine_config.rb",
29 29
      "generators/jasmine/templates/spec/javascripts/support/jasmine_spec.rb",
30 30
      "jasmine/contrib/ruby/jasmine_runner.rb",
41  spec/config_spec.rb
@@ -4,11 +4,14 @@
4 4
   before(:each) do
5 5
     @template_dir = File.expand_path(File.join(File.dirname(__FILE__), "../generators/jasmine/templates"))
6 6
     @config = Jasmine::Config.new
7  
-    @config.stub!(:src_dir).and_return(File.join(@template_dir, "public"))
8  
-    @config.stub!(:spec_dir).and_return(File.join(@template_dir, "spec"))
9 7
   end
10 8
 
11  
-  describe "simple_config" do
  9
+  describe "configuration" do
  10
+    before(:each) do
  11
+      @config.stub!(:src_dir).and_return(File.join(@template_dir, "public"))
  12
+      @config.stub!(:spec_dir).and_return(File.join(@template_dir, "spec"))
  13
+    end
  14
+
12 15
     it "if sources.yaml not found" do
13 16
       File.stub!(:exist?).and_return(false)
14 17
       @config.src_files.should == []
@@ -20,7 +23,7 @@
20 23
       }
21 24
     end
22 25
 
23  
-    it "if sources.yaml is empty" do
  26
+    it "if jasmine.yml is empty" do
24 27
       @config.stub!(:simple_config_file).and_return(File.join(@template_dir, 'spec/javascripts/support/jasmine.yaml'))
25 28
       YAML.stub!(:load).and_return(false)
26 29
       @config.src_files.should == []
@@ -32,8 +35,8 @@
32 35
       }
33 36
     end
34 37
 
35  
-    it "using default jasmine.yaml" do
36  
-      @config.stub!(:simple_config_file).and_return(File.join(@template_dir, 'spec/javascripts/support/jasmine.yaml'))
  38
+    it "using default jasmine.yml" do
  39
+      @config.stub!(:simple_config_file).and_return(File.join(@template_dir, 'spec/javascripts/support/jasmine.yml'))
37 40
       @config.src_files.should == []
38 41
       @config.spec_files.should == ['javascripts/ExampleSpec.js', 'javascripts/SpecHelper.js']
39 42
       @config.mappings.should == {
@@ -43,7 +46,7 @@
43 46
     end
44 47
 
45 48
     it "simple_config stylesheets" do
46  
-      @config.stub!(:simple_config_file).and_return(File.join(@template_dir, 'spec/javascripts/support/jasmine.yaml'))
  49
+      @config.stub!(:simple_config_file).and_return(File.join(@template_dir, 'spec/javascripts/support/jasmine.yml'))
47 50
       YAML.stub!(:load).and_return({'stylesheets' => ['foo.css', 'bar.css']})
48 51
       Dir.stub!(:glob).and_return do |glob_string|
49 52
         glob_string
@@ -60,7 +63,7 @@
60 63
           original_glob.call(glob_string)
61 64
         end
62 65
       end
63  
-      @config.stub!(:simple_config_file).and_return(File.join(@template_dir, 'spec/javascripts/support/jasmine-rails.yaml'))
  66
+      @config.stub!(:simple_config_file).and_return(File.join(@template_dir, 'spec/javascripts/support/jasmine-rails.yml'))
64 67
       @config.spec_files.should == ['javascripts/ExampleSpec.js', 'javascripts/SpecHelper.js']
65 68
       @config.src_files.should == ['javascripts/prototype.js',
66 69
                                    'javascripts/effects.js',
@@ -77,6 +80,21 @@
77 80
         '/__spec__/javascripts/SpecHelper.js',
78 81
       ]
79 82
     end
  83
+
  84
+    it "should provide a list of all spec files with full paths" do
  85
+      @config.spec_files_full_paths.should == [
  86
+        File.join(@template_dir, 'spec/javascripts/ExampleSpec.js'),
  87
+        File.join(@template_dir, 'spec/javascripts/SpecHelper.js')
  88
+      ]
  89
+    end
  90
+
  91
+  end
  92
+
  93
+  it "src_dir uses root when src dir is blank" do
  94
+    @config.stub!(:project_root).and_return('some_project_root')
  95
+    @config.stub!(:simple_config_file).and_return(File.join(@template_dir, 'spec/javascripts/support/jasmine.yml'))
  96
+    YAML.stub!(:load).and_return({'src_dir' => nil})
  97
+    @config.src_dir.should == 'some_project_root'
80 98
   end
81 99
 
82 100
 
@@ -87,11 +105,4 @@
87 105
     }
88 106
   end
89 107
 
90  
-  it "should provide a list of all spec files with full paths" do
91  
-    @config.spec_files_full_paths.should == [
92  
-      File.join(@template_dir, 'spec/javascripts/ExampleSpec.js'),
93  
-      File.join(@template_dir, 'spec/javascripts/SpecHelper.js')
94  
-    ]
95  
-  end
96  
-
97 108
 end

0 notes on commit 1b8a480

Please sign in to comment.
Something went wrong with that request. Please try again.