Skip to content

Commit

Permalink
Merge pull request #64 from gedaiu/instance-fix
Browse files Browse the repository at this point in the history
instace use the object should
  • Loading branch information
gedaiu authored Dec 19, 2017
2 parents cb95b74 + 145aa87 commit 5367f9a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion core/fluentasserts/core/base.d
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ auto should(T)(lazy T testData) {
auto callable = ({ testData; });
return ShouldCallable!(typeof(callable))(callable);
} else static if(!returned) {
static if(is(T == class)) {
static if(is(T == class) || is(T == interface)) {
return ShouldObject!T(testData.evaluate);
} else static if(is(T == string)) {
return ShouldString(testData.evaluate);
Expand Down
4 changes: 4 additions & 0 deletions core/fluentasserts/core/objects.d
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,12 @@ unittest {
class OtherClass { }

auto someObject = new BaseClass;
MyInterface someInterface = new BaseClass;
auto otherObject = new OtherClass;

someInterface.should.be.instanceOf!MyInterface;
someInterface.should.be.instanceOf!BaseClass;

someObject.should.be.instanceOf!MyInterface;

auto msg = ({
Expand Down
2 changes: 1 addition & 1 deletion test/class.d
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ class Foo {
void bar2() {
enforce(false);
}
}
}

0 comments on commit 5367f9a

Please sign in to comment.