From 9a4e13954a26e58ec5202a35642cd1dca517a655 Mon Sep 17 00:00:00 2001
From: Dom Coleman <46578754+domcoleman@users.noreply.github.com>
Date: Tue, 5 Feb 2019 17:44:53 +0000
Subject: [PATCH] Tests for OOP: Inherit Behaviors from a Supertype (#34938)
* Tests for OOP: Inherit Behaviors from a Supertype
Fixes issue #34905
* fix: make test inclusive
---
.../inherit-behaviors-from-a-supertype.english.md | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/object-oriented-programming/inherit-behaviors-from-a-supertype.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/object-oriented-programming/inherit-behaviors-from-a-supertype.english.md
index dde6a8f4c4..f9aed6ca63 100644
--- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/object-oriented-programming/inherit-behaviors-from-a-supertype.english.md
+++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/object-oriented-programming/inherit-behaviors-from-a-supertype.english.md
@@ -32,6 +32,10 @@ tests:
testString: assert(typeof duck !== "undefined", 'The duck
variable should be defined.');
- text: The beagle
variable should be defined.
testString: assert(typeof beagle !== "undefined", 'The beagle
variable should be defined.');
+ - text: The duck
variable should be initialised with Object.create
.
+ testString: assert(/(let|const|var)\s*beagle\s*=\s*Object\.create\s*\(\s*Animal\.prototype\s*\)\s*;/.test(code), 'The duck
variable should be initialised with Object.create
');
+ - text: The beagle
variable should be initialised with Object.create
.
+ testString: assert(/(let|const|var)\s*duck\s*=\s*Object\.create\s*\(\s*Animal\.prototype\s*\)\s*;/.test(code), 'The beagle
variable should be initialised with Object.create
.');
- text: duck
should have a prototype
of Animal
.
testString: assert(duck instanceof Animal, 'duck
should have a prototype
of Animal
.');
- text: beagle
should have a prototype
of Animal
.