File: ruby_rspec.rb

package info (click to toggle)
ruby-rr 3.1.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,424 kB
  • sloc: ruby: 11,405; makefile: 7
file content (29 lines) | stat: -rw-r--r-- 622 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
require File.expand_path('../ruby', __FILE__)
require File.expand_path('../rspec', __FILE__)

module Project
  module RubyRSpec
    include Ruby
    include RSpec

    def configure
      super
      if rspec_version == 1
        add_file 'Rakefile', <<-EOT
          require 'spec/rake/spectask'
          Spec::Rake::SpecTask.new(:spec)
        EOT
      else
        add_file 'Rakefile', <<-EOT
          require 'rspec/core/rake_task'
          RSpec::Core::RakeTask.new(:spec)
        EOT
      end
    end

    def generate_skeleton
      super
      FileUtils.mkdir_p File.join(directory, 'spec')
    end
  end
end