Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
How to use be_instance_of
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Mikhail Dikov  
View profile  
 More options Sep 26 2012, 11:59 pm
From: Mikhail Dikov <mdi...@gmail.com>
Date: Wed, 26 Sep 2012 20:59:33 -0700 (PDT)
Local: Wed, Sep 26 2012 11:59 pm
Subject: How to use be_instance_of

I have the following expectation:

[topic title] should be_instance_of([NSString class]);

However the test fails with an error that <value and (__NSCFString)> is
expected to be an instance of <NSString>

What am I doing wrong?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Adam Milligan  
View profile  
 More options Sep 28 2012, 9:34 am
From: Adam Milligan <a...@pivotallabs.com>
Date: Fri, 28 Sep 2012 09:34:25 -0400
Local: Fri, Sep 28 2012 9:34 am
Subject: Re: [Cedar] How to use be_instance_of

You're not doing anything wrong.  The issue is that creating an NSString
doesn't actually ever return an NSString; it's a class cluster, and the
actual instantiated class is decided by some super secret Apple algorithm.

If you try this

[[NSString string] isMemberOfClass:[NSString class]];

you'll notice that it returns false.  Odd, no?  In any case, you can get
around this by allowing for subclasses, like so:

[topic title] should be_instance_of([NSString class]).or_any_subclass();


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mikhail Dikov  
View profile  
 More options Sep 30 2012, 6:22 pm
From: Mikhail Dikov <mdi...@gmail.com>
Date: Sun, 30 Sep 2012 15:22:35 -0700 (PDT)
Local: Sun, Sep 30 2012 6:22 pm
Subject: Re: [Cedar] How to use be_instance_of

Thanks!


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »