class Aruba::Initializers::RSpecInitializer
@private
Add aruba + rspec to project
def self.match?(framework)
def self.match?(framework) framework.downcase.to_sym == :rspec end
def create_helper
def create_helper file = "spec/spec_helper.rb" creator = if File.exist? file :append_to_file else :create_file end send creator, file, <<~EOS $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__) ::Dir.glob(::File.expand_path('../support/*.rb', __FILE__)).each { |f| require_relative f } ::Dir.glob(::File.expand_path('../support/**/*.rb', __FILE__)).each { |f| require_relative f } EOS end
def create_support_file
def create_support_file create_file "spec/support/aruba.rb", <<~EOS require 'aruba/rspec' EOS end