-
-
Notifications
You must be signed in to change notification settings - Fork 468
Commit
…est file is not at the top of the stack
- Loading branch information
There are no files selected for viewing
11 comments
on commit 6c4b25e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No tests? ;-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for keeping me real. Just changed the tests so they would catch the unbound param bug. The line number is tough because I'm not sure how exactly to test It. Looks like there are no tests for It.ps1.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, It.ps1 sort of blew up at one point. I would like to repair those broken windows and I think that can be done extracting out a lot of the functionality into separate functions and test those in isolation. It.ps1 will become an integrating function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Rich. Could you include the entire Describe block you are using? I'm not able to repro using:
Describe "fgdf" {
$letters="abc"
It "abc" {
$letters.should.be("def")
}
}
Tried in both PS 2 and 3.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
did you build from source?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
build from source? not sure i follow. Are you saying this occurs when running Pester's "./build.bat"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wanted to let you know i am using the most recent version of pester, with your commits.
the pester i am using i run pester's build.bat and then i drop the nupkg and chocolateyinstall on my internal repo...
so the version of pester includes your commits...
When I run the describe
Describe "fgdf" {
$letters="abc"
It "abc" {
$letters.should.be("def")
}
}
I get:
@{should=System.Object}You cannot call a method on a null-valued expression.
At C:\Tools\pester\Functions\It.ps1:127 char:31
+ $idx = $stackTrace.IndexOf <<<< ($find)
+ CategoryInfo : InvalidOperation: (IndexOf:String) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull
[-] abc (32ms)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PS C:\test> $host.Version
Major Minor Build Revision
2 0 -1 -1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I comment out #126-130 I get:
[-] abc (13ms)
Assert failed on "be" with "1" argument(s): "Expected: def. But was: abc"
at line: 3 in C:\test\alpha.Tests.ps1
It doesn't look like $stacktrace has a value if I output it... Is L95 passing the proper variable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Argh. It is a ps 3 breaking ps 2 issue. I forgot that running pester.bat in ps 2.0 on win 8 will just open a new 3.0 shell. Will fix now. Thanks!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok. the fix is in and I like the solution much more than the original. Thanks for catching this rich!
@{should=System.Object}You cannot call a method on a null-valued expression.
At C:\Tools\Pester.1.1.0\tools\Functions\It.ps1:127 char:31
This is what I get when I run any failed test
It "abc" {
$letters=abc
$letters.should.be("def")
}