Displaying 20 results from an estimated 112 matches for "eql".
Did you mean:
eq
2008 Nov 07
15
any tricks re using " eql(5.5)", but where 5.5 is a decimal not float?
--
Sent from my mobile device
2007 Dec 03
5
spec for model_id should eql
...accordingly when I test it through the console, I''m just having difficulty
getting this spec to work. Any pointers would be appreciated.
Failure message:
''Address fetch and geocode should extract department and write to address
object'' FAILED
expected 3, got nil (using .eql?)
This spec that is failing:
@address.department_id.should eql(3)
before:
before do
@address = Address.new
@address.attributes = valid_address_attributes
@address.save
@department = mock_model(Department)
@department.stub!(:find_by_code).with("75").and_return("...
2007 May 15
3
NOOB question RSPEC
Hi all !!
I have this code:
require ''account''
describe Account, "when first created" do
before do
@account = Account.new
end
it "should have a balance of $0" do
@account.balance.should eql(Money.new(0, :dollars))
end
after do
@account = nil
end
end
How can I pass the @account.balance.should eql(Money.new(0, :dollars))
spec. From my understanding you .eql? in ruby is true if the object
are the same (reference points to same object) or if one inherits the
other.
I thought...
2007 Jan 24
0
Are There better EQL devices
I have set up one of our routers to use a TEQL Device to direct the
outbound traffic but I would like to have a bit more control with how it
sends out traffic. Is there a "better" EQL device that would allow me
to say set the rate of the connections and have it fill up the first
pipe then dump to the second then the third and so on s...
2008 Feb 22
7
Testing misc methods in ApplicationController
...eg if i have this empty method in application_controller
def andreplace(str)
end
and my spec looks like this:
describe ApplicationController do
describe "andreplace(str)" do
it "should format ands for ferret search" do
andreplace("foo and bar").should eql("+foo +bar")
end
end
end
Currently, the test breaks, saying:
NoMethodError in ''ApplicationController andreplace(str) should format ands
for ferret search''
undefined method `andreplace'' for
#<Spec::Rails::Example::ControllerExampleGroup::Subclass_1::Su...
2001 Oct 31
2
removing duplicated rows from a data.frame
Dear all,
Sorry for the simplicity of the question, but how does one go about removing duplicated rows in a data.frame?
I'm looking for a quick and simple solution, as my data.frames are relatively large (50000 by 50). I've racked my brain and searched the help files and found nothing useful or quick, only duplicated() and unique() which work only work on lists.
Thanks
Gary.
2010 Apr 14
5
Model Magic
>> [].eql? @product.files
=> false
>> @product.files.eql? []
=> true
version: 2.3.5
Product :has_many files
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3M...
2007 Sep 05
4
False Positives and Autotest on New Folders
False Positives
I just discovered how easy it was to create a false positive when I, trying
my first RSpec test, did this:
ob.should eql?(''foo'')
instead of:
ob.should eql(''foo'')
or:
ob.should == ''foo''
As far as I can see, this is roughly equivalent to:
ob.should false
Neither eql?(''foo'') nor false causes the spec to fail; this is worrisome, as
I can im...
2008 Mar 19
2
Stub / Mock - A little guidance?
...;should update billing information when User''s billing info is nil" do
@user.should_receive(:update_billing_info).with(@order_payment_info)
@user.update_billing_info(@order_payment_info)
@user.stub!(:has_billing_address?).and_return(false)
@user.bill_to_address1.should eql("555 Rd.")
@user.bill_to_address2.should eql("Ste 2")
end
end
When I run this spec I get an "error" of:
1)
''User when checking billing information should update billing
information when User''s billing info is nil'' FAILED
expected &qu...
2007 May 17
8
Model: self is not child's parent
Assume a model Parent and another model Child. Child belongs_to Parent
and Parent has_many Children. The following fails:
@
p = Parent.find(:first)
assert p.equal?(p.children[0].parent)
@
It seems odd to me that I and my child''s parent are not the same object.
In fact, this is royally screwing me up. Can anyone tell me why this is
or point me at a relevant discussion, blog posting,
2009 Jul 06
3
Speed up code, profiling, optimization, lapply vs. loops
High everybody,
currently I'm writinig a package that, for a given family of variance
functions depending on a parameter theta, say, computes the extended
quasi likelihood (eql) function for different values of theta.
The computation involves a couple of calls of the 'glm' routine. What
I'm doing now is to call 'lapply' for a list of theta values and a
function, that constructs a family object for the particular choice of
theta, computes the glm an...
2011 Apr 06
2
XCP - license expiry problem - http://bugzilla.xensource.com/bugzilla/show_bug.cgi?id=1756 not fixed?
...e diagnostic-license-status
Hostname UUID Features
Code Free Expiry
Days left
- - -
- - -
-
xcp1.domain.com 402f07f4 VLAN QoS SStorage NTAP EQL Pool XHA MTC email
perf WLB RBAC DMC chpt DVSC Mask Cnx Plat nonag VMPR FREE true
20110406T12:00:00Z -0.1
xcp2.domain.com ede2ac8b VLAN QoS SStorage NTAP EQL Pool XHA MTC email
perf WLB RBAC DMC chpt DVSC Mask Cnx Plat nonag VMPR FREE true
20110406T16:00:00Z 0.1
xcp3.domain.com f4b8ed15 VLAN Qo...
2007 Dec 01
0
mock feed
............
describe Address, "fetch and geocode" do
include AddressSpecHelper
before do
@address = Address.new
mock_feed
@address.attributes = valid_address_attributes
@address.save
end
it "should populate town and address 1" do
@address.town.should eql("Paris")
@address.address_1.should eql("71, Avenue Parmentier")
end
it "should populate lat and lng as BigDecimals" do
@address.lat.should eql(BigDecimal("2.375258"))
@address.lng.should eql(BigDecimal("48.864315"))
end
end
My tw...
2006 Jun 27
5
Can''t call public application.rb method from ERb template
...n the current controller action.
In my ERb template, I have
<DIV class="<%= get_menu_display_style(''login_form'') %>">
In application.rb, I have the method get_menu_display_style defined as:
public
def get_menu_display_style(action_requested)
action_name.eql(action_requested) ? ''left_nav_button_selected'' :
''left_nav_button''
end
But when I go to my initial page, I get
undefined method `get_menu_display_style'' for
#<#<Class:0x37272b0>:0x3727220>
I''m confused. I figured that I would h...
2008 Mar 19
3
ApplicationHelper
..., 0, colors.collect{|color| color[1]})
...
%>
So to test the distribute method in ApplicationHelper, I have to extend my
spec models:
describe ApplicationHelper do
extend(ApplicationHelper)
it "doesn''t find what it''s looking for do
distribute(1,2,3,[4,5,6]).should eql([1,2,3])
end
end
This could use some documentation.
--
View this message in context: http://www.nabble.com/ApplicationHelper-tp16149622p16149622.html
Sent from the rspec-users mailing list archive at Nabble.com.
2008 Aug 20
2
Re: Stubbing out ThinkingSphinx for Rspec
...day, they were doing this;
# Controller action:
term = "*#{params[:search]}*"
ThinkingSphinx::Search(term, :with => { :searchable => 1 } })
# RSpec example:
it "should build query" do
ThinkingSphinx::Search.should_receive(:search) do |term,conditions|
term.should eql(''*keyword*'')
conditions[:with][:searchable].should eql(1)
end
get :show, :search => ''keyword''
end
But I''m on the latest version of the plugin, and it looks like this;
# Controller action:
def index
@site_pages = SitePage.search params...
2007 Oct 05
7
Easy AR association stubbing
I''ve added a method to the mock class that makes it pretty easy to
stub associations in rails. I''ve been using it for awhile and it seems
to cut down on a lot of setup code for the controller and model specs
that use associations.
#before
@person = mock_model(Person)
posts = mock(''post_proxy'')
posts.stub!(:build).and_return(mock_model(Post, :save => true))
2006 Nov 21
5
acts_as_ferret with STI models
Can acts_as_ferret search only one of the inherit models in the
hierarchy of STI models? Say you have Contents, with types articles and
comments. I know that you do Contents.find_by_contents, but can you
also create indexed for Comment and Articles?
Thanks for you help
Miguel
--
Posted via http://www.ruby-forum.com/.
2009 Aug 10
2
testing exception notification plugin with rspec
...''test''
ActionMailer::Base.perform_deliveries = false
ActionMailer::Base.deliveries = []
@size_before = ActionMailer::Base.deliveries.count
lambda { get ''dummy_method_raises_exception'' }.should raise_error
(RuntimeError)
ActionMailer::Base.deliveries.count.should eql(@size_before + 1) <====
here I got 0 and not 1
Does someone have an idea about this problem?
Thank you by advance
-Yoann
2007 Oct 01
15
how to spec views
...t partials depending on authentication of the user:
annon, admin, player
So I I''ll write if conditionals in the view with the partials
it "should render signup propaganda for annon users trying to view games"
do
render "/games/index.rhtml"
@logged_in?.should eql(false)
response.should render_template(''_signup_propaganda'')
end
Now for my partial I know it''ll be wrapped all in a div with a
class="signup_propaganda"
Should I be testing for that instead? Can I write expectations for partials
similar to above?
When y...