Skip to content

Commit 7bb1619

Browse files
committed
Implement MatchData#deconstruct
1 parent 27c4a79 commit 7bb1619

File tree

3 files changed

+1
-3
lines changed

3 files changed

+1
-3
lines changed

spec/tags/core/matchdata/deconstruct_tags.txt

Lines changed: 0 additions & 2 deletions
This file was deleted.

src/main/ruby/truffleruby/core/match_data.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ def string
6666
def captures
6767
to_a[1..-1]
6868
end
69+
alias_method :deconstruct, :captures
6970

7071
def names
7172
regexp.names

test/mri/excludes/TestRegexp.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
exclude :test_match_control_meta_escape, "<0> expected but was"
4040
exclude :test_initialize_option, "<//m> expected but was"
4141
exclude :test_initialize_bool_warning, "expected: /expected true or false as ignorecase/"
42-
exclude :test_match_data_deconstruct, "NoMethodError: undefined method `deconstruct' for #<MatchData \"foobarbaz\">"
4342
exclude :test_linear_time_p, "NoMethodError: undefined method `linear_time?' for Regexp:Class"
4443
exclude :test_match_data_deconstruct_keys, "NoMethodError: undefined method `deconstruct_keys' for #<MatchData \"foobarbaz\">"
4544
exclude :test_extended_comment_invalid_escape_bug_18294, "assert_separately failed with error message"

0 commit comments

Comments
 (0)