Sha256: 695087349edf445fc99fbc7c912011579a8a017f20d59717fd0ae3ccbc415d58
Contents?: true
Size: 786 Bytes
Versions: 4
Compression:
Stored size: 786 Bytes
Contents
require 'turnip' module TableBeet class World # # @return [Hash] The hash that { scope name => Array of ::TableBeet:Step } # def self.scopes scopes = Hash.new {|hash, key| hash[key] = []} RSpec.configuration.include_or_extend_modules.each do |_, mod, tags| space = Space.new(mod) step_names = space.define_steps next if step_names.empty? scope_name = tags.keys.first step_names.each do |name| scopes[scope_name] << Step.new(space.method(name)) end end scopes end private class Space def initialize(mod) extend(mod) end def define_steps methods.grep(/^match: (?<name>.+)/) { $~[:name] } end end end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
table_beet-0.0.4 | lib/table_beet/world.rb |
table_beet-0.0.3 | lib/table_beet/world.rb |
table_beet-0.0.2 | lib/table_beet/world.rb |
table_beet-0.0.1 | lib/table_beet/world.rb |