Sha256: 3f4ba45a26e2c3838e39b3632b6bbf51eab78b86407bf6d5cb3b0377ae4d6a86

Contents?: true

Size: 695 Bytes

Versions: 18

Compression:

Stored size: 695 Bytes

Contents

require 'active_record'

module SpecCondition
  class << self
    def postgresql?
      ENV['POSTGRESQL'] == '1'
    end

    def mysql_awesome_enabled?
      ENV['ENABLE_MYSQL_AWESOME'] == '1'
    end

    def activerecord_4?
      ActiveRecord::VERSION::MAJOR >= 4 and ActiveRecord::VERSION::MAJOR < 5
    end

    def activerecord_5?
      ActiveRecord::VERSION::MAJOR >= 5 and ActiveRecord::VERSION::MAJOR < 6
    end

    def debug?
      ENV['DEBUG'] == '1'
    end
  end

  def condition(*conds)
    conds.any? do |c|
      if c.is_a? Array
        c.all? {|i| SpecCondition.send("#{i}?") }
      else
        SpecCondition.send("#{c}?")
      end
    end
  end
end
include SpecCondition

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
ridgepole-0.6.6 spec/spec_condition.rb
ridgepole-0.6.6.beta3 spec/spec_condition.rb
ridgepole-0.6.6.beta2 spec/spec_condition.rb
ridgepole-0.6.6.beta spec/spec_condition.rb
ridgepole-0.6.5 spec/spec_condition.rb
ridgepole-0.6.5.beta14 spec/spec_condition.rb
ridgepole-0.6.5.beta13 spec/spec_condition.rb
ridgepole-0.6.5.beta12 spec/spec_condition.rb
ridgepole-0.6.5.beta11 spec/spec_condition.rb
ridgepole-0.6.5.beta10 spec/spec_condition.rb
ridgepole-0.6.5.beta9 spec/spec_condition.rb
ridgepole-0.6.5.beta8 spec/spec_condition.rb
ridgepole-0.6.5.beta7 spec/spec_condition.rb
ridgepole-0.6.5.beta6 spec/spec_condition.rb
ridgepole-0.6.5.beta5 spec/spec_condition.rb
ridgepole-0.6.5.beta4 spec/spec_condition.rb
ridgepole-0.6.5.beta3 spec/spec_condition.rb
ridgepole-0.6.5.beta2 spec/spec_condition.rb