Sha256: 3966077e020921db7a21854f17e55291920cef9c4d9986a3364515b3d3d48641

Contents?: true

Size: 1.07 KB

Versions: 10

Compression:

Stored size: 1.07 KB

Contents

require "spec_helper"
require "autotest/rails_rspec2"

describe Autotest::RailsRspec2 do

  let(:rails_rspec2_autotest) { Autotest::RailsRspec2.new }

  describe 'exceptions' do
    let(:exceptions_regexp) { rails_rspec2_autotest.exceptions }

    it "should match './log/test.log'" do
      exceptions_regexp.should match('./log/test.log')
    end

    it "should match 'log/test.log'" do
      exceptions_regexp.should match('log/test.log')
    end

    it "should not match './spec/models/user_spec.rb'" do
      exceptions_regexp.should_not match('./spec/models/user_spec.rb')
    end

    it "should not match 'spec/models/user_spec.rb'" do
      exceptions_regexp.should_not match('spec/models/user_spec.rb')
    end
  end

  describe 'mappings' do
    before do
      rails_rspec2_autotest.find_order = %w(
        spec/models/user_spec.rb
        spec/support/blueprints.rb
      )
    end

    it 'runs model specs when support files change' do
      rails_rspec2_autotest.test_files_for('spec/support/blueprints.rb').should(
        include('spec/models/user_spec.rb'))
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
rspec-rails-2.5.0 spec/autotest/rails_rspec2_spec.rb
rspec-rails-2.4.1 spec/autotest/rails_rspec2_spec.rb
rspec-rails-2.4.0 spec/autotest/rails_rspec2_spec.rb
rspec-rails-2.3.1 spec/autotest/rails_rspec2_spec.rb
rspec-rails-2.3.0 spec/autotest/rails_rspec2_spec.rb
rspec-rails-2.2.1 spec/autotest/rails_rspec2_spec.rb
rspec-rails-2.2.0 spec/autotest/rails_rspec2_spec.rb
rspec-rails-2.1.0 spec/autotest/rails_rspec2_spec.rb
rspec-rails-2.0.1 spec/autotest/rails_rspec2_spec.rb
rspec-rails-2.0.0 spec/autotest/rails_rspec2_spec.rb