File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -136,7 +136,9 @@ def duplicate_with(metadata_overrides={})
136
136
new_metadata . delete reserved_key
137
137
end
138
138
139
- Example . new ( example_group . clone , description . clone ,
139
+ # don't clone the example group because the new example
140
+ # must belong to the same example group (not a clone).
141
+ Example . new ( example_group , description . clone ,
140
142
new_metadata , new_metadata [ :block ] )
141
143
end
142
144
Original file line number Diff line number Diff line change @@ -52,6 +52,9 @@ def metadata_hash(*args)
52
52
53
53
# cloned examples must have unique ids
54
54
expect ( example . id ) . to_not eq ( example2 . id )
55
+
56
+ # cloned examples must both refer to the same example group (not a clone)
57
+ expect ( example . example_group . object_id ) . to eq ( example2 . example_group . object_id )
55
58
end
56
59
end
57
60
You can’t perform that action at this time.
0 commit comments