Sha256: eee92137eb83228943fa9442fa2edf1336182bdc3751b439631c4317a6709150

Contents?: true

Size: 865 Bytes

Versions: 2

Compression:

Stored size: 865 Bytes

Contents

require "rails"

module Thincloud
  module Generators
    class TestGenerator < ::Rails::Generators::Base
      source_root File.expand_path("../templates", __FILE__)

      desc "Generates thincloud test infrastructure."
      def test
        generate "mini_test:install"

        empty_directory "test/factories"
        create_file "test/factories/.gitkeep"

        remove_file "test/minitest_helper.rb"
        copy_file "minitest_helper.rb", "test/minitest_helper.rb"

        copy_file "database_cleaner.rb", "test/support/database_cleaner.rb"
        copy_file "test.rake", "lib/tasks/test.rake"

        copy_file "Guardfile"

        create_file ".gitignore" unless File.exist?(".gitignore")
        append_file ".gitignore", "coverage"

        say_status "", ""
        say_status "success", "thincloud-test has finished."
      end

    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
thincloud-test-0.3.1 lib/generators/thincloud/test/test_generator.rb
thincloud-test-0.3.0 lib/generators/thincloud/test/test_generator.rb