diff --git a/src/sage/doctest/external.py b/src/sage/doctest/external.py index bfc393b5451..8684fc046a2 100644 --- a/src/sage/doctest/external.py +++ b/src/sage/doctest/external.py @@ -295,7 +295,7 @@ def has_rubiks(): sage: from sage.doctest.external import has_rubiks sage: has_rubiks() # optional -- rubiks - FeatureTestResult('Rubiks', True) + FeatureTestResult('rubiks', True) """ from sage.features.rubiks import Rubiks return Rubiks().is_present() diff --git a/src/sage/features/rubiks.py b/src/sage/features/rubiks.py index 5364719f159..84cca71ee61 100644 --- a/src/sage/features/rubiks.py +++ b/src/sage/features/rubiks.py @@ -10,6 +10,8 @@ # https://www.gnu.org/licenses/ # **************************************************************************** from . import Feature, Executable, FeatureTestResult +from .join_feature import JoinFeature + class cu2(Executable): r""" @@ -149,7 +151,7 @@ def __init__(self): spkg="rubiks") -class Rubiks(Feature): +class Rubiks(JoinFeature): r""" A :class:`sage.features.Feature` describing the presence of ``cu2``, ``cubex``, ``dikcube``, ``mcube``, ``optimal``, and @@ -159,7 +161,7 @@ class Rubiks(Feature): sage: from sage.features.rubiks import Rubiks sage: Rubiks().is_present() # optional: rubiks - FeatureTestResult('Rubiks', True) + FeatureTestResult('rubiks', True) """ def __init__(self): r""" @@ -169,24 +171,6 @@ def __init__(self): sage: isinstance(Rubiks(), Rubiks) True """ - Feature.__init__(self, "Rubiks", - spkg="rubiks") - - def _is_present(self): - r""" - EXAMPLES:: - - sage: from sage.features.rubiks import Rubiks - sage: Rubiks()._is_present() # optional: rubiks - FeatureTestResult('Rubiks', True) - """ - test = (cu2()._is_present() and - size222()._is_present() and - optimal()._is_present() and - mcube()._is_present() and - dikcube()._is_present() and - cubex()._is_present()) - if not test: - return test - else: - return FeatureTestResult(self, True) + JoinFeature.__init__(self, "rubiks", + [cu2(), size222(), optimal(), mcube(), dikcube(), cubex()] + spkg="rubiks")