Sha256: ad4bfae1fd7307ccc4cc39e6cb30ee252eacc8261d3937e05c9ac9244da8b059

Contents?: true

Size: 817 Bytes

Versions: 14

Compression:

Stored size: 817 Bytes

Contents

class ActiveSupport::TestCase
  TEMPLATE_PATH = File.expand_path("../../app_templates", __FILE__)

  def provide_existing_application_controller
    copy_to_generator_root("app/controllers", "application_controller.rb")
  end

  def provide_existing_application_file
    copy_to_generator_root("config", "application.rb")
  end

  def provide_existing_routes_file
    copy_to_generator_root("config", "routes.rb")
  end

  def provide_existing_initializer_file
    copy_to_generator_root("config/initializers", "shopify_app.rb")
  end

  private

  def copy_to_generator_root(destination, template)
    template_file = File.join(TEMPLATE_PATH, destination, template)
    destination = File.join(destination_root, destination)

    FileUtils.mkdir_p(destination)
    FileUtils.cp(template_file, destination)
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
shopify_app-6.3.0 test/support/generator_test_helpers.rb
shopify_app-6.2.1 test/support/generator_test_helpers.rb
shopify_app-6.2.0 test/support/generator_test_helpers.rb
shopify_app-6.1.3 test/support/generator_test_helpers.rb
shopify_app-6.1.2 test/support/generator_test_helpers.rb
shopify_app-6.1.1 test/support/generator_test_helpers.rb
shopify_app-6.1.0 test/support/generator_test_helpers.rb
shopify_app-6.0.6 test/support/generator_test_helpers.rb
shopify_app-6.0.5 test/support/generator_test_helpers.rb
shopify_app-6.0.4 test/support/generator_test_helpers.rb
shopify_app-6.0.3 test/support/generator_test_helpers.rb
shopify_app-6.0.2 test/support/generator_test_helpers.rb
shopify_app-6.0.1 test/support/generator_test_helpers.rb
shopify_app-6.0.0 test/support/generator_test_helpers.rb