similar to: any tricks re using " eql(5.5)", but where 5.5 is a decimal not float?

Displaying 20 results from an estimated 2000 matches similar to: "any tricks re using " eql(5.5)", but where 5.5 is a decimal not float?"

2008 Nov 06
8
anyone able to explain logic behind "rake spec" startup (e.g. db:test:prepare => abort_if_pending_migration => invoke environment => etc etc)
anyone able to explain logic behind "rake spec" startup? i.e. the below steps & why things occur when they do Macintosh-2:myequity greg$ rake spec --trace (in /Users/greg/source/myequity) ** Invoke spec (first_time) ** Invoke db:test:prepare (first_time) ** Invoke db:abort_if_pending_migrations (first_time) ** Invoke environment (first_time) ** Execute environment ** Execute
2008 Aug 26
9
stub_model() and ActiveRecord Associations
Hi all, I have what I thought was quite a simple requirement but something to do with the way ActiveRecord''s associations work is making it quite puzzling. I guess I can sum it up with this failing test: before(:each) do @source_comment = @source.comments.create(:user_id => 1) @target_comment = @target.comments.create(:user_id => 1) end
2008 Oct 09
3
should !=
I expected ''should !='' to act the same as ''should_not ==''. That turned out to be incorrect (by design?): require ''spec'' require ''spec/rails'' describe "using ''should !=''" do it "seems to treat != as the same as ==" do 1.should != 1 # passes 1.should != 2 # fails end end
2008 Sep 16
10
autospec is not picking latest changes
Hey Guys. I just updated a project form 1.1.4 that was working with autotest 3.10 without issues: 1) Updated spec/model/project_spec.rb and it fired only that spec. 2) Updated app/model/project.rb and it fired only the matching spec file. After the update of rspec and rspec-rails as plugins a few minutes ago, it only run the controller specs and no other. Also, it doesn''t matter which
2009 Feb 25
4
wrong number of arguments (2 for 1)
The following statement gave me "wrong number of arguments (2 for 1)" and it is the only error. no stack trace. presenter.stub!(:account).and_return account any idea? Thanks Yi -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20090225/8e667eea/attachment.html>
2009 Jan 11
6
Why does ActiveRecord allow perception of success when updating an ID, however it doesn't really work(i.e. no change in database)?
Hi, Why does ActiveRecord allow perception of success when updating an ID, however it doesn''t really work(i.e. no change in database)? Here''s an example. The update of "id" versus update of a non-existent attribute. ?> ai = AccountItem.find(:first) => #<AccountItem id: 1, account_id: 1, date: "2009-01-11", amount:
2006 Sep 04
2
"include" versus "extend" - what's the difference
Hi, Just wondering when one would use "include" over "extend"? Both seem to bring in methods to the class no? The context is I''m just trying to understand why both are used with the acts_as_audited plugin: Full extract from plugin (used within here): ================================================== # Copyright (c) 2006 Brandon Keepers # # Permission is hereby
2008 Jan 19
1
Decimals are being converted to Bigdecimals!!!!!
Hi all, I''m working on a financial app, and have set up some columns in my tables as decimals with precision => 8 and scale => 2. My migration looks like: change_column :lineitems, :price, :decimal, :precision => 8, :scale => 2 change_column :payments, :amount, :decimal, :precision => 8, :scale => 2 I''ve run the migration and restarted the server. I
2007 Dec 03
5
spec for model_id should eql
Hello, I''m confused why the spec described below is failing. Other simple comparison specs are passing fine for the same model. The code is working 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
2008 Nov 04
9
RSpec and PostgreSQL not playing nicely together
Here is a very simple spec: -- require File.expand_path(File.dirname(__FILE__) + ''/../spec_helper'') describe Product, "The Product model" do describe "When a new blank product object gets created" do before(:each) do @product = Product.new end it "should not be valid" do @product.should_not be_valid
2006 Jul 09
6
Float -> BigDecimal
So, I''m personally cool with this change (patch from #5454, applied in [4596]), and I''ll make it work for Oracle tomorrow. But just wondering if folks considered the performance impact of the change? From a simple test it seems that BigDecimal math is about twice as slow as using Floats.
2006 Apr 09
16
Mapping to BigDecimals instead of Floats
Hi everyone, I''m new to Rails and Ruby, and have been working my way through the Pickaxe and Agile Rails books for the last week or so. With a background in payroll apps I found that the default ActiveRecord mapping of decimal columns to float variables really bothered me! Financial calcs need high levels of accuracy and floats just don''t give you that. I know there are a bunch
2009 Feb 03
4
Ruby EE: Problem with BigDecimal
I have a strange problem with my setup of Passenger and Ruby Enterprise Edition. Sometimes the loading of BigDecimals from the database and session fails (silently) and the variable containing the BigDecimal is just empty. I cannot pinpoint where/when/how it happens, and it IS only periodic. I am using the newest versions of both Passenger and REE - I have even tried to run with latest commit
2008 Aug 06
3
hash_excluding/hash_only?
I know there is a hash_including, which is quite useful. Are there by chance any matchers for ensuring a hash includes only the specified values, or that it doesn''t have certain values? Thanks, Steve
2009 Jan 26
4
Mocking/Stubbing ActiveRecord.config.default_timezone
In tracking down a bug in AuthLogic I realized that I had made the same error in one of my libraries. Knowing what the error was made creating a test to expose it (using cucumber) rather trivial. However, it has occurred to me that this sort of issue is far more subtle than I first appreciated. So, I am looking for some opinions on how to test for this sort of thing in a more general sense. At
2008 Feb 22
7
Testing misc methods in ApplicationController
I''m already successfully testing before_filters in application_controller courtesy of this blog post: http://www.movesonrails.com/articles/2008/01/23/spec-ing-your-application-controller However, i can;''t work out how to test the sort of method that is added to application_controller so that all controllers can use it. It must be something simple that i''m doing
2006 Feb 12
9
CSS in Views
How can I link to a CSS file in one of my view files? -- Posted via http://www.ruby-forum.com/.
2007 Dec 01
0
mock feed
Hello generous coders, I''m having difficulty getting a couple of tests to pass. I have an address model which takes an address and with a callback on save and update passes the address to google''s geocoding service. The returned XML is parsed and saved to the address object: protected def geocode_address key = "mykey" url =
2010 Dec 23
36
Weird issue with converting floats to integer
Any idea why this calculates the integer the way it does? irb> ("291.15".to_f * 100.0).to_i => 29114 Thanks, Tom -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to
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 so that an outbound connection could use the combined