rspec-bdd-style 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/rspec_bdd_style.rb +6 -6
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 42c6382ddb9cff5b6fb961fc983bc2a8d1fa904ab7d9b9840308b1c6311a238a
|
4
|
+
data.tar.gz: 463b10049198ecc9c107cc02b64ae2263af173867f06b53f88e3a84ec4548313
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7ad3d552fa918730ff1b732d5ec61fc650d7791f15a93061bbb71418a42aa8adb702c5d04bae4bbdbc86410af21fb7330905787acd4fc435b6628a362515f227
|
7
|
+
data.tar.gz: 29c0e202f61294aa853c61e4be8a5958718bc1f54ef2c79fc033abe4891b9e4d5437c6c8e8027a0f44f2b318c263d8e9cc24810153beb51f9240afa72585e0ae
|
data/lib/rspec_bdd_style.rb
CHANGED
@@ -1,20 +1,20 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module RspecBddStyle
|
4
|
-
|
4
|
+
PPREFIXES = %w[given_i when_i and_i then_i].freeze
|
5
5
|
|
6
6
|
PREFIXES.each do |prefix|
|
7
7
|
define_method("#{prefix}_method_missing") do |method_name, *args, &block|
|
8
8
|
action, action_name = parse_method_name(method_name)
|
9
9
|
|
10
|
-
if
|
10
|
+
if PREFIXES.include?(action)
|
11
11
|
if args.first.is_a?(Hash)
|
12
12
|
send(action_name, **args.first, &block)
|
13
13
|
else
|
14
14
|
send(action_name, *args, &block)
|
15
15
|
end
|
16
16
|
else
|
17
|
-
super
|
17
|
+
super(method_name, *args, &block)
|
18
18
|
end
|
19
19
|
end
|
20
20
|
end
|
@@ -26,11 +26,11 @@ module RspecBddStyle
|
|
26
26
|
return send("#{prefix}_method_missing", method_name, *args, &block) if method_name.to_s.start_with?("#{prefix}_")
|
27
27
|
end
|
28
28
|
|
29
|
-
super
|
29
|
+
super(method_name, *args, &block)
|
30
30
|
end
|
31
31
|
|
32
|
-
def respond_to_missing?(
|
33
|
-
|
32
|
+
def respond_to_missing?(method_name, include_private = false)
|
33
|
+
super(method_name, include_private)
|
34
34
|
end
|
35
35
|
|
36
36
|
def parse_method_name(method_name)
|