Class: Frameworks::Expresso

Inherits:
Object
  • Object
show all
Includes:
Base
Defined in:
lib/soundcheck/frameworks/expresso.rb

Instance Method Summary collapse

Methods included from Base

#filter_with, #to_s

Instance Method Details

#command(*args) ⇒ Object



19
20
21
22
23
24
25
26
27
# File 'lib/soundcheck/frameworks/expresso.rb', line 19

def command(*args)
  args = (args.empty? ? default_args : filter(*args))
  return nil if args.empty?

  local_expresso = "node_modules/expresso/bin/expresso"
  expresso_bin = project.has_file?(local_expresso) ? local_expresso : "expresso"

  "#{expresso_bin} --include lib #{args.join(" ")}"
end

#default_argsObject



15
16
17
# File 'lib/soundcheck/frameworks/expresso.rb', line 15

def default_args
  ["test/*"]
end

#filter(*args) ⇒ Object



9
10
11
12
13
# File 'lib/soundcheck/frameworks/expresso.rb', line 9

def filter(*args)
  filter_with(args, {
    :is_js_file => /\.js$/
  })
end

#present?Boolean

Returns:

  • (Boolean)


5
6
7
# File 'lib/soundcheck/frameworks/expresso.rb', line 5

def present?
  project.has_file?("test/*.js")
end