Sha256: 9522fdf3226d352e1c1a0e30cd3ba72140bc7521313cea1279343befa122e861
Contents?: true
Size: 1.06 KB
Versions: 4
Compression:
Stored size: 1.06 KB
Contents
# frozen_string_literal: true require 'rutabaga' ## # # Enables turnip in the spec/features # module Turnip module RSpec module Loader def load(*a, &b) if a.first.end_with?('.feature') if legal_directories.none? { |d| a.first.end_with? d } ::RSpec.warning 'Features can only be called from turnip enable directories. These are configured ' \ "in RSpec.configuration.pattern which is currently '#{::RSpec.configuration.pattern}'" else require_if_exists 'turnip_helper' require_if_exists 'spec_helper' Turnip::RSpec.run(a.first) end else super end end private def legal_directories @legal_directories ||= ::RSpec.configuration.pattern.split(',') .select { |p| /\.feature\Z/ =~ p } .map { |d| Dir.glob(File.join(::RSpec.configuration.default_path, d)) } .flatten end end end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
rutabaga-3.1.3 | lib/rutabaga/turnip.rb |
rutabaga-3.1.2 | lib/rutabaga/turnip.rb |
rutabaga-3.1.1 | lib/rutabaga/turnip.rb |
rutabaga-3.1.0 | lib/rutabaga/turnip.rb |