Displaying 20 results from an estimated 500 matches similar to: "stubbing gets undone?"
2006 Sep 25
3
Problem stubbing instances referred to by constants
Hi James,
An instance retains its mocha between tests if that instance is
pointed to by a constant. The simplest failing test is something like
(add as a new file in mocha/test)..
#--code--
require File.join(File.dirname(__FILE__), "test_helper")
require ''stubba''
class WemStubbaTest < Test::Unit::TestCase
Arr = [1, 2, 3]
def test_a
2007 Mar 30
7
problem with using any_instance
Hey all,
I have a question with using mocha in my tests.
In the same test file, I have two tests,
<code>
def test_a
klass.any_instance.stubs(:method_name).returns("something")
klass.new.method_name
...
end
def test_b
...
klass.new.method_name
...
end
</code>
where klass is some class
when the tests run, test _a passes, but test_b had an error like this:
2007 Sep 06
5
Removing/overriding/unstubbing a stub?
We''re using Mocha stubs to stub out a slow-performing network request in
a Test::Unit class. But naturally, we don''t want to stub it out in the
few tests that actually verify the functionality of that network request.
Is there a way to do the stub in "setup", but override it for the few
tests that need the original functionality?
(I realize that in this case, the
2007 Jan 17
8
Mocha Mock''s hanging on after test run?
Hi guys,
I''m running mocha (0.3.2) against Rails core and just found an issue
where the mock doesn''t go away after the test is run.
For example:
def test_reset_bang_doesn_reinstall_named_routes
ActionController::Routing::Routes.named_routes.expects(:install).never
@session.reset!
end
def test_zzz
puts ActionController::Routing::Routes.named_routes.inspect
2013 Jun 09
2
Minitest mock or stub methods
Hi
I''m building a small library to use in my Rails app which interacts with a
3rd party API. It fetches artists and tracks.
So I have:
lib/my_lib.rb
lib/my_lib/artist.rb
lib/my_lib/track.rb
To get an artist I do
artist = MyLib::Artist.find("Oasis")
Which returns an instance of Artist if it finds (via 3rd party API) it or
nil otherwise.
Then I can call artist.tracks which
2011 Aug 15
1
Team Fortress 2 Bug Fix Undone by New Patch
Okay, so awhile back I had a problem with Steam. It wouldn't start and so I fixed that after installing a minimal version of winetricks (I removed a few things I knew I wouldn't need). Then Steam worked.
Unfortunately I then had a problem with Team Fortress 2. This time the game wouldn't load. So I read the AppDB for Team Fortress 2 again and it said to disable Steam Community
2000 Dec 20
0
closing the sink connection a) is possible and b) can't be undone (PR#782)
# Have no other connections opened yet
> showConnections()
class description mode text isopen can read can write
> sink("tempfile")
> close(getConnection(3))
> cat("send some output\n")
Error in stdout() : invalid connection
> sink()
Error in sink() : invalid connection
> cat("send some output\n")
Error in stdout() : invalid connection
>
2000 Dec 20
0
closing the sink connection a) is possible and b) can't be undone
# Have no other connections opened yet
> showConnections()
class description mode text isopen can read can write
> sink("tempfile")
> close(getConnection(3))
> cat("send some output\n")
Error in stdout() : invalid connection
> sink()
Error in sink() : invalid connection
> cat("send some output\n")
Error in stdout() : invalid connection
>
2010 Aug 29
0
Troll - A Rails plugin for making webservice mocking easier
Hi Folks,
Troll trumps your existing ActiveResource mocking libraries like
inbuilt HttpMock,Fakeweb or Webmock out of water. With Troll,
ActiveResource mocking just works, some of its features:
1. Don''t need to mock calls at Net::HTTP level (which webmock,fakeweb
do). Really, we don''t care what HTTP library ActiveResource uses,
fakeweb and webmock bring additional complexity
2018 Apr 05
2
[Bug 105916] New: "xset dpms force off" can't be undone on hp omen 17-an0xx laptop
https://bugs.freedesktop.org/show_bug.cgi?id=105916
Bug ID: 105916
Summary: "xset dpms force off" can't be undone on hp omen
17-an0xx laptop
Product: xorg
Version: git
Hardware: x86-64 (AMD64)
OS: Linux (All)
Status: NEW
Severity: normal
Priority: medium
2007 Dec 05
9
Does mock_model''s :null_object option work?
Please understand in the following that I am making relatively minor changes to legacy (non-TDD/BDD) code in Substruct and don''t have the time to refactor nicely right now. I''m just trying to get past the untested/un-speced cruft quickly to write the spec for my new code, so I''m looking for expediency over prettiness.
I''m specifying
before( :each ) do
2012 Apr 05
5
rspec: identical tests fails when repeated
I''m doing RSpec controller testing with CanCan authorization, and I''m
seeing something I''ve never seen in RSpec before: the same test run
twice fails on the second one. I am NOT doing before(:all) or other
things that should cause state to persist between tests:
Here''s the relevant code:
context "POST create" do
context "with user logged
2011 Mar 01
6
render :collection calling partial with phantom object?
I have two models with a straightforward has_many / belongs_to
relationship:
class Premise < ActiveRecord::Base
has_many :metered_services, :dependent => :destroy
...
end
class MeteredService < ActiveRecord::Base
belongs_to :premise
...
end
and nested routes to match:
Demo::Application.routes.draw do
devise_for :users
resources :premises do
resources :metered_services
2012 Jan 15
1
How to mock out a WEBrick::HTTPServer?
partial code : http://pastie.org/3186140
I want to test a HTTP server, I''m using lower level stuff so I can
understand whats going on, then I might move onto FakeWeb/WebMock/etc
Its a reverse proxy, so it doesn''t generate the page content.
I want to test
a/ methods in the class in isolation
b/ test that if a HTTP request sent in generates a HTTP request out
(suppose should be
2007 Jan 30
0
nil object in mocks
RSpecrs,
I''ve been running into some trouble lately when passing mock objects
into rich views. Either I have to obscure my specs by stubbing every
method the view would call on my object, or I have to resort to
trickery like stubbing ActionController#render, which is also less
than ideal.
The solution I''ve some up with is a variant on the :null_object option
that can be passed
2003 Nov 01
4
NAT router and off-premise SIP audio problem
Our network is connected to a cablemodem using a dynamic DNS service to
resolve our address. The Asterisk server has been alternately set up behind
a NAT router and without a NAT router -- that is, with two NICs, one of
which is providing NAT to the rest of the network; the office SIPs are
behind that with static private IP addresses.
Off-premise SIPs are all behind simple NAT routers.
2013 Dec 14
0
[LLVMdev] Dropping debug info for base classes with pure virtual functions
On Dec 14, 2013, at 11:27, David Blaikie <dblaikie at gmail.com> wrote:
> (+llvmdev)
>
>
> On Sat, Dec 14, 2013 at 11:02 AM, Adrian Prantl <aprantl at apple.com> wrote:
> Hi David,
>
> I just bisected a debug info problem we were experiencing down to your legendary commit:
> Revert "Revert "Revert "Revert "DebugInfo: Omit debug info for
2013 Dec 14
2
[LLVMdev] Dropping debug info for base classes with pure virtual functions
(+llvmdev)
On Sat, Dec 14, 2013 at 11:02 AM, Adrian Prantl <aprantl at apple.com> wrote:
> Hi David,
>
> I just bisected a debug info problem we were experiencing down to your
> legendary commit:
> Revert "Revert "Revert "Revert "DebugInfo: Omit debug info for dynamic
> classes in TUs that do not have the vtable for that class"”""
2010 Nov 09
3
help getting started with javascript generated forms
How does one generate a form within a view using javascript?
Specifically, assume views/premise/new.html.erb looks like this:
<%= form_for(Premise.new) do |f| %>
<%= f.hidden_field :full_address, :value => $FULL_ADDRESS %>
<%= f.hidden_field :geocoding, :value => $GEOCODING %>
<%= f.submit :value => "use this address" %>
<%= f.label
2016 Jun 30
3
[CENTOS ]IPTABLES - How Secure & Best Practice
Ned,
Thank you very much for the response.
Great example following through on the premise.
It sounds like I need to have a better understanding of the traffic
patterns on my network to know the optimal order for iptables
filtering rules.
My brief example -
Premise: I want to limit outsiders from interfering with LAN client machines.
So, I have the following rules regarding forwarding traffic: