Why doen't it fail?

0 views
Skip to first unread message

Mike Plavsky

unread,
May 21, 2008, 6:13:48 AM5/21/08
to Specter BDD Framework
Hi,

Maybe it is a stupid question but I am a novice to 'boo', 'specter'
and 'python' world, so let me ask:

If I use duck type instead of concrete type the following code never
fails (always green) despite of the fact that true Count is 1:

reader as duck

reader = SpringConfig.SpringConfigReader()
objects = reader.Read( config )
objects.Count.Must == 10

When I change duck to the concrete type (here it is
SpringConfig.SpringConfigReader) everything works just fine.

Why?

Regards,
Mike

Cedric Vivier

unread,
May 21, 2008, 6:44:42 AM5/21/08
to specter-...@googlegroups.com
Hi Mike!

This is a bug in specter with the Must == on reference types.
When a type is declared as duck in boo, everything from it is object (thus reference) since resolved at run-time.

Jeffery has posted a patch some time ago on the list to fix this.
I'll integrate his patch and make a new release including this fix today!

Thanks,

Mike Plavsky

unread,
May 21, 2008, 6:49:36 AM5/21/08
to Specter BDD Framework
Got it. Thanks a lot!

On May 21, 2:44 pm, "Cedric Vivier" <cedr...@neonux.com> wrote:
> Hi Mike!
>
> This is a bug in specter with the Must == on reference types.
> When a type is declared as duck in boo, everything from it is object (thus
> reference) since resolved at run-time.
>
> Jeffery has posted a patch some time ago on the list to fix this.
> I'll integrate his patch and make a new release including this fix today!
>
> Thanks,
>
> On Wed, May 21, 2008 at 12:13 PM, Mike Plavsky <supermapl...@gmail.com>
> wrote:
>
>
>
>
>
> > Hi,
>
> > Maybe it is a stupid question but I am a novice to 'boo', 'specter'
> > and 'python' world, so let me ask:
>
> > If I use duck type instead of concrete type the following code never
> > fails (always green) despite of the fact that true Count is 1:
>
> > reader as duck
>
> > reader = SpringConfig.SpringConfigReader()
> > objects = reader.Read( config )
> > objects.Count.Must == 10
>
> > When I change duck to the concrete type (here it is
> > SpringConfig.SpringConfigReader) everything works just fine.
>
> > Why?
>
> > Regards,
> > Mike- Hide quoted text -
>
> - Show quoted text -
Reply all
Reply to author
Forward
0 new messages