Sha256: aa2075d351e06b45fc091b5f47272da53b3e79a99e72279bffcc0dd90981bba5

Contents?: true

Size: 820 Bytes

Versions: 24

Compression:

Stored size: 820 Bytes

Contents

module HorsePower
	class TestsGenerator < Rails::Generators::Base
	  source_root File.expand_path('../templates', __FILE__)
		argument :resource_name, :type => :string
	  argument :api_version, :type => :string, :default => "1"
	  argument :attributes, type: :array, default: [], banner: "field:type field:type"

	  def sprint
  		template "model.rb.erb", "spec/api/v#{api_version}/models/#{HorsePower.get_singular(resource_name)}_spec.rb"
  		template "routing.rb.erb", "spec/api/v#{api_version}/routing/#{HorsePower.get_singular(resource_name)}_spec.rb"
  		template "factory.rb.erb", "spec/factories/#{HorsePower.get_singular(resource_name)}_#{api_version}_factory.rb"
			template "request.rb.erb", "spec/api/v#{api_version}/requests/#{HorsePower.get_singular(resource_name)}_spec.rb"
	  end

	  private
	  
	end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
horse_power-1.0.0 lib/generators/horse_power/tests/tests_generator.rb
horse_power-0.9.0 lib/generators/horse_power/tests/tests_generator.rb
horse_power-0.8.5 lib/generators/horse_power/tests/tests_generator.rb
horse_power-0.8.3 lib/generators/horse_power/tests/tests_generator.rb
horse_power-0.8.2 lib/generators/horse_power/tests/tests_generator.rb
horse_power-0.8.1 lib/generators/horse_power/tests/tests_generator.rb
horse_power-0.8.0 lib/generators/horse_power/tests/tests_generator.rb
horse_power-0.7.1 lib/generators/horse_power/tests/tests_generator.rb
horse_power-0.7.0 lib/generators/horse_power/tests/tests_generator.rb
horse_power-0.6.5 lib/generators/horse_power/tests/tests_generator.rb
horse_power-0.6.0 lib/generators/horse_power/tests/tests_generator.rb
horse_power-0.5.0 lib/generators/horse_power/tests/tests_generator.rb
horse_power-0.4.1 lib/generators/horse_power/tests/tests_generator.rb
horse_power-0.4.0 lib/generators/horse_power/tests/tests_generator.rb
horse_power-0.3.3 lib/generators/horse_power/tests/tests_generator.rb
horse_power-0.3.2 lib/generators/horse_power/tests/tests_generator.rb
horse_power-0.2.1 lib/generators/horse_power/tests/tests_generator.rb
horse_power-0.2.0 lib/generators/horse_power/tests/tests_generator.rb
horse_power-0.1.6 lib/generators/horse_power/tests/tests_generator.rb
horse_power-0.1.5 lib/generators/horse_power/tests/tests_generator.rb