So the code is doing what it should, and it is the assertion that is failing.
The problem is because assertSame/assertNotSame is simply deferring to isEquals/isNotEquals, this calling an “equalize” function which treats objects as structs and simply compares the public variables.
This is INCORRECT behaviour for assertSame/assertNotSame (they should be equivalent to the === and !== operators in JavaScript), so a bug in TestBox.
I created the above workaround as a custom assertion, for the benefit of anyone else who has the same problem (at least before TestBox is fixed/released).
Custom Assertion code is here:
Save that to a file, e.g. in {root-dir}/testing/assertions/Component.cfc then in setup() or beforeTests() refer to it like this:
addAssertions( new testing.assertions.Component() );
Then you can use it like so:
var ObjA = Wirebox.getInstance(‘ObjName’);
var ObjB = Wirebox.getInstance(‘ObjName’);
$assert.isSameInstance( ObjA , ObjB , “Expected same instance to be returned.” );
SessionInvalidate();
var ObjC = Wirebox.getInstance(‘ObjName’);
var ObjD = Wirebox.getInstance(‘ObjName’);
$assert.isNotSameInstance( ObjC , ObjB , “Expected new instance to be created.” );
$assert.isSameInstance( ObjC , ObjD , “Expected same instance to be returned.” );
Any plans / thoughts on when the next Testbox release is aimed for?
On a side note, are there any Groups Admin options to stop Google changing “testbox” to “textbox” when searching? Even writing +“testbox” is getting changed now, which used to be the way to tell it to stop buggering about with what I’ve told it to look for.
(I’m thinking maybe if there’s a keywords option or similar, that might be enough to stop it.)
If it is, it’s a recognition on your side - I tried both logged in and logged out (incognito, so should be no cookies involved) and got same results.
But then it doesn’t pay attention to searches in the same session - i.e. altered or even repeated searches still get changed (despite selecting the proper term) every time, which I would expect to be more likely than basing of searches from previous sessions?
But yeah, this is why I was wondering about an admin option for keywords though - maybe it takes those into account for whether it shows “corrections”, and thus adding testbox in might stop it changing. (I think the Google Custom Search Engine stuff has something like that, but that might be entirely different to Groups search.)
Do not know what to say, for me the search results are testbox on my
Windows 8, laptop also running windows 8 and 3 Virtual Box instances
(Running Windows 7, Windows Server 2003 / 2012) all resulted for the same
as me.
I get the same thing you do Peter. I think it’s just Google trying to “help” and I’ve never seen any settings to change it. I just have to click the “search instead for testbox” link.
Sometimes on Google’s web search, I’ll put stuff in quotes and under search tools, change to “verbatim”, but I don’t see those options on Google Groups.
According to this video, there’s nothing you can do about it:
Btw I know this is an old thread, if you want to know how major online searches social networks work to personalise your experience. You may find this 3 year old talk on Ted interesting.