Displaying 20 results from an estimated 20000 matches similar to: "Mock Objects (Development)"
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
2006 Aug 14
14
A mock which extends rather than replaces a class?
While running tests, we would like to instrument some of the classes
under test. We still want the classes to do exactly what they currently
do, but we would like them to do more when running in the test
environment.
Clearly we can (and currently do) just extend the objects "on the fly"
where necessary, but this is a bit messy - we''d like some centralised
way to always
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
2010 May 15
3
ActiveResource Mock Objects
Some of my tests use ActiveResource HttpMock requests and some of them
do not. Does anyone know if there is a way to disable the HttpMocks
after they have already been loaded? The method
ActiveResource::HttpMock.reset! only removes all the objects, but
ActiveResource still thinks it should look for mock requests rather
than actually making requests. I hope this makes sense!
Thanks,
Tom
--
2006 Sep 01
3
Anyone seeing mock breakage after updating to 4.4?
Morning,
somehow the upgrade to 4.4 broke mock on my system:
| [angenenr at shutdown SPECS]$mock -r c3-i386 /home/angenenr/redhat/SRPMS/apache-ssl-2.8.28-2el4.src.rpm
| init
| clean
| prep
| This may take a while
| Could not find useradd in chroot, maybe the install failed?
Nope, it's not the
config_opts['chroot_setup_cmd'] = 'groupinstall build'
issue, as I'm still
2020 Aug 24
2
Mock config error
Hi Jonathan,
On Sun, 23 Aug 2020, Jonathan Billings wrote:
> On Aug 23, 2020, at 12:07, me at tdiehl.org wrote:
>>
>> ?Hi,
>>
>> I am trying to create a mock configuration file that points to my local dnf repo.
>> I have the following in the mock config template:
>>
>> [local-repo]
>> name=my-Local
>>
2014 Jan 15
1
Mock and Mock again
Question: If I use mock to build package rpmA from tarballA but rpmA has a
dependency that can only be satisfied by package rpmB which must also be built
from tarballB then how does the rpmB built from the tarballB get pulled into
mock when building rpmA?
I am trying to build httpd-2.4.7 from Apache and that needs apr-devel and
apr-util-devel > 1.4. I can build apr and apr-utils in mock but
2020 Aug 25
1
Mock config error
On 25/08/20 11:27 am, Jonathan Billings wrote:
> On Aug 24, 2020, at 16:48, me at tdiehl.org wrote:
>>
>> Also, I am trying to add a dist tag to rpms that I build in mock.
>> In the epel-7 configs I do something like the following:
>> config_opts['macros']['%dist'] = '.el7.tnt' to get a dist tag on the
>> rpms. In epel/centos 8 this does not
2006 Jan 10
4
Problem creating MockController
Hi there,
I''m trying to create a mock controller to test the use of UrlHelper in
ActionMailer. I''m trying this:
require
''d:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.11.0/lib/action_controller''
# Re-raise errors caught by the controller.
#class DiscussionsController; def rescue_action(e) raise e end; end
class MockController < ActionController::Base
def
2006 Oct 25
2
mock parameter problem
Here''s another one.
spec:
m = mock("blah")
m.should_receive(:foo).with(1)
code:
m.foo(2)
Failure message:
Mock ''blah'' expected ''foo'' once, but received it 0 times
------
Twice now I''ve gotten this failure message and wasted time trying to
understand why the method foo() was not being called despite all
evidence suggesting
2010 May 03
1
Mock Shell Arch Command
I've successfully rebuilt Red Hat EL PHP 5.2.10 RPMs using mock on a
CentOS 5.4 i386. I wanted to be able to build both x86_64 and i386
versions so I reinstalled my builder system with CentOS 5.4 x86_64.
Now I can build the PHP RPM successful for x86_64, but i386 fails with
the following during configure
/usr/bin/net-snmp-config: line 43: net-snmp-config-x86_64: command not found
For the
2020 Aug 23
2
Mock config error
Hi,
I am trying to create a mock configuration file that points to my local dnf repo.
I have the following in the mock config template:
[local-repo]
name=my-Local
baseurl=http://yumrepo.example.com/yum-repository/local/centos/8/x86_64/
failovermethod=priority
skip_if_unavailable=False
When I try to run mock I get the following error:
(vgeppetto3 pts18) $ mock -v -r epel-8-x86_64
2006 Jul 24
2
Creating a ''default'' mock
Am I correct in thinking that it''s not currently possible to have a
method that creates a ''standard'' mock (i.e. a mock that has defaults
useful in all contexts)?
I''ve tried with the mock method and also by manually creating new Mock
instances. I get failures when setting up expectations (undefined
method ''receive'' for proc).
Chris
2015 Jan 29
2
build c7 packages for i686 using mock
This might be an embarrassingly simple question. How are people
building multi-arch library packages on CentOS 7? On older releases one
could "mock -r epel-6-i386" and "mock -r epel-6-x86_64" to build a
library twice. With no 32-bit release, there's no epel-7-i386 target
for mock. Specifying --target=i386 or --arch-i386 both fail.
Do we have to set up the
2007 Mar 13
1
Opening the singleton class of mocked objects
I wrote a plugin [1] a while ago that lets me do validations on a
single AR instance. Instead of defining validations in an AR class, I
can define them on a AR instance''s singleton class:
class << @video
validates_presence_of :title
end
One of my specs mocks Video.find, and the above code is run on the
mock object. When I run the spec, I get the expected
undefined method
2007 May 17
4
How to mock helpers in view specs ?
Hi all,
I am mocking the following Rails view (inside a partial):
<%= render :partial => "forums/forum",
:collection => forum_category.forums.readable_by(current_user? ?
current_user : nil) %>
My spec fails with the following message:
1)
ActionView::TemplateError in ''forum_categories/index (anonymous user)
should only render forums accessible to anonymous
2006 Jun 15
3
How to mock a model method for unit tests?
I have a model class, say, model.rb, and in the normal course of things
it creates an instance of another class, say utility.rb (also in the
models directory).
class Utility
def initialize(obj)
# do stuff...
end
def do_something_expensive
# lots of stuff here
end
end
During testing, I want to mock out do_something_expensive because it''s
not important for the tests,
2006 Nov 22
2
.class call to the mock object (or any existing methods)
Hi
I run into problem trying to set expectations for the mockobject.class
method, I had to undefine a method before I could set some expectation. Is
there any better way of doing it?
object = mock()
....
klass = class <<object; self; end
klass.send(:undef_method, "class") # I had to do this because Mocha
utilizes "method_missing(symbol, *arguments, &block) "
2011 Feb 02
1
Significant speedup of package building with mock from EPEL for RHEL 6, should definitely go in CentOS 5
The speedups in building RPM's with "mock" from the EPEL packages for
RHEL 6 are *profound*, especially if your environment is like mine and
you have thousands of user id's. The issue seems to be the handling of
"/var/log/lastlog" and similar files, which are otherwise quite large
and take significant time to compress and uncompress when laying out
new mock
2007 Apr 11
0
Fwd: [ mocha-Bugs-6416 ] Mock objects shouldn''t define #to_s
---------- Forwarded message ----------
From: noreply at rubyforge.org <noreply at rubyforge.org>
Date: 11-Apr-2007 15:07
Subject: [ mocha-Bugs-6416 ] Mock objects shouldn''t define #to_s
To: noreply at rubyforge.org
Bugs item #6416, was opened at 2006-10-31 15:34
You can respond by visiting:
http://rubyforge.org/tracker/?func=detail&atid=7477&aid=6416&group_id=1917