Sha256: a00385a0fa3d218bbd1e511e7d7f56abe23297de0eaee41f69eeff1ca7af5f2f

Contents?: true

Size: 733 Bytes

Versions: 1

Compression:

Stored size: 733 Bytes

Contents

module Testable
  module_function

  VERSION = "1.0.0".freeze
  public_constant :VERSION

  # Returns version information about Testable and its core dependencies.
  def version
    """
Testable v#{Testable::VERSION}
watir: #{gem_version('watir')}
selenium-webdriver: #{gem_version('selenium-webdriver')}
    """
  end

  # Returns a gem version for a given gem, assuming the gem has
  # been loaded.
  def gem_version(name)
    Gem.loaded_specs[name].version
  rescue NoMethodError
    puts "No gem loaded for #{name}."
  end

  # Returns all of the dependencies that Testable relies on.
  def dependencies
    Gem.loaded_specs.values.map { |spec| "#{spec.name} #{spec.version}\n" }
       .uniq.sort.join(",").split(",")
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
testable-1.0.0 lib/testable/version.rb