Sha256: 910dcb0cc661f90b2bc83245790ec16632c98842c7bc019c62d50ee9b3564824

Contents?: true

Size: 1.11 KB

Versions: 16

Compression:

Stored size: 1.11 KB

Contents

require File.expand_path('../rspec', __FILE__)
require File.expand_path('../rails', __FILE__)
require File.expand_path('../../test_file/rails_rspec', __FILE__)
require File.expand_path('../../test_helper/rails_rspec', __FILE__)

module Project
  module RailsRSpec
    include RSpec
    include Rails

    def setup
      super
      test_file_generator.mixin TestFile::RailsRSpec
      test_helper_generator.mixin TestHelper::RailsRSpec
    end

    def configure
      super
      gem_dependencies << gem_dependency(
        :name => 'rspec-rails',
        :version => rspec_gem_version,
        :group => [:development, :test]
      )
      add_to_test_requires(rspec_rails_path)
    end

    def generate_skeleton
      super
      run_command_within!(generate_rspec_command)
    end

    private

    def rspec_rails_path
      if rails_version == 2
        'spec/rails'
      else
        'rspec/rails'
      end
    end

    def generate_rspec_command
      if rails_version == 2
        ruby_command('script/generate rspec --skip')
      else
        ruby_command('rails generate rspec:install --skip')
      end
    end
  end
  end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
rr-3.1.1 spec/support/project/rails_rspec.rb
rr-3.1.0 spec/support/project/rails_rspec.rb
rr-3.0.9 spec/support/project/rails_rspec.rb
rr-3.0.8 spec/support/project/rails_rspec.rb
rr-3.0.7 spec/support/project/rails_rspec.rb
rr-3.0.6 spec/support/project/rails_rspec.rb
rr-3.0.5 spec/support/project/rails_rspec.rb
rr-3.0.4 spec/support/project/rails_rspec.rb
rr-3.0.3 spec/support/project/rails_rspec.rb
rr-3.0.2 spec/support/project/rails_rspec.rb
rr-3.0.1 spec/support/project/rails_rspec.rb
rr-3.0.0 spec/support/project/rails_rspec.rb
rr-1.2.1 spec/support/project/rails_rspec.rb
rr-1.2.0 spec/support/project/rails_rspec.rb
rr-1.1.2 spec/support/project/rails_rspec.rb
rr-1.1.2.rc1 spec/support/project/rails_rspec.rb