As far as I know, should_receive is applied only to mock objects. What I want is to check, if a certain Class (not object) received a certain message, like:
User.should_receive(:all).once
How do I do that?
Scenario: I needed to add HttpUtility to my project, and I started by adding "using System.Web" to my collection of using directives. However the HttpUtility class would still not resolve, and I discovered (via this question) that I needed to add a reference to my project.
Question: Why do I need to add a reference to this library when for most other classes a "using" directive will suffice?
Hello,
To "simulate" instances from class diagrams I am using USE But I find very frustating to create instances. I am looking for similar tools like this one. I really like USE, but GUI is painfull. I think, that USE is pretty cool to learn how the model "works".
Do you know similar tools like this one?
In MSDN documentation, many .NET classes methods (like ArrayList ) mentioned that "Supported by the .NET Compact Framework".
How internally it has been modified so that it has been supported by .NET compact Framework? I assumed all the .NET Base class library can be used on .NET compact Framework.
Hello
I'm trying to be able to check if a selector have a certain sets of classes.
.hasClass() can only check if the selector has one class. And the .is() selector can look for multiple classes but will return true if the selector have at least one of the classes.
But I wan't to achieve a way to check if a selector have both of the classes, and only if it has both of the classes do action.
Any pointers?
I was wondering if there was a dictionary containing string versions of wxPython class (like 'Button' for wx.Button) to the events they call. This is what I want: {'Button': wx.EVT_BUTTON, ...}. Is there a dictionary like this anywhere in the module or on the web?
Is there a Pattern in Scala that can add a method to an Array object?
I am thinking of the implicit conversion of Int to RichInt. But that can't be done as Array is a final class.
I've just started to work with DoubleClick Studio. I've successfully created a Flash expanding ad with CS4 that is mostly scripted and uses the Document class option.
Now for some reason the back end of DoubleClick Studio thinks I've imported the Enabler component twice.
I've checked my files numerous of times but can't find the root cause.
Any help is much appreciated :)
I am attempting to code some plugins to use with MIDI sequencers but have hit a stumbling block. I can't use global-scope variables to store information because multiple instances of the .dll can exist which share memory.
How do I create a class (for re-usability purposes in other plugins) containing 2 dimensional array and other variables the content of which is to be shared between functions? If that is possible, how would I read and write the data from the function in the framework where I do the processing?
I've created a simple background effect for some tabs on a page but don't want that effect to fire if the tab has the class 'current'.
I presume there is a way to do this using .hasClass
Here's what I'm using for the effect:
$('ul.htabs a').mouseover(function(){
$(this).stop().animate(
{backgroundPosition:"(0 -810px)"},
{duration:150},
{easing: 'easeOutCubic'})
}).mouseout(function(){
$(this).stop().animate(
{backgroundPosition:"(0 -806px)"},
{duration:150},
{easing: 'easeInCubic'})
});
Is there a way to force classes in Java to have public static final field (through interface or abstract class)? Or at least just a public field?
I need to make sure somehow that a group of classes have
public static final String TYPE = "...";
in them.
Much like Java (or php), I'm use to seperating the classes to files.
Is it the same deal in Python? plus, how should I name the file?
Lowercase like classname.py or the same like ClassName.py?
Do I need to do something special if I want to create an object from this class or does the fact that it's in the same "project" (netbeans) makes it ok to create an object from it?
Say I have a struct:
struct MyStruct
{
public int X
public int Y
}
And a method in some class that is iterated over many times elsewhere:
public bool MyMethod( MyStruct myStruct )
{
return ...
}
Is changing the MyMethod signature to the following an acceptable optimization?
public bool MyMethod( ref MyStruct myStruct )
If so, how much of an advantage would it really be? If not, about how many fields would a struct need for a big enough advantage using ref this way?
i'm trying to run a conditional statement in a class i'm placing in my App_Code folder
the condition is whether the person is logged in or not. I normally have two ways to do this in my masterpage and ASPX's
if (!User.IsAuthenticated) or if(Profile.username = "anonymous")
however neither of these things seem available to me in the .cs i'm making. anyone know what i'm missing? maybe a using namespace up top?
Suppose I have:
class myclass:
def __init__(self):
self.foo = "bar"
where the value of foo needs to be available to users of myclass. Is it OK to just read the value of foo directly from an instance of myclass? Should I add a get_foo method to myclass or perhaps add a foo property? What's the best practice here?
Hi there. Does anyone have any recommendations for a class (online) or tutorial that teaches android programing for dummies? It's frustrating knowing exactly what you want to do and no idea how to do it. Something that uses basic language and explains each line in detail to help a person remember how to do it later. Any suggestions would be great. Thanks.
How does PIC work for shared libraries which use virtual classes (ARM?). Is there any workaround so that i can access programm class object from shared library or vice versa?
Hi,
I am working with classes and object class structure, but not at a complex level – just classes and functions, then, in one place, instantiation.
As to __construct and __destruct, please tell me very simply: what is the purpose of constructors and destructors?
I know the school level theoretical explanation, but i am expecting something like in real world, as in which situations we have to use them.
Provide also an example, please.
Regards