Class: ObjectiveSpec::Matchers

Inherits:
Object
  • Object
show all
Defined in:
lib/objective_spec/matchers.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.load!Object



20
21
22
# File 'lib/objective_spec/matchers.rb', line 20

def self.load!
  self.new.load!
end

Instance Method Details

#bundled_matchers_dirObject



16
17
18
# File 'lib/objective_spec/matchers.rb', line 16

def bundled_matchers_dir
  File.join(File.dirname(__FILE__), 'matchers')
end

#load!Object



3
4
5
# File 'lib/objective_spec/matchers.rb', line 3

def load!
  load_matchers_in_dir(bundled_matchers_dir)
end

#load_matchers_in_dir(dir) ⇒ Object



7
8
9
10
11
12
13
14
# File 'lib/objective_spec/matchers.rb', line 7

def load_matchers_in_dir(dir)
  Dir.entries(dir).each do |entry|
    if entry =~ /_matcher.rb$/
      filename = entry.gsub(/.rb$/, '')
      require File.join(dir, filename)
    end
  end
end