Skip to content

Commit

Permalink
Merge pull request #38 from maxmeyer/feature/rspec
Browse files Browse the repository at this point in the history
Add Test Tool and QA Tools
  • Loading branch information
Jason Long committed Jan 8, 2015
2 parents 8db55ee + 12027f4 commit 4fafec1
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
1 change: 1 addition & 0 deletions lib/geo_pattern.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
require 'geo_pattern/version'
require 'geo_pattern/svg'
require 'geo_pattern/pattern_helpers'
require 'geo_pattern/helpers'

require 'geo_pattern/pattern/base_pattern'
require 'geo_pattern/pattern/chevron_pattern'
Expand Down
7 changes: 7 additions & 0 deletions lib/geo_pattern/helpers.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module GeoPattern
module Helpers
def require_files_matching_pattern(pattern)
Dir.glob(pattern).each { |f| require_relative f }
end
end
end
8 changes: 6 additions & 2 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,13 @@

require 'geo_pattern'

# Make some helpers available
include GeoPattern::Helpers

# Loading support files
Dir.glob(::File.expand_path('../support/*.rb', __FILE__)).each { |f| require_relative f }
Dir.glob(::File.expand_path('../shared_examples/*.rb', __FILE__)).each { |f| require_relative f }
#::File.expand_path('../support/*.rb', __FILE__)
require_files_matching_pattern ::File.expand_path('../support/*.rb', __FILE__)
require_files_matching_pattern ::File.expand_path('../shared_examples/*.rb', __FILE__)

# No need to add the namespace to every class tested
include GeoPattern

0 comments on commit 4fafec1

Please sign in to comment.