Class: Autotest::RailsRspec2

### Home Classes Methods

### In Files

- lib/autotest/rails_rspec2.rb

### Parent

Autotest::Rspec2

### Methods

- ::new
- #setup_rails_rspec2_mappings

### Files

- fixture

### Class/Module Index

Quicksearch

- RSpec
- RSpec::Rails
- RSpec::Rails::AssertionDelegator
- RSpec::Rails::ControllerExampleGroup
- RSpec::Rails::ControllerExampleGroup::BypassRescue
- RSpec::Rails::ControllerExampleGroup::ClassMethods
- RSpec::Rails::Extensions
- RSpec::Rails::Extensions::ActiveRecord
- RSpec::Rails::FeatureExampleGroup
- RSpec::Rails::FixtureSupport
- RSpec::Rails::HelperExampleGroup
- RSpec::Rails::HelperExampleGroup::ClassMethods
- RSpec::Rails::IllegalDataAccessException
- RSpec::Rails::MailerExampleGroup
- RSpec::Rails::MailerExampleGroup::ClassMethods
- RSpec::Rails::Matchers
- RSpec::Rails::Matchers::BeANew
- RSpec::Rails::Matchers::BeANewRecord
- RSpec::Rails::Matchers::BeValid
- RSpec::Rails::Matchers::HaveExtensions
- RSpec::Rails::Matchers::RedirectTo
- RSpec::Rails::Matchers::RedirectTo::RedirectTo
- RSpec::Rails::Matchers::RenderTemplate
- RSpec::Rails::Matchers::RenderTemplate::RenderTemplateMatcher
- RSpec::Rails::Matchers::RoutingMatchers
- RSpec::Rails::Matchers::RoutingMatchers::BeRoutableMatcher
- RSpec::Rails::Matchers::RoutingMatchers::RouteHelpers
- RSpec::Rails::Matchers::RoutingMatchers::RouteToMatcher
- RSpec::Rails::MiniTestLifecycleAdapter
- RSpec::Rails::MinitestCounters
- RSpec::Rails::Mocks
- RSpec::Rails::Mocks::ActiveModelInstanceMethods
- RSpec::Rails::Mocks::ActiveModelStubExtensions
- RSpec::Rails::Mocks::ActiveRecordInstanceMethods
- RSpec::Rails::Mocks::ActiveRecordStubExtensions
- RSpec::Rails::ModelExampleGroup
- RSpec::Rails::ModuleInclusion
- RSpec::Rails::RailsExampleGroup
- RSpec::Rails::Railtie
- RSpec::Rails::RequestExampleGroup
- RSpec::Rails::RoutingExampleGroup
- RSpec::Rails::RoutingExampleGroup::ClassMethods
- RSpec::Rails::SetupAndTeardownAdapter
- RSpec::Rails::SetupAndTeardownAdapter::ClassMethods
- RSpec::Rails::TestUnitAssertionAdapter
- RSpec::Rails::TestUnitAssertionAdapter::AssertionDelegator
- RSpec::Rails::TestUnitAssertionAdapter::ClassMethods
- RSpec::Rails::Version
- RSpec::Rails::ViewAssigns
- RSpec::Rails::ViewExampleGroup
- RSpec::Rails::ViewExampleGroup::ClassMethods
- RSpec::Rails::ViewExampleGroup::ExampleMethods
- RSpec::Rails::ViewRendering
- RSpec::Rails::ViewRendering::ClassMethods
- RSpec::Rails::ViewRendering::EmptyTemplateHandler
- RSpec::Rails::ViewRendering::EmptyTemplatePathSetDecorator
- RSpec::Rails::ViewRendering::EmptyTemplates
- Rspec
- Rspec::Generators
- Rspec::Generators::Base
- Rspec::Generators::ControllerGenerator
- Rspec::Generators::HelperGenerator
- Rspec::Generators::InstallGenerator
- Rspec::Generators::IntegrationGenerator
- Rspec::Generators::MailerGenerator
- Rspec::Generators::ModelGenerator
- Rspec::Generators::ObserverGenerator
- Rspec::Generators::ScaffoldGenerator
- Rspec::Generators::ViewGenerator
- Rails
- Rails::Generators
- Rails::Generators::GeneratedAttribute
- Test
- Test::Unit
- Test::Unit::AssertionFailedError
- ActiveModel
- ActiveModel::Validations
- ActiveRecord
- ActiveRecord::Base
- Autotest
- Autotest::RailsRspec2
- Object
- RequestInstanceMethods

No matching classes.

# Autotest::RailsRspec2

### Public Class Methods

new() click to toggle source

    # File lib/autotest/rails_rspec2.rb, line 30
    def initialize
      super
      setup_rails_rspec2_mappings
    end

### Public Instance Methods

setup_rails_rspec2_mappings() click to toggle source

    # File lib/autotest/rails_rspec2.rb, line 35
    def setup_rails_rspec2_mappings
      %{coverage/ db/ doc/ log/ public/ script/ tmp/ vendor/rails vendor/plugins vendor/gems}.each do |exception|
        add_exception(/^([\.\/]*)?#{exception}/)
      end

      clear_mappings

      add_mapping(%^(test|spec)/fixtures/(.*).yml$%) { |_, m|
        ["spec/models/#{m[2].singularize}_spec.rb"] + files_matching(%^spec\/views\/#{m[2]}/.*_spec\.rb$%)
      }
      add_mapping(%^spec/.*_spec\.rb$%) { |filename, _|
        filename
      }
      add_mapping(%^app/models/(.*)\.rb$%) { |_, m|
        ["spec/models/#{m[1]}_spec.rb"]
      }
      add_mapping(%^app/views/(.*)$%) { |_, m|
        files_matching %^spec/views/#{m[1]}_spec.rb$%
      }
      add_mapping(%^app/controllers/(.*)\.rb$%) { |_, m|
        if m[1] == "application"
          files_matching %^spec/controllers/.*_spec\.rb$%
        else
          ["spec/controllers/#{m[1]}_spec.rb"]
        end
      }
      add_mapping(%^app/helpers/(.*)_helper\.rb$%) { |_, m|
        if m[1] == "application" then
          files_matching(%^spec/(views|helpers)/.*_spec\.rb$%)
        else
          ["spec/helpers/#{m[1]}_helper_spec.rb"] + files_matching(%^spec\/views\/#{m[1]}/.*_spec\.rb$%)
        end
      }
      add_mapping(%^config/routes\.rb$%) {
        files_matching %^spec/(controllers|routing|views|helpers)/.*_spec\.rb$%
      }
      add_mapping(%^config/database\.yml$%) { |_, m|
        files_matching %^spec/models/.*_spec\.rb$%
      }
      add_mapping(%^(spec/(spec_helper|support/.*)|config/(boot|environment(s/test)?))\.rb$%) {
        files_matching %^spec/(models|controllers|routing|views|helpers)/.*_spec\.rb$%
      }
      add_mapping(%^lib/(.*)\.rb$%) { |_, m|
        ["spec/lib/#{m[1]}_spec.rb"]
      }
      add_mapping(%^app/mailers/(.*)\.rb$%) { |_, m|
        ["spec/mailers/#{m[1]}_spec.rb"]
      }
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.