— |
#!/usr/bin/perl
plan( tests => 6 );
my $code = <<'END_RUBY';
=begin
def bogus(a, b):
=end
def initialize:
return
def subtract(a, b):
return a - b
def add(a, b):
return a + b
def _private:
return
END_RUBY
SCOPE: {
my $lf = new_ok(
'Parse::Functions::Ruby' ,
);
is_deeply(
[ $lf ->find( $code ) ],
[ qw{
initialize
subtract
add
_private
}
],
'Found expected functions' ,
);
}
SCOPE: {
my $lf = new_ok(
'Parse::Functions::Ruby' ,
);
is_deeply(
[ $lf ->find( $code , 'alphabetical' ) ],
[ qw{
add
initialize
_private
subtract
}
],
'Found expected functions (alphabetical)' ,
);
}
SCOPE: {
my $lf = new_ok(
'Parse::Functions::Ruby' ,
);
is_deeply(
[ $lf ->find( $code , 'alphabetical_private_last' ) ],
[ qw{
add
initialize
subtract
_private
}
],
'Found expected functions (alphabetical_private_last)' ,
);
}
|