Displaying 20 results from an estimated 42 matches for "flexmock".
2007 Apr 16
0
Fwd: ANN: FlexMock 0.6.0 Released
FYI - Jim Weirich just released an rspec-compatible version of
FlexMock. For those of you using trunk, you can now use either
FlexMock, Mocha, or RSpec''s built-in mocking framework by saying:
Spec::Runner.configure do |config|
config.mock_with :flexmock # or :mocha or :rspec (default)
end
The choice is yours. Mock in peace.
Cheers,
David
---------- Forwa...
2007 May 07
6
mock frameworks
Just curious - now that rspec (as of 0.9) let''s you choose your mock
framework, how many of you are actually using (or planning to use)
mocha or flexmock?
Anybody planning to use any other mock framework besides rspec, mocha
or flexmock?
Thanks,
David
2007 Aug 31
48
Deprecating the mocking framework?
I saw in one of Dave C.''s comments to a ticket that "our current plan
is to deprecate the mocking framework." I hadn''t heard anything about
that, but then again I haven''t paid super close attention to the list.
Are we planning on dumping the mock framework in favor of using Mocha
(or any other framework one might want to plug in?).
Pat
2007 Nov 04
3
Returning the mock associated with an expectation.
I was reading through the FlexMock docs and noticed the expectation
method .mock, which returns the original mock associated with an
expectation.
It looks really handy for writing nice all-in-one mocks like:
mock_user = mock(''User'').expects(:first_name).returns(''Jonah'').mock
So I started playin...
2008 Nov 19
3
Mock today
In some of my unit tests, I find the need to set today to a different
value than the actual today. For example, to test the model method
"balance_of_today", which takes no argument, I want to have Date.today
be a specific date for the purpose of testing. In other words, I want
to do something like this:
mock_today(Date.new(2008, 2, 1)) do
... test code...
end
My implementation for
2006 Oct 25
5
Mocha, Stubba and RSpec
Hi,
I''ve been reading with interest the threads trying to integrate Mocha
and Stubba with RSpec. So far, I''ve made the two changes in
spec_helper.rb suggested, but discovered another one that neither of
the archives mentions:
If you use traditional mocking: object = mock or the stub shortcut
: object = stub(:method => :result), you run into namespace conflicts
with
2008 Jul 25
21
Problems with mock assigned to a constant
...need to do that, should I? So it seems to only
occur when I assign the mock to a constant.
So, even though MyModel.count is stubbed in the before block, the mock
reports an unexpected message. Note however the first example passes.
I had difficulty figuring out the cause of this, so I just gave FlexMock a
shot (since it''s so easy to swap out). FlexMock passed both examples(not
that, that alone signifies a bug in rSpec).
So, my question: Is this a bug in the built in mocking framework, or am I
doing it wrong? :)
-Matt
-------------- next part --------------
An HTML attachment was scrubb...
2008 Jan 02
2
Proxies
...me kind of expectations on the ordering of method calls.
> > I haven''t run into a testing situation where I''ve needed to test the
> > ordering of calls on a mock explicitly, but flex mock provides a
> > grouping mechanism.
> >
> > For the corollary in FlexMock, check out #ordered
> > http://onestepback.org/software/flexmock/classes/FlexMock/Expectation.html#M000082
> >
> > Don''t take me too seriously, but I think mocha could trump flexmock''s
> > with something like:
> >
> > mock_user = mock(''...
2011 Feb 25
7
Rspec2 for rails 2.3.8?
Hi experts,
I picked up a copy of the rspec book and wrote some tests in spec/lib
and spec/models for my Rails 2.3.8 code.
I was using rspec 2.5.1, rspec-core 2.5.0, rspec-expectations 2.5.0 et.
al.
But I realised that the rspec-rails version I am using is meant for
Rails3.
Which version of rspec-rails should I use for Rails 2.3.8?
Best,
Radhesh
--
Posted via http://www.ruby-forum.com/.
2007 Feb 08
1
flex mock?
Hi guys,
Would you mind if I ask how Flex Mock and Mocha sit together? They compete
directly?
I read that Flex Mock was built into Rails 1.2. Is there a reason to use
Mocha instead of Flex Mock?
Tks
Greg
2007 Jul 10
2
Multiple calls to a class method
Hi
Just wrote myself a Date.extract_from_rails_hash to handle parsing
the "date(1i)", "date(2i)" parameters created in the controller
params. I''ve got a method that needs to call this either once or
twice, depending on the contents of the form (one section of the form
is rendered conditionally). So I had two specs for the case where
the second form section
2007 Aug 25
1
rspec hangs when used with QtRuby
...I remove the first line, spec exits correctly with the message "1 example,
0 failures". With the first line, instead, it hangs, and I have to press
Ctrl+C to make it go on (of course, in this case it says: "1 example, 1
failure"). If I use another mock framework (I tried with flexmock), then
everythings works. If I replace :type with anything else in the call to stub,
then everything works.
I tried searching google, this mailing list''s archives and QtRuby forum, but I
found nothing about this. Am I doing something wrong or is it a RSpec or
QtRuby problem? I'...
2011 Mar 30
3
Test errors in fuctional test after adding before_filter :login_required to controller
Hello,
I added the "before_filter" to my controllers to require a login of the
user.
Here''s an example of my Unit Controller with the added before_filter:
IN THE ATTACHED FILE
When executing the tests with rake test, I get different error messages.
To show you my errors, I only executed the unit controller test with the
following line:
ruby -Itest
2007 Sep 12
2
A puzzling spec failure in a shared describe
...d, I suspect I''m missing something about how rspec works... one issue
that isn''t clear from the rspec site is the scope of variables in a
spec file...
Final Q:
Has there been a resolution of the Mock issue, i.e will it rspec
implementation stay in rspec or not.
Which of mocha and flexmock are most compatible (i.e. work) with
rspec, or is there a ''better'' mock project to use with rspec.
Appreciate any help or insight you can offer.
Regards
Mark
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dbi.rb
Type: application/x-ruby
Size:...
2009 Mar 15
7
How to use different mocking frameworks?
Hi,
I''m pretty new to Rspec, so hope someone can help me out with this.
I''m leveraging a couple pre-existing applications in my current
project, both have fairly robust test suites in Rspec already.
However, one is using Rspec''s builit in mocking, and the other is
using mocha.
If I set config.mock_with mocha in spec_helper.rb, then all of the
rspec mocks fail. If I
2007 Apr 13
0
ANN 0.9-beta-2
...6973.html
Additional changes since 0.9 beta-1:
* Made Spec::Ui *much* easier to install. It will be released
separately. Check out trunk/spec_ui/examples
* HTML reports now include a syntax highlighted snippet of the source
code where the spec failed (needs the syntax gem)
* Added [#9735] support flexmock (thanks to Jim Weirich for his
modifications to flexmock to support this)
* Spec::Rails controller specs will no longer let mock exception
ripple through to the response.
* Fixed [#9260] IvarProxy does not act like a hash.
* Applied [#9458] The rspec_resource generator does not take into
account cl...
2007 Aug 22
1
mock framework ethics question
...f_a_model)
and the implementation does this:
obj.msg(containing_model.association_proxy)
the expectation fails. This is because the comparison that rspec mocks make is:
expected == actual
which, in this case ends up being:
mock_of_a_model == association_proxy
As it turns out, mocha and flexmock do this the same way, which means
that this will fail in any of the three frameworks.
So here''s the mock-ethics question of the week:
Should the comparison be changed to:
actual == expected
or
actual == expected || expected == actual
or ... neither?
I have arguments for all thre...
2007 May 20
1
Tips on testing
Hey WWW::Mechanize users,
I''ve been using Mechanize for about 3 or 4 months now, and I''m rather
enjoying it. I''ve done scraping in PHP & Python, starting with raw text and
HTTP requests, moving up to regex and Curl, and finally landed myself here,
making me much more productive when scraping pages.
At the moment, I''m in the middle of a decent sized
2006 Apr 20
11
dynamic mock object anyone?
Hi guys, got this problem with creating such a thing... hope anyone
could help..
the problem:
ok, now i have this mock object that would simulate a external rpc call.
eg
require ''models/xmlrpc_agent''
class XmlrpcAgent
def create(params)
200
end
end
but the value of the value returned is fixed. which is quite hard for me
to test the controller when different
2005 Dec 27
4
Using mocks
Hi,
What's the purpose of test/mocks? I couldn't quite complete the Wiki
entry on this because all the information I _could_ find was in the
readme.
- Rowan
--
Morality is usually taught by the immoral.
_______________________________________________
Rails mailing list
Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
http://lists.rubyonrails.org/mailman/listinfo/rails