search for: be_an_instance_of

Displaying 6 results from an estimated 6 matches for "be_an_instance_of".

2007 Oct 25
1
Mocking within a Proc/Block?
...aise unless self.is_a? (Interview) }.should_not raise_error Interview.create(:title => "Text", &block) end However, the following does not: it "should evaluate a passed in block in the context of the interview object" do block = Proc.new { self.should be_an_instance_of(Interview) } Interview.create(:title => "Text", &block) end I''d far prefer to use the latter. However "be_an_instance_of" is not defined on my Interview class per the interpreter. While I''ve poked a little inside RSpec for insights, I'...
2007 Nov 02
5
RSpec, RESTful nested routes and :path_prefix
Dear list, In the app we are making we have a rout something like this: map.resources :projects do |projects| projects.resources :pages, :controller =>"Wiki::Pages", :path_prefix => "/projects/:project_id/ wiki", :name_prefix => "project_wiki_" end But I can''t get RSpec(I''m very new to it) to accept this. It keeps throwing errors:
2007 Mar 19
0
action_web_services error with rspec_on_rails
...er" do testing_crud_setup specify "should subclass from CrudResourceController" do TestingCrudController.superclass.to_s.should == ("CrudResourceController") end specify "should be an instance of TestingCrudController" do controller.should be_an_instance_of(TestingCrudController) end end # more contexts - I believe the revelent code stops here context "model_name" do testing_crud_setup specify "should be a private method" do controller.private_methods.include?("model_name").should == true end speci...
2009 Mar 15
0
rspec 1.2.0 Released
...d explicit autorun feature for running specs with ruby command * added handling for does_not_match? for matchers that want to know the context in which they were called * lots of ruby 1.9.1 compatibility fixes from Chad Humprhies * improved feedback from be_kind_of/be_a_kind_of/be_instance_of/be_an_instance_of (Jakub ????astn??) * added --format silent (l) option, which is now the default when running --heckle (Bob Aman) * sexy new custom matcher creation (Corey Haines & David Chelimsky - initial concept by Yehuda Katz) * improved matcher protocol - old one is still supported, but new one is cl...
2007 Feb 24
3
Spec failing [Possible Bug with kind_of? and instance_of?]
I have a spec which is failing, but I just can''t say why. Maybe I''m missing something painfully obvious? Here is the pastie of the results & the spec: http://pastie.caboo.se/42626 The spec to look for is "should have an array of users" I''ve printed out ("puts''ed") to the terminal the fact that the values are *opposite* to what
2007 Jul 09
12
Mocking User.find( :all, :limit => 10 )
Hi, I''m trying to setup a mock for my controller test but I can''t get it to recognise the mock. I use it "should find all users" do User.should_receive(:find).with( :all, :limit => 10 ).and_return([@user]) do_get end and in the controller @users = User.find(:all, :limit => 10 ) But this does not work. It gives me User expected :find with (:all)