4 def initialize(example_group_description, example_name)
5 @example_group_description = example_group_description
6 @example_name = example_name
9 def matches?(specified_examples)
10 specified_examples.each do |specified_example|
11 return true if matches_literal_example?(specified_example) || matches_example_not_considering_modules?(specified_example)
17 def matches_literal_example?(specified_example)
18 specified_example =~ /(^#{example_group_regex} #{example_regexp}$|^#{example_group_regex}$|^#{example_group_with_before_all_regexp}$|^#{example_regexp}$)/
21 def matches_example_not_considering_modules?(specified_example)
22 specified_example =~ /(^#{example_group_regex_not_considering_modules} #{example_regexp}$|^#{example_group_regex_not_considering_modules}$|^#{example_regexp}$)/
25 def example_group_regex
26 Regexp.escape(@example_group_description)
29 def example_group_with_before_all_regexp
30 Regexp.escape("#{@example_group_description} before(:all)")
33 def example_group_regex_not_considering_modules
34 Regexp.escape(@example_group_description.split('::').last)
38 Regexp.escape(@example_name)