Class: ObjectiveSpec::Matchers
- Inherits:
-
Object
- Object
- ObjectiveSpec::Matchers
- Defined in:
- lib/objective_spec/matchers.rb
Class Method Summary collapse
Instance Method Summary collapse
- #bundled_matchers_dir ⇒ Object
- #load! ⇒ Object
- #load_matchers_in_dir(dir) ⇒ Object
- #project_matchers_dir ⇒ Object
Class Method Details
.load! ⇒ Object
25 26 27 |
# File 'lib/objective_spec/matchers.rb', line 25 def self.load! self.new.load! end |
Instance Method Details
#bundled_matchers_dir ⇒ Object
17 18 19 |
# File 'lib/objective_spec/matchers.rb', line 17 def bundled_matchers_dir File.join(File.dirname(__FILE__), 'matchers') end |
#load! ⇒ Object
3 4 5 6 |
# File 'lib/objective_spec/matchers.rb', line 3 def load! load_matchers_in_dir(bundled_matchers_dir) load_matchers_in_dir(project_matchers_dir) end |
#load_matchers_in_dir(dir) ⇒ Object
8 9 10 11 12 13 14 15 |
# File 'lib/objective_spec/matchers.rb', line 8 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 |
#project_matchers_dir ⇒ Object
21 22 23 |
# File 'lib/objective_spec/matchers.rb', line 21 def project_matchers_dir File.join(Rails.root, 'spec', 'matchers') end |