Skip to content
Browse files

Fix the winxed version of the xunit loader so it works with P6protoob…

…ject correctly.
  • Loading branch information...
1 parent 288bddf commit 79d24daec2b7ed8be2e4379226105efbda92dec4 @Whiteknight committed
Showing with 12 additions and 11 deletions.
  1. +4 −4 src/core/Rosella.winxed
  2. +8 −7 src/xunit/Loader.nqp
View
8 src/core/Rosella.winxed
@@ -54,12 +54,12 @@ namespace Rosella
function get_type_class(var type)
{
- if (type instanceof "Class")
- return type;
if (type instanceof "P6metaclass")
- return type.get_parrotclass();
+ return type.get_parrotclass(type);
if (type instanceof "P6protoobject")
- return type.HOW().get_parrotclass();
+ return type.HOW().get_parrotclass(type);
+ if (type instanceof "Class")
+ return type;
if (type instanceof "String")
type = split("::", type);
View
15 src/xunit/Loader.nqp
@@ -1,13 +1,14 @@
-# Copyright (C) 2010, Austin Hastings. See accompanying LICENSE file, or
-# http://www.opensource.org/licenses/artistic-license-2.0.php for license.
-
class Rosella::Loader {
has $!class;
has %!seen_methods;
has $!test_prefix;
- method BUILD() {
- $!test_prefix := "test_";
+ method BUILD(:$prefix?) {
+ if pir::defined($prefix) {
+ $!test_prefix := $prefix;
+ } else {
+ $!test_prefix := "test_";
+ }
}
sub compare_methods($a, $b) {
@@ -92,8 +93,8 @@ class Rosella::Loader {
$result;
}
- our method load_tests_from_testcase($class, *%named) {
- $!class := P6metaclass.get_parrotclass($class);
+ our method load_tests_from_testcase($type, *%named) {
+ $!class := Rosella::get_type_class($type);
my @tests := self.get_test_methods;
self.configure_suite(@tests, |%named);

0 comments on commit 79d24da

Please sign in to comment.
Something went wrong with that request. Please try again.