Sha256: 5a1dce7d675682e7623e8d9d2ec52098f079891e81d662f2f80c9478d07f056c

Contents?: true

Size: 1.06 KB

Versions: 53

Compression:

Stored size: 1.06 KB

Contents

require 'rubygems'
require "minitest/autorun"
require "autotest/rails"

class RailsTest < MiniTest::Unit::TestCase
  describe Autotest::Rails do
    before do
      @at = Autotest::Rails.new
    end
    
    describe "#path_to_classname" do
      it "should ignore default namespaces" do
        assert_equal "PostControllerTest", @at.path_to_classname("test/controllers/post_controller_test.rb")
        assert_equal "PostCellTest", @at.path_to_classname("test/cells/post_cell_test.rb")
      end

      it "should convert non-default namespaces" do
        assert_equal "Foo::PostControllerTest", @at.path_to_classname("test/foo/post_controller_test.rb")
      end

      it "should convert normal namespaces inside ignored namespaces" do
        assert_equal "Blogging::PostControllerTest", @at.path_to_classname("test/controllers/blogging/post_controller_test.rb")
      end

      it "does not remove _test namespces" do
        assert_equal "BloggingTest::PostControllerTest", @at.path_to_classname("test/controllers/blogging_test/post_controller_test.rb")
      end
    end
  end
end

Version data entries

53 entries across 53 versions & 5 rubygems

Version Path
cloudsmith-api-2.0.16 vendor/bundle/ruby/2.6.0/gems/autotest-rails-pure-4.1.2/test/rails_test.rb
cloudsmith-api-2.0.15 vendor/bundle/ruby/2.6.0/gems/autotest-rails-pure-4.1.2/test/rails_test.rb
cloudsmith-api-2.0.14 vendor/bundle/ruby/2.6.0/gems/autotest-rails-pure-4.1.2/test/rails_test.rb
cloudsmith-api-2.0.13 vendor/bundle/ruby/2.6.0/gems/autotest-rails-pure-4.1.2/test/rails_test.rb
cloudsmith-api-2.0.12 vendor/bundle/ruby/2.6.0/gems/autotest-rails-pure-4.1.2/test/rails_test.rb
cloudsmith-api-2.0.11 vendor/bundle/ruby/2.6.0/gems/autotest-rails-pure-4.1.2/test/rails_test.rb
cloudsmith-api-2.0.10 vendor/bundle/ruby/2.6.0/gems/autotest-rails-pure-4.1.2/test/rails_test.rb
cloudsmith-api-2.0.9 vendor/bundle/ruby/2.6.0/gems/autotest-rails-pure-4.1.2/test/rails_test.rb
cloudsmith-api-2.0.8 vendor/bundle/ruby/2.6.0/gems/autotest-rails-pure-4.1.2/test/rails_test.rb
cloudsmith-api-2.0.7 vendor/bundle/ruby/2.6.0/gems/autotest-rails-pure-4.1.2/test/rails_test.rb
cloudsmith-api-2.0.6 vendor/bundle/ruby/2.6.0/gems/autotest-rails-pure-4.1.2/test/rails_test.rb
cloudsmith-api-2.0.5 vendor/bundle/ruby/2.6.0/gems/autotest-rails-pure-4.1.2/test/rails_test.rb
cloudsmith-api-2.0.4 vendor/bundle/ruby/2.6.0/gems/autotest-rails-pure-4.1.2/test/rails_test.rb
cloudsmith-api-2.0.3 vendor/bundle/ruby/2.6.0/gems/autotest-rails-pure-4.1.2/test/rails_test.rb
cloudsmith-api-2.0.2 vendor/bundle/ruby/2.6.0/gems/autotest-rails-pure-4.1.2/test/rails_test.rb
cloudsmith-api-2.0.1 vendor/bundle/ruby/2.6.0/gems/autotest-rails-pure-4.1.2/test/rails_test.rb
cloudsmith-api-2.0.0 vendor/bundle/ruby/2.6.0/gems/autotest-rails-pure-4.1.2/test/rails_test.rb
cloudsmith-api-1.142.3 vendor/bundle/ruby/2.6.0/gems/autotest-rails-pure-4.1.2/test/rails_test.rb
cloudsmith-api-1.120.3 vendor/bundle/ruby/2.6.0/gems/autotest-rails-pure-4.1.2/test/rails_test.rb
cloudsmith-api-1.61.3 vendor/bundle/ruby/2.6.0/gems/autotest-rails-pure-4.1.2/test/rails_test.rb