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