Skip to content

Commit

Permalink
abstract class spec cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
ot-matt-florence committed Jul 10, 2012
1 parent 219e146 commit ee20ba7
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public void Setup()
public void abstracts_should_not_be_added_as_class_contexts()
{
var allClassContexts =
contextCollection[0].AllContexts().Where(c => c.GetType() == typeof(ClassContext)).ToList();
contextCollection[0].AllContexts().Where(c => c is ClassContext).ToList();

allClassContexts.should_contain(c => c.Name == "ConcreteClass");

Expand All @@ -60,24 +60,24 @@ public void abstracts_should_not_be_added_as_class_contexts()
allClassContexts.should_not_contain(c => c.Name == "AnotherAbstractClassInChain");
}

//TODO: specify that concrete classes must have an example of their own or they won't host
//abstract superclass's examples or do away with abstract classes altogether .
//I'm not sure this complexity is warranted.

[Test]
public void examples_of_abtract_classes_are_included_in_concrete_class()
public void examples_of_abtract_classes_are_included_in_the_first_derived_concrete_class()
{
TheContext("ConcreteClass").Examples.Count().should_be(3);

TheExample("specify an example").should_have_passed();

TheExample("specify an example in abstract class").should_have_passed();

TheExample("specify an example in another abstract class").should_have_passed();
}

[Test]
public void derived_concrete_class_does_not_contain_the_examples_from_the_abtract_class()
public void subsequent_derived_concrete_class_do_not_contain_the_examples_from_the_abtract_class()
{
TheContext("DerivedConcreteClass").Examples.Count().should_be(1);

TheExample("specify an example in derived concrete class").should_have_passed();
}
}
}

0 comments on commit ee20ba7

Please sign in to comment.