Sha256: 2a8469d2f63a971899a780af43320328163acf6bf718aa6964514ebf1f9b835b

Contents?: true

Size: 834 Bytes

Versions: 4

Compression:

Stored size: 834 Bytes

Contents

module RailsEdgeTest
  module Runner
    module_function
    def go!(args = [])
      unless Rails.env.test?
        puts "Failure! Unable to set Rails environment to test."
        exit
      end

      RailsEdgeTest::Dsl.reset!

      glob_path = '**/*_edge.rb'

      if args.length > 0
        glob_path = args.shift
      end

      glob = File.join(
        RailsEdgeTest.configuration.edge_root_path,
        glob_path
      )

      Dir.glob(glob).each do |file|
        load file
      end

      RailsEdgeTest::Dsl.execute!
    end

    def load_rails_environment!(rails_root)
      ENV["RAILS_ENV"]="test"
      rails_app_path = File.join(rails_root, "config/application")
      require rails_app_path

      Rails.application.require_environment!

      require "rake"
      Rails.application.load_tasks
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rails_edge_test-0.6.0 lib/rails_edge_test/runner.rb
rails_edge_test-0.5.0 lib/rails_edge_test/runner.rb
rails_edge_test-0.4.0 lib/rails_edge_test/runner.rb
rails_edge_test-0.3.0 lib/rails_edge_test/runner.rb