Sha256: c08397e342e9b2f3ab1bd2d948a22b6913f2732107af1ee87ef60274a51fd708

Contents?: true

Size: 1.25 KB

Versions: 14

Compression:

Stored size: 1.25 KB

Contents

require 'rails/generators/test_unit'

module TestUnit
  module Generators
    class OauthProviderGenerator < Base
      source_root File.expand_path('../templates', __FILE__)

      argument :name, :type => :string, :default => 'Oauth'
      class_option :fixture, :type => :boolean

      def copy_controller_test_files
        template 'clients_controller_test.rb',
                 File.join('test/functional', class_path, "#{file_name}_clients_controller_test.rb")
      end

      def copy_models_test_files
        template 'client_application_test.rb',  File.join('test/unit', 'client_application_test.rb')
        template 'oauth_token_test.rb',         File.join('test/unit', 'oauth_token_test.rb')
        template 'oauth_nonce_test.rb',         File.join('test/unit', 'oauth_nonce_test.rb')
      end

      hook_for :fixture_replacement

      def create_fixture_file
        if options[:fixtures] && options[:fixture_replacement].nil?
          template 'client_applications.yml',   File.join('test/fixtures', 'client_applications.yml')
          template 'oauth_tokens.yml',          File.join('test/fixtures', 'oauth_tokens.yml')
          template 'oauth_nonces.yml',          File.join('test/fixtures', 'oauth_nonces.yml')
        end
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 5 rubygems

Version Path
houston-oauth-plugin-0.5.1 lib/generators/test_unit/oauth_provider_generator.rb
panjiva-oauth-plugin-0.4.1 lib/generators/test_unit/oauth_provider_generator.rb
oauth-plugin-0.5.1 lib/generators/test_unit/oauth_provider_generator.rb
oauth-plugin-0.5.0 lib/generators/test_unit/oauth_provider_generator.rb
oauth-provider-0.5.0rc1 lib/generators/test_unit/oauth_provider_generator.rb
oauth-plugin-0.4.1 lib/generators/test_unit/oauth_provider_generator.rb
oauth-plugin-0.4.0 lib/generators/test_unit/oauth_provider_generator.rb
oauth-plugin-0.4.0.rc2 lib/generators/test_unit/oauth_provider_generator.rb
oauth-plugin-0.4.0.rc1 lib/generators/test_unit/oauth_provider_generator.rb
oauth-plugin-0.4.0.pre7 lib/generators/test_unit/oauth_provider_generator.rb
oauth-plugin-0.4.0.pre6 lib/generators/test_unit/oauth_provider_generator.rb
oauth-plugin-0.4.0.pre5 lib/generators/test_unit/oauth_provider_generator.rb
insrc-oauth-plugin-0.4.0.pre6 lib/generators/test_unit/oauth_provider_generator.rb
insrc-oauth-plugin-0.4.0.pre5 lib/generators/test_unit/oauth_provider_generator.rb