Sha256: b060e391cbb3e454b881626fb725398e0de9dceba655db029822417971933401

Contents?: true

Size: 743 Bytes

Versions: 16

Compression:

Stored size: 743 Bytes

Contents

require 'test/unit'

module RSpec::Generator
  class TestCase < ::Rails::Generators::TestCase   
    setup :prepare_destination
          
    def initialize(test_method_name)
      @method_name = test_method_name
      @test_passed = true
      @interrupted = false
      routes_file = File.join(File.dirname(__FILE__), 'routes.rb')        
      copy_routes routes_file
    end 
    
    def copy_routes routes_file        
      routes = File.expand_path(routes_file)
      raise ArgumentError, "No routes file exists at #{routes_file}" if !File.exist?(routes)
      destination = File.join(::Rails.root, "config")
      FileUtils.mkdir_p(destination) # create dir
      FileUtils.cp routes, destination # copy
    end
         
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
generator-spec-0.7.8 lib/generator-spec/rspec/generator/test_case.rb
generator-spec-0.7.6 lib/generator-spec/rspec/generator/test_case.rb
generator-spec-0.7.5 lib/generator-spec/rspec/generator/test_case.rb
generator-spec-0.7.4 lib/generator-spec/rspec/generator/test_case.rb
generator-spec-0.7.2 lib/generator-spec/rspec/generator/test_case.rb
generator-spec-0.7.1 lib/generator-spec/rspec/generator/test_case.rb
generator-spec-0.7.0 lib/generator-spec/rspec/generator/test_case.rb
generator-spec-0.6.6 lib/generator-spec/rspec/generator/test_case.rb
generator-spec-0.6.5 lib/generator-spec/rspec/generator/test_case.rb
generator-spec-0.6.4 lib/generator-spec/rspec/generator/test_case.rb
generator-spec-0.6.3 lib/generator-spec/rspec/generator/test_case.rb
generator-spec-0.5.0 lib/generator_spec/rspec_generator/test_case.rb
generator-spec-0.4.8 lib/generator_spec/rspec_generator/test_case.rb
generator-spec-0.4.7 lib/generator_spec/rspec_generator/test_case.rb
generator-spec-0.4.5 lib/generator_spec/rspec_generator/test_case.rb
generator-spec-0.4.4 lib/generator_spec/rspec_generator/test_case.rb