Sha256: 2d59700464ff77f606c6b474583061f0dec4271dea28fa9ddee68acc1cade25d
Contents?: true
Size: 1.6 KB
Versions: 2
Compression:
Stored size: 1.6 KB
Contents
require "engine_cart/version" module EngineCart require "engine_cart/engine" if defined? Rails class << self ## # Name of the engine we're testing attr_accessor :engine_name ## # Destination to generate the test app into attr_accessor :destination ## # Path to a Rails application template attr_accessor :template ## # Path to test app templates to make available to # the test app generator attr_accessor :templates_path ## # Additional options when generating a test rails application attr_accessor :rails_options end self.engine_name = ENV["CURRENT_ENGINE_NAME"] self.destination = ENV['ENGINE_CART_DESTINATION'] || ENV['RAILS_ROOT'] || "./spec/internal" self.template = ENV["ENGINE_CART_TEMPLATE"] self.templates_path = ENV['ENGINE_CART_TEMPLATES_PATH'] || "./spec/test_app_templates" self.rails_options = ENV['ENGINE_CART_RAILS_OPTIONS'] def self.current_engine_name engine_name || File.basename(Dir.glob("*.gemspec").first, '.gemspec') end def self.load_application! path = nil require File.expand_path("config/environment", path || EngineCart.destination) end def self.within_test_app Dir.chdir(EngineCart.destination) do Bundler.with_clean_env do yield end end end def self.fingerprint @fingerprint || (@fingerprint_proc || method(:default_fingerprint)).call end def self.fingerprint= fingerprint @fingerprint = fingerprint end def self.fingerprint_proc= fingerprint_proc @fingerprint_proc = fingerprint_proc end def self.default_fingerprint "" end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
engine_cart-0.5.1 | lib/engine_cart.rb |
engine_cart-0.5.0 | lib/engine_cart.rb |