Sha256: c757c6ee3902702a48901a2cb041da9a5e268a18e55bba3aef65c41a789d20a4

Contents?: true

Size: 860 Bytes

Versions: 17

Compression:

Stored size: 860 Bytes

Contents

require 'autotest'

##
# CampingAutotest is an Autotest subclass designed for use with Camping projects.
#
# To use CampingAutotest pass the -camping flag to autotest.
#
# Contributed by Geoffrey Grosenbach http://nubyonrails.com

class Autotest::Camping < Autotest

  def initialize # :nodoc:
    super
    @exceptions = %r%\.(log|db)$%

    @test_mappings = {
      %r%^test/fixtures/([^_]+)_.*s\.yml% => proc { |_, m|
        "test/#{m[1]}_test.rb"
      },
      %r%^test/.*rb$% => proc { |filename, m|
        filename
      },
      %r%^public/([^\/]+)/(models|controllers|views)\.rb$% => proc { |_, m|
        "test/#{m[1]}_test.rb"
      },
      %r%^public/(.*)\.rb$% => proc { |_, m|
        "test/#{m[1]}_test.rb"
      },
    }

    return functional_tests
  end

  def tests_for_file(filename)
    super.select { |f| @files.has_key? f }
  end
end

Version data entries

17 entries across 17 versions & 3 rubygems

Version Path
grosser-autotest-4.0.3 lib/autotest/camping.rb
grosser-autotest-4.0.4 lib/autotest/camping.rb
ryanbriones-ZenTest-3.11.1 lib/autotest/camping.rb
ZenTest-3.6.0 lib/autotest/camping.rb
ZenTest-3.6.1 lib/autotest/camping.rb
ZenTest-3.7.0 lib/autotest/camping.rb
ZenTest-3.7.1 lib/autotest/camping.rb
ZenTest-3.7.2 lib/autotest/camping.rb
ZenTest-3.8.0 lib/autotest/camping.rb
ZenTest-3.9.0 lib/autotest/camping.rb
ZenTest-3.9.1 lib/autotest/camping.rb
ZenTest-3.9.2 lib/autotest/camping.rb
ZenTest-3.9.3 lib/autotest/camping.rb
ZenTest-3.10.0 lib/autotest/camping.rb
ZenTest-3.11.0 lib/autotest/camping.rb
ZenTest-3.11.1 lib/autotest/camping.rb
ZenTest-4.0.0 lib/autotest/camping.rb