Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

remove specific autotest behavior

This will lighten up the codebase and we can add these features back later with a blank slate.
This and future commits will focus on the engine behavior, not on separate support for tools
  • Loading branch information...
commit 863b3480b8986f8a9c53f74c35e7759f96b95467 1 parent bd62662
@saturnflyer saturnflyer authored
View
43 lib/autotest/radiant_rails_rspec.rb → .autotest
@@ -1,38 +1,11 @@
-# (c) Copyright 2006 Nick Sieger <nicksieger@gmail.com>
-#
-# Permission is hereby granted, free of charge, to any person
-# obtaining a copy of this software and associated documentation files
-# (the "Software"), to deal in the Software without restriction,
-# including without limitation the rights to use, copy, modify, merge,
-# publish, distribute, sublicense, and/or sell copies of the Software,
-# and to permit persons to whom the Software is furnished to do so,
-# subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be
-# included in all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
-# BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
-# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-# SOFTWARE.
-
-$:.push(*Dir["vendor/rails/*/lib"])
-
-require 'active_support'
-require 'autotest/rspec'
-
Autotest.add_hook :initialize do |at|
-
+
%w{^config/ ^coverage/ ^db/ ^doc/ ^log/ ^public/ ^script ^vendor/rails ^vendor/plugins previous_failures.txt}.each do |exception|
at.add_exception(exception)
end
-
+
at.clear_mappings
-
+
at.add_mapping(%r%^(test|spec)/fixtures/(.*).yml$%) { |_, m|
["spec/models/#{m[2].singularize}_spec.rb"] + at.files_matching(%r%^spec\/views\/#{m[2]}/.*_spec\.rb$%)
}
@@ -100,12 +73,4 @@
at.add_mapping(%r%^vendor/extensions/(.*)/(.*)_extension\.rb%) { |_, m|
at.files_matching(%r%^vendor/extensions/#{m[1]}/spec/.*_spec\.rb$%) if m[1] == m[2]
}
-end
-
-class Autotest::RadiantRailsRspec < Autotest::Rspec
-
- def spec_command
- "script/spec"
- end
-
-end
+end
View
2  .rspec
@@ -0,0 +1,2 @@
+--format nested
+--color
View
3  lib/autotest/discover.rb
@@ -1,3 +0,0 @@
-Autotest.add_discovery do
- "radiant" if File.exists?(File.join('bin', 'radiant'))
-end
View
1  radiant.gemspec
@@ -47,5 +47,6 @@ a general purpose content managment system--not merely a blogging engine.}
s.add_development_dependency "rspec", "~> 2.12.0"
s.add_development_dependency "rspec-rails", "~> 2.12.2"
s.add_development_dependency "ZenTest", "4.6.2"
+ s.add_development_dependency "autotest-rails", "~> 4.1.2"
s.add_development_dependency "sqlite3", "1.3.7"
end
View
81 spec/lib/autotest_spec.rb
@@ -1,81 +0,0 @@
-require File.dirname(__FILE__) + '/../spec_helper'
-require File.join(File.dirname(__FILE__), *%w[.. .. lib autotest radiant_rails_rspec])
-require File.join(File.dirname(__FILE__), *%w[.. matchers autotest_matchers])
-
-describe Autotest::RadiantRailsRspec, "file mapping" do
- before(:each) do
- @autotest = Autotest::RadiantRailsRspec.new
- @autotest.hook :initialize
- end
-
- it "should map model example to model" do
- @autotest.should map_specs(['spec/models/thing_spec.rb']).
- to('app/models/thing.rb')
- end
-
- it "should map controller example to controller" do
- @autotest.should map_specs(['spec/controllers/things_controller_spec.rb']).
- to('app/controllers/things_controller.rb')
- end
-
- it "should map view.rhtml" do
- @autotest.should map_specs(['spec/views/things/index.rhtml_spec.rb']).
- to('app/views/things/index.rhtml')
- end
-
- it "should map view.rhtml with underscores in example filename" do
- @autotest.should map_specs(['spec/views/things/index_rhtml_spec.rb']).
- to('app/views/things/index.rhtml')
- end
-
- it "should map view.html.erb" do
- @autotest.should map_specs(['spec/views/things/index.html.erb_spec.rb']).
- to('app/views/things/index.html.erb')
- end
-
- describe "with extensions" do
- it "should map model example to model" do
- @autotest.should map_specs(["#{ext_path}spec/models/thing_spec.rb"]).
- to("#{ext_path}app/models/thing.rb")
- end
-
- it "should map controller example to controller" do
- @autotest.should map_specs(["#{ext_path}spec/controllers/things_controller_spec.rb"]).
- to("#{ext_path}app/controllers/things_controller.rb")
- end
-
- it "should map nested controller example to nested controller" do
- @autotest.should map_specs(["#{ext_path}spec/controllers/nest/things_controller_spec.rb"]).
- to("#{ext_path}app/controllers/nest/things_controller.rb")
- end
-
- it "should map view example to view" do
- @autotest.should map_specs(["#{ext_path}spec/views/things/index.html.erb_spec.rb"]).
- to("#{ext_path}app/views/things/index.html.erb")
- end
-
- it "should map nested view example to nested view" do
- @autotest.should map_specs(["#{ext_path}spec/views/nest/things/index.html.erb_spec.rb"]).
- to("#{ext_path}app/views/nest/things/index.html.erb")
- end
-
- it "should map helper example to helper" do
- @autotest.should map_specs(["#{ext_path}spec/helpers/thing_helper_spec.rb"]).
- to("#{ext_path}app/helpers/thing_helper.rb")
- end
-
- it "should map nested helper example to nested helper" do
- @autotest.should map_specs(["#{ext_path}spec/helpers/nest/thing_helper_spec.rb"]).
- to("#{ext_path}app/helpers/nest/thing_helper.rb")
- end
-
- it "should map lib example to lib" do
- @autotest.should map_specs(["#{ext_path}spec/lib/thing_spec.rb"]).
- to("#{ext_path}lib/thing.rb")
- end
- end
-
- def ext_path
- 'vendor/extensions/extension/'
- end
-end
Please sign in to comment.
Something went wrong with that request. Please try again.