search for: method_a

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

Did you mean: method_2
2012 Jul 27
3
Rspec: How to mock class method
Hi, I have two model: Message, User message.rb ``` class Message < ActiveRecord::Base class << self def method_a(args) [1,2] end end end ``` user.rb ``` class User < ActiveRecord::Base def method_user if Message.method_a(''anythings'') #... some code end end end ``` I want to test method_user,but I don''t want to test Message#method_a How I can mock Me...
2008 Feb 02
1
Ruby++ FFI (theoretical)
...ntation yet. Regards, Dan // foo.h - Function prototypes #define _FOO_H_ using namespace ruby; // Subclass Object class Foo : public RubyObject { public: // Constructor and Destructor Foo(); // constructor ~Foo(); // destructor // Instance Methods VALUE method_a(); VALUE method_b(VALUE); // Singleton Methods static VALUE method_c(VALUE); }; // foo.cpp - Implementation #include <iostream> #include <foo.h> using namespace ruby; /* Constructor */ Foo::Foo(){ cout << "Hello Worldn"; } /* Or maybe we setu...
2006 Feb 15
2
extending rails via /lib - problems
...unctions which I use in some models in one place. Controllers have application.rb and views have helpers but I couldn''t find anything about models. Using the /lib directory seemed to be the only way. Alright... so I have something like this: /lib/code.rb class ActiveRecord::Base def method_a(n) ....... end def method_b(n) ........ end end /models/some_model.rb class SomeModel < ActiveRecord::Base def self.some_method(a, b) ........ end def other_method ........ end end I also added `require ''code''` to enviroment.rb My problem is that, for...
2006 Jul 12
5
SystemStackError
SystemStackError in GreyController#grey_search stack level too deep can anybody please enlighten me on this one...any possible way to troubleshoot? thanks, MSN id: ICEMANyears@netscape.net -- Posted via http://www.ruby-forum.com/.
2007 Jun 09
11
authentication, controller specs. I think I''m missing something simple ....
...mpErrors disappear. I am interested in how to resolve the LocalJumpError issue tho since I''m sure it will be a use-case that crops up in my application. The basic issue I''m struggling with is how does define mocks/stubs for a controller method that does something of the form: method_a.method_b.find Pasted code/spec/errors here * things_controller http://pastie.caboo.se/69136 * things_controller_spec http://pastie.caboo.se/69137 * Errors w/ find(:all) http://pastie.caboo.se/69138 -- Rick rick.tessner at gmail.com
2024 Jun 29
2
\>
Hi, Duncan: On 6/29/24 17:24, Duncan Murdoch wrote: > >> ????? Yes. I'm not yet facile with "|>", but I'm learning. >> >> >> ????? Spencer Graves > > There's very little to know.? This: > > ???? x |> f() |> g() > > is just a different way of writing > > ??? g(f(x)) > > If f() or g() have extra