Sha256: 06869e83383ca753b904bf290239dd72d1ad8550d043f89a543d10da75f202fe

Contents?: true

Size: 679 Bytes

Versions: 2

Compression:

Stored size: 679 Bytes

Contents

require 'soundcheck/logging'
require 'soundcheck/project'

class Soundcheck
  attr_accessor :project
  attr_accessor :path
  attr_accessor :options

  def initialize(path = "spec", options = {})
    self.project = Project.new(Dir.pwd)
    self.path = path
    self.options = options
  end

  def command_to_run
    commands = []
    project.frameworks.each do |framework|
      framework.options = options
      command = framework.command(*path)
      commands << command if command
    end
    commands.first
  end

  def requires_spec_helper?
    `grep -r 'spec_helper' #{@path}`
    $?.exitstatus == 0 # matched
  end

  def has_gemfile?
    File.exist?("Gemfile")
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
soundcheck-0.2.1 lib/soundcheck.rb
soundcheck-0.2.0 lib/soundcheck.rb