Displaying 12 results from an estimated 12 matches for "at_least".
Did you mean:
aleast
2008 Mar 08
3
should_receive(:foo).with(any_object)
...Numeric)
end
end
def any_object
@any_object ||= AnyObjectComparator.new
@any_object
end
def any_number
@any_number ||= AnyNumberComparator.new
@any_number
end
Which gives me the ability to do the should_receive call like this:
Item.should_receive(:random_item).with(any_object,
any_number).at_least(1).times.and_return(mock_model(Item))
(the first any_object parameter is only in there for demonstration purposes ;) )
And if I would like to it''s possible to get the actual value which was
passed to as an argument with: any_xxx.object
Ok, these any_xxx things behave somehow like a single...
2007 Dec 13
3
rsync 3.00pre6 segfault in add_dirs_to_tree
Hi All
I run rsync in an automated environment and it sometime will crash and
leave a core dump file. from core dump, gdb shows that
gdb) bt
#0 add_dirs_to_tree (parent_ndx=-1, from_flist=0x56c590, dir_cnt=1) at
flist.c:1422
#1 0x0000000000409eab in send_file_list (f=16, argc=-1, argv=0x56c238)
at flist.c:2068
#2 0x0000000000419052 in client_run (f_in=16, f_out=16, pid=-1, argc=1,
2008 Aug 08
2
template.expect_render fails when partial is rendered from a helper
My spec;
describe ''subnav rendering while logged in'' do
before do
template.stub!(:logged_in?).and_return(true)
template.stub!
(:current_profile).at_least(:once).and_return(mock_profile)
end
def do_render
render "/homepages/show.html.erb"
end
it "should render the logged in partial for homepages" do
template.expect_render(:partial => ''shared/subnav/home'', :locals
=> {:active =&...
2007 Jun 03
3
should_receive.again
Hi,
It appears that if I have 2 should_receives in a row, the latest one
overrides the previous one(s).
If there isn''t one, could we add a way to accumulate them, such as
@thing.should_receive(:method).and_return(@value)
@thing.should_receive(:method).again.and_return(@value)
@thing.should_receive(:method).again.and_return(@value)
would be equivalent to
2008 Mar 18
6
Problem with mocking a simple has_many relationship
...errors.add(:images, "cannot be empty") if self.images.count
end
end
the spec:
describe Item do
before(:each) do
@item = Item.new
end
...
it "should have at least one image" do
@item.should have(1).error_on(:images)
@item.images.should_receive(:count).at_least(:once).and_return(1)
@item.should have(0).errors_on(:images)
end
end
Obviously i''m doing something wrong cause this doesn''t work:
1)
''Item should have at least one image'' FAILED
expected 0 errors on :images, got 1
./spec/models/item_spec.rb:60:
script/sp...
2007 Jan 24
0
Mocha 0.4 released
....uk/>
).
- Specify multiple return values for consecutive calls.
- Improved consistency of expectation error messages.
- Allow mocking of Object instance methods e.g. kind_of?, type.
- Provide aliased versions of #expects and #stubs to allow mocking of
these methods.
- Added at_least, at_most, at_most_once methods to expectation.
- Allow expects and stubs to take a hash of method and return values.
- Eliminate warning: "instance variable @yield not initialized" (patch
from Xavier Shay <http://blog.rhnh.net/>).
- Restore instance methods on partial mo...
2012 May 05
1
rspec-mocks and rspec-rails-2.10.1 are released!
...ybody who has already
upgraded to 2.10.
### rspec-mocks-2.10.1
full changelog: http://github.com/rspec/rspec-mocks/compare/v2.10.0...v2.10.1
Bug fixes
* fix [regression of edge case
behavior](https://github.com/rspec/rspec-mocks/issues/132)
* fixed failure of
`object.should_receive(:message).at_least(0).times.and_return value`
* fixed failure of `object.should_not_receive(:message).and_return value`
### rspec-rails-2.10.1
full changelog: http://github.com/rspec/rspec-rails/compare/v2.10.0...v2.10.1
Bug fixes
* fix [regression introduced in 2.10.0 that broke integration with
Devise](https...
2007 May 09
4
UI testing framework? (w/o selenium)
...o.gif"
page.should_have :string, "Copyright 2006-Present SomeCo, Inc. All
rights reserved."
page.should_have :div, :id => ''copyright''
page.should_include :css, ''default.css''
page.should_have.no_broken_links
page.should_have.at_least.3 :div, :class => "bbxBody"
page.should_have.at_most.6 :div, :class => "someClassName"
# page.[name_of_form]_form.
page.search_form.submit :name => "California" do
result.status.should_be :success
result.should_have :image, "logo....
2007 Apr 16
0
Fwd: ANN: FlexMock 0.6.0 Released
...uot;.
* The +should_receive+ method will now allow multiple methods (with the
same
constraints) be defined in a single call. For example, the following
declares that both :read and :write need to be called at least one
time each
on the mock object.
flexmock.should_receive(:read, :write).at_least.once
* +should_recieve+ now will allow expectation hashes as arguments. This
is
similar to the list of methods, but allows each defined method to have
its
own return value.
flexmock.should_receive(:name => "John", :age => 32)
* In addition to using a block for defining...
2009 Jul 08
1
[PATCH: host-browser replacement 0/3] replacement of host-browser on ovirt-server
The purpose of this patch is to replace the identify function in
host-browser.rb with a new script, host-register.rb.
host-register.rb is a qmf ruby console that interfaces with the newly
added matahari qmf agent on the ovirt node. While it stores node data
in the database with the same behavior as the original host-browser
implementation, it acquires the data using the amqp protocol (and
2009 Jul 10
2
[PATCH: server 0/3] Add host-register.rb (replaces host-browser.rb in part)
Removes node identification functionality from host-browser.rb and adds a new script,
host-register.rb, that takes over that functionality.
The chief difference is that host-browser used a simple TCP server setup to get data
from the node, while host-register uses the qpid bus to do so. Specifically, it
communicates with the matahari qmf agent added to the node in two related patchsets to
node
2007 Jul 26
5
Coding standards and whitespace
...le/Snippets/and_raise.tmSnippet
RSpec.tmbundle/Snippets/and_return_block.tmSnippet
RSpec.tmbundle/Snippets/and_return_value.tmSnippet
RSpec.tmbundle/Snippets/and_throw.tmSnippet
RSpec.tmbundle/Snippets/and_yield.tmSnippet
RSpec.tmbundle/Snippets/any_number_of_times.tmSnippet
RSpec.tmbundle/Snippets/at_least.tmSnippet
RSpec.tmbundle/Snippets/at_least_once.tmSnippet
RSpec.tmbundle/Snippets/at_least_twice.tmSnippet
RSpec.tmbundle/Snippets/at_most.tmSnippet
RSpec.tmbundle/Snippets/at_most_once.tmSnippet
RSpec.tmbundle/Snippets/at_most_twice.tmSnippet
RSpec.tmbundle/Snippets/controller_context.tmSnippet
RS...