tracks/vendor/plugins/rspec-rails/lib/autotest/rails_rspec.rb
Luke Melia 35ae5fc431 Next step in upgrading Tracks to Rails 2.2. Some highlights:
* Ran rake rails:update
* Added old actionwebservice framework
* Updated RSpec and RSpec-Rails
* Removed asset_packager plugin (not compatible, Scott no longer maintaining), and replaced with bundle_fu. See the bundle_fu README for more info.
* Hacks to UJS and ARTS plugins, which are no longer supported. Probably should move off both UJS and RJS.
* Hack to flashobject_helper plugin (upgrade to Rails 2.2-compatible version if/when it comes out.)
* Hack to skinny-spec plugin, for Rails 2.2 compatibility. Should check for official release.
* Hacks to resource_feeder plugin, for Rails 2.2 compatibility. Should check for official release (not likely) or move off it.
* Addressed some deprecation warnings. More to come.
* My mobile mime type hackery is no longer necessary with new Rails features. Yay!
* Updated environment.rb.tmpl with changes

TODO:
* Restore view specs marked pending
* Fix failing integration tests.
* Try selenium tests.
* Investigate OpenID support.
* Address deprecation warnings.
* Consider moving parts of environment.rb to initializers
* Address annoying config.gem warning about highline gem
2008-11-30 00:34:15 -05:00

76 lines
2.9 KiB
Ruby

# (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/ tmp/ 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$%)
}
at.add_mapping(%r%^spec/(models|controllers|views|helpers|lib)/.*rb$%) { |filename, _|
filename
}
at.add_mapping(%r%^app/models/(.*)\.rb$%) { |_, m|
["spec/models/#{m[1]}_spec.rb"]
}
at.add_mapping(%r%^app/views/(.*)$%) { |_, m|
at.files_matching %r%^spec/views/#{m[1]}_spec.rb$%
}
at.add_mapping(%r%^app/controllers/(.*)\.rb$%) { |_, m|
if m[1] == "application"
at.files_matching %r%^spec/controllers/.*_spec\.rb$%
else
["spec/controllers/#{m[1]}_spec.rb"]
end
}
at.add_mapping(%r%^app/helpers/(.*)_helper\.rb$%) { |_, m|
if m[1] == "application" then
at.files_matching(%r%^spec/(views|helpers)/.*_spec\.rb$%)
else
["spec/helpers/#{m[1]}_helper_spec.rb"] + at.files_matching(%r%^spec\/views\/#{m[1]}/.*_spec\.rb$%)
end
}
at.add_mapping(%r%^config/routes\.rb$%) {
at.files_matching %r%^spec/(controllers|views|helpers)/.*_spec\.rb$%
}
at.add_mapping(%r%^config/database\.yml$%) { |_, m|
at.files_matching %r%^spec/models/.*_spec\.rb$%
}
at.add_mapping(%r%^(spec/(spec_helper|shared/.*)|config/(boot|environment(s/test)?))\.rb$%) {
at.files_matching %r%^spec/(models|controllers|views|helpers)/.*_spec\.rb$%
}
at.add_mapping(%r%^lib/(.*)\.rb$%) { |_, m|
["spec/lib/#{m[1]}_spec.rb"]
}
end
class Autotest::RailsRspec < Autotest::Rspec
end