Sha256: b26d793b8b19ee7c3906666da48fe539f3c0ad461b442a3c1d608c1b285dd681
Contents?: true
Size: 1.06 KB
Versions: 3
Compression:
Stored size: 1.06 KB
Contents
require 'bundler' require 'appraisal' module Tests class CurrentBundle AppraisalNotSpecified = Class.new(ArgumentError) include Singleton def assert_appraisal! unless appraisal_in_use? message = <<MSG Please run tests starting with `appraisal <appraisal_name>`. Possible appraisals are: #{available_appraisals} MSG raise AppraisalNotSpecified, message end end def appraisal_in_use? path.dirname == root.join('gemfiles') end def current_or_latest_appraisal current_appraisal || latest_appraisal end def latest_appraisal available_appraisals.max end private def available_appraisals appraisals = [] Appraisal::AppraisalFile.each do |appraisal| appraisals << appraisal.name end appraisals end def current_appraisal if appraisal_in_use? File.basename(path, '.gemfile') end end def path Bundler.default_gemfile end def root Pathname.new('../../..').expand_path(__FILE__) end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
shoulda-4.0.0 | test/support/current_bundle.rb |
shoulda-4.0.0.rc2 | test/support/current_bundle.rb |
shoulda-4.0.0.rc1 | test/support/current_bundle.rb |