Re: [rspec-users] Why can not a BigDecimal be compared to a Float via "==". How should I handle this???

2009-01-11 Thread Greg Hauptmann
ress.com/ (pt-br) | http://blog.codevader.com/ (en) > > > > On Sun, Jan 11, 2009 at 6:33 PM, Greg Hauptmann > wrote: > > it would be nice in one's project if you could basically say "use > > BigDecimal wherever you normally would have used a float", just to

Re: [rspec-users] Why can not a BigDecimal be compared to a Float via "==". How should I handle this???

2009-01-11 Thread Greg Hauptmann
ializer and return a BigDecimal instead? On Mon, Jan 12, 2009 at 4:53 AM, Rick DeNatale wrote: > On Sun, Jan 11, 2009 at 9:21 AM, David Chelimsky wrote: > >> On Sun, Jan 11, 2009 at 4:05 AM, Greg Hauptmann >> wrote: >> > I've gone with the following >> >

Re: [rspec-users] Why can not a BigDecimal be compared to a Float via "==". How should I handle this???

2009-01-11 Thread Greg Hauptmann
t 7:23 PM, Mark Wilden wrote: > On Sun, Jan 11, 2009 at 12:17 AM, Greg Hauptmann < > greg.hauptmann.r...@gmail.com> wrote: > >> >> Any suggestions on how to write an rspec expectation for equality when you >> get a BigDecimal back. I see that "big_decimal_var

[rspec-users] Why can not a BigDecimal be compared to a Float via "==". How should I handle this???

2009-01-11 Thread Greg Hauptmann
Hi, Any suggestions on how to write an rspec expectation for equality when you get a BigDecimal back. I see that "big_decimal_variable.should == 123.23" doesn't work as the ruby BigDecimal comparison (via ==) to the same Float value gives false (not true as you'd expect). For background / as an e

Re: [rspec-users] why does "ruby " work, but "rake spec" give spec errors?

2008-12-23 Thread Greg Hauptmann
@destn_bank.id) but I'm not sure how this would have changed anything. Next time I get this situation I'll have to note what I change. Sure there is no cache or state anywhere in the "spec" mechanics? On Wed, Dec 24, 2008 at 2:01 PM, David Chelimsky wrote: > On Tue, Dec 23

Re: [rspec-users] why does "ruby " work, but "rake spec" give spec errors?

2008-12-23 Thread Greg Hauptmann
PSS. Note sure why, however now it seems "rake spec" is working. Did make some minor changes to the spec but nothing I would have thought that would have solved this...ummm On Wed, Dec 24, 2008 at 11:56 AM, Greg Hauptmann < greg.hauptmann.r...@gmail.com> wrote: > PS. I do c

Re: [rspec-users] why does "ruby " work, but "rake spec" give spec errors?

2008-12-23 Thread Greg Hauptmann
ld_not be_nil . . . On Wed, Dec 24, 2008 at 11:54 AM, Greg Hauptmann < greg.hauptmann.r...@gmail.com> wrote: > Hi, > > Here's an example (below) of the errors I get when I run "rake spec", > however they don't occur when I run "spec ". The issue seems to

Re: [rspec-users] why does "ruby " work, but "rake spec" give spec errors?

2008-12-23 Thread Greg Hauptmann
ir.save! end thanks On Wed, Dec 24, 2008 at 11:33 AM, David Chelimsky wrote: > On Tue, Dec 23, 2008 at 8:29 PM, Greg Hauptmann > wrote: > > Hi, > > > > Does anyone know why I would have some spec's failing when using > > "./script/autospec" or &quo

[rspec-users] how can I run a spec in DEBUG mode (e.g. like rdebug )

2008-12-23 Thread Greg Hauptmann
Hi, Is there a way to run a spec in debug mode (using rdebug) so I can use breakpoints in my spec code? I ask this noting I've got some differences in specs passing/failing depending on whether I run the spec via "ruby " as opposed to "rake spec". (raised in separate thread) thanks

[rspec-users] why does "ruby " work, but "rake spec" give spec errors?

2008-12-23 Thread Greg Hauptmann
Hi, Does anyone know why I would have some spec's failing when using "./script/autospec" or "rake spec", however when I just run them using "ruby " it passes ok"? What's the difference in kicking off a spec by these different means? Only thing that comes to mind is perhaps using "ruby " is mayb

Re: [rspec-users] what triggers "./script/autospec" to kick in? when I change my model it doesn't always retest

2008-11-11 Thread Greg Hauptmann
thanks - this seemed to fix it wonder why it was working for the first time run (i.e. tests were working) but just not re-triggering? just the way autotest works I guess On Wed, Nov 12, 2008 at 11:22 AM, Mark Wilden <[EMAIL PROTECTED]> wrote: > On Tue, Nov 11, 2008 at 5:01 PM, Greg

Re: [rspec-users] what triggers "./script/autospec" to kick in? when I change my model it doesn't always retest

2008-11-11 Thread Greg Hauptmann
wrote: > On Tue, Nov 11, 2008 at 5:16 PM, Greg Hauptmann > <[EMAIL PROTECTED]> wrote: >> Hi, >> >> Does anyone know what exactly trigger autospec to rerun tests? >> >> I ask as I have a model file that has spec tests > > Please don't say "spec

[rspec-users] what triggers "./script/autospec" to kick in? when I change my model it doesn't always retest

2008-11-11 Thread Greg Hauptmann
Hi, Does anyone know what exactly trigger autospec to rerun tests? I ask as I have a model file that has spec tests for it, but I've noticed when I fix the line in the model file it's not automatically retriggering a retest (where I'd expect to see a pass whereas before it was a fail). If I clos

Re: [rspec-users] any way to have a different SOUND from growl for a 'pass' rather than a 'fail' when using "./script/autospec" ???

2008-11-11 Thread Greg Hauptmann
ails. I > use different voices depending on the results :) > http://gist.github.com/23649 > > On Sat, Nov 8, 2008 at 12:37 PM, Greg Hauptmann > <[EMAIL PROTECTED]> wrote: >> >> Hi, >> >> Is there any way to have a

Re: [rspec-users] any way to have a different SOUND from growl for a 'pass' rather than a 'fail' when using "./script/autospec" ???

2008-11-10 Thread Greg Hauptmann
Mac uses the built in speech stuff to say what > happens at the end of an autotest run. So, it tells me things like "all > tests passed", or "tests passed" (depends on whether or not it ran the full > suite, or just a changed file/spec), "some pending", and

Re: [rspec-users] any tricks re using " eql(5.5)", but where 5.5 is a decimal not float?

2008-11-09 Thread Greg Hauptmann
Ashley - what's you're recommendation re using BigDecimal (which does work as you point out) and the Money gem (which it sounds like makes a dev's life a bit easier)??? Is it worth trying to port an application from use of BigDecimal to Money gem??? On Sun, Nov 9, 2008 at 10:27 PM, Ashley Moran <

[rspec-users] any way to have a different SOUND from growl for a 'pass' rather than a 'fail' when using "./script/autospec" ???

2008-11-08 Thread Greg Hauptmann
Hi, Is there any way to have a different SOUND from growl for a 'pass' rather than a 'fail' when using "./script/autospec" ??? thanks ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] any tricks re using " eql(5.5)", but where 5.5 is a decimal not float?

2008-11-07 Thread Greg Hauptmann
;== NEEDED TO USE BigDecimal here end On Sat, Nov 8, 2008 at 3:37 PM, Greg Hauptmann <[EMAIL PROTECTED]> wrote: > thanks Pat - yes I missed it when reading your email - I'd been using > ".eql" for everythingthanks > > On Sat, Nov 8, 2008 at 2:10 PM, Pat

Re: [rspec-users] any tricks re using " eql(5.5)", but where 5.5 is a decimal not float?

2008-11-07 Thread Greg Hauptmann
thanks Pat - yes I missed it when reading your email - I'd been using ".eql" for everythingthanks On Sat, Nov 8, 2008 at 2:10 PM, Pat Maddox <[EMAIL PROTECTED]> wrote: > "Greg Hauptmann" <[EMAIL PROTECTED]> writes: > >> in fact I guess I

Re: [rspec-users] any tricks re using " eql(5.5)", but where 5.5 is a decimal not float?

2008-11-07 Thread Greg Hauptmann
yep - this was recommended on forums over float - why? On Sat, Nov 8, 2008 at 11:48 AM, Zach Dennis <[EMAIL PROTECTED]> wrote: > On Fri, Nov 7, 2008 at 6:24 PM, Greg Hauptmann > <[EMAIL PROTECTED]> wrote: >> (woops - full email below) >> >> Hi, >> &g

Re: [rspec-users] any tricks re using " eql(5.5)", but where 5.5 is a decimal not float?

2008-11-07 Thread Greg Hauptmann
in fact I guess I was fishing for an easier way than this...if one exists? or is ruby & rspec "eql()" just strict here in terms of types? On 11/7/08, Mark Wilden <[EMAIL PROTECTED]> wrote: > On Fri, Nov 7, 2008 at 3:24 PM, Greg Hauptmann < > [EMAIL PROTECTED]>

Re: [rspec-users] any tricks re using " eql(5.5)", but where 5.5 is a decimal not float?

2008-11-07 Thread Greg Hauptmann
5, got # (using .eql?) What's the best way of addressing this? Is there trick regarding the easiest way to address this? Thanks On Sat, Nov 8, 2008 at 9:18 AM, Greg Hauptmann <[EMAIL PROTECTED]> wrote: > -- > Sent from my mobile device >

[rspec-users] any tricks re using " eql(5.5)", but where 5.5 is a decimal not float?

2008-11-07 Thread Greg Hauptmann
-- Sent from my mobile device ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] rspec gem vs "rspec plugin" vs "rspec-rails plugin" ???

2008-11-07 Thread Greg Hauptmann
oh, I hadn't known there was a "rspec-rails" gem. Thanks On 11/7/08, Fernando Perez <[EMAIL PROTECTED]> wrote: > Greg Hauptmann wrote: >> Hi, >> >> I've got the rspec gem installed, as well as the two plugins "rspec" & >> &q

Re: [rspec-users] rspec gem vs "rspec plugin" vs "rspec-rails plugin" ???

2008-11-07 Thread Greg Hauptmann
10 PM, Fernando Perez <[EMAIL PROTECTED]> wrote: > Greg Hauptmann wrote: >> Hi, >> >> I've got the rspec gem installed, as well as the two plugins "rspec" & >> "rspec-rails". I can't remember which is actual used and which isn&#x

[rspec-users] rspec gem vs "rspec plugin" vs "rspec-rails plugin" ???

2008-11-07 Thread Greg Hauptmann
Hi, I've got the rspec gem installed, as well as the two plugins "rspec" & "rspec-rails". I can't remember which is actual used and which isn't for my rails app when I go "rake spec"? Anyone know? Could I remove either of the core rpec gem OR the "rspec plugin"? or do I need all three componen

Re: [rspec-users] anyone able to explain logic behind "rake spec" startup (e.g. db:test:prepare => abort_if_pending_migration => invoke environment => etc etc)

2008-11-06 Thread Greg Hauptmann
i run "rake spec --trace" On 11/6/08, Greg Hauptmann <[EMAIL PROTECTED]> wrote: > 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

Re: [rspec-users] anyone able to explain logic behind "rake spec" startup (e.g. db:test:prepare => abort_if_pending_migration => invoke environment => etc etc)

2008-11-06 Thread Greg Hauptmann
I'm still a bit confused - I'll try to be more specific in questions: * rake db:test:prepare - Check for pending migrations and load the test schema ==> Q1. DOES NOT RUN IN PENDING MIGRATIONS TO TEST DATABASE? ==> Q2. RE TEST SCHEMA - ARE THE MIGRATIONS USE TO CREATE THE DATABASE OR THE DEVELO

Re: [rspec-users] When is spec_helper.rb actually executed?

2008-11-06 Thread Greg Hauptmann
can someone advise how best to handle the situation where I want to keep (i.e. not have deleted) my configuration intact? Perhaps seed it in environment/test.rb - but how do I get a normal rails line of code to run in the "test.rb" file (i.e. only for when starting up in test mode)? I get "ActiveRe

[rspec-users] anyone able to explain logic behind "rake spec" startup (e.g. db:test:prepare => abort_if_pending_migration => invoke environment => etc etc)

2008-11-06 Thread Greg Hauptmann
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 (f

Re: [rspec-users] how to avoid tests removing data that my migrations put in?

2008-11-05 Thread Greg Hauptmann
how to I get a model statement to run within "test.rb" by the way? For example to get the following to run: RecurringType.create(:name => "TYPE_BASIC") If I just stick this in I get: extract-- Macintosh-2:myequity greg$ rake spec (in /Users/greg/source/m

Re: [rspec-users] how to avoid tests removing data that my migrations put in?

2008-11-04 Thread Greg Hauptmann
so is the concept to build up all seed data creation in one place/method, & then for the rake spec case run this in via the "test" environment.rb file? But then if you were to use rake:migrate to drop back a couple of version you might be in a spot of bother? (ie newest seed data not then tied to

[rspec-users] how to avoid tests removing data that my migrations put in?

2008-11-04 Thread Greg Hauptmann
hi, I have an issue in that I have some reference data my migrations run in. However when running "rake spec" it seems to remove the data in the test database up front. What do you recommend to workaround this issue? Thanks Greg ___ rspec-users mailin

Re: [rspec-users] can I get more details in the "rake spec" output (e.g. for eql fail, what was the actual value that was returned)???

2008-10-06 Thread Greg Hauptmann
u'll see > detailed failure messages including backtraces. > > Pat > > > "Greg Hauptmann" <[EMAIL PROTECTED]> writes: > > > Hi, > > > > Can I get more details in the "rake spec" output (e.g. for eql fail, what > was the actual

[rspec-users] can I get more details in the "rake spec" output (e.g. for eql fail, what was the actual value that was returned)???

2008-10-06 Thread Greg Hauptmann
Hi, Can I get more details in the "rake spec" output (e.g. for eql fail, what was the actual value that was returned)??? Another example might be what the exception actually is in a case the "should not raise exception" fails... Regards Greg ___ rspec-u

Re: [rspec-users] would I stub an existing class method out or use fixtures in this scenario?

2008-10-05 Thread Greg Hauptmann
Hi guys, I'll try to put some clarifying comments here re my question: (a) "any_instance.stubs" - this already exists in Mocha (http://mocha.rubyforge.org/classes/Class.html#M01) (b) where I had "do people normal use the "any_instance.stubs" approach to stub out existing classes already deve

[rspec-users] would I stub an existing class method out or use fixtures in this scenario?

2008-10-05 Thread Greg Hauptmann
Hi, Would the BDD experts recommend I either (a) use fixtures for data or (b) stub out existing class methods for such a scenario? Scenario = Working on a "populate for future transactions" method & testing this. It generates "transactions" table rows as part of the test. To do this it (a) requ

Re: [rspec-users] rake does recognize "rake examples_with_rcov"

2008-09-13 Thread Greg Hauptmann
thanks - oh dear, I'm seeing a lot of red in the rcov reports :) On Sun, Sep 14, 2008 at 7:42 AM, Pat Maddox <[EMAIL PROTECTED]> wrote: > On Sat, Sep 13, 2008 at 4:47 PM, Greg Hauptmann > <[EMAIL PROTECTED]> wrote: >> re "ry looking in the 'coverage&

Re: [rspec-users] rake does recognize "rake examples_with_rcov"

2008-09-13 Thread Greg Hauptmann
re "ry looking in the 'coverage' folder" => Wow! Great stuff. Is there a way to automatically launch a browser to the index page after running "rake spec:rcov" Tks On Sun, Sep 14, 2008 at 12:34 AM, Matt Wynne <[EMAIL PROTECTED]> wrote: > On 13 Sep 200

[rspec-users] rake does recognize "rake examples_with_rcov"

2008-09-13 Thread Greg Hauptmann
Hi, Q1 - Know why rake doesn't recognize "rake examples_with_rcov" per http://rspec.info/documentation/tools/rcov.html ? Q2 - Also when I run "rake spec:rcov" it seems to give me the same as if I just run "autotest" or "rake spec". I was expecting a heap of pointers to code I haven't tested? ==

[rspec-users] Growl notifications don't work each time??

2008-09-11 Thread Greg Hauptmann
Hi - has anyone had problems with Growl notifications not working each time? I can hit save on a test, wait, check. Then hit save again, wait, check. Sometimes the growl notification doesn't work. I'm using ZenTest / Rspec. * ZenTest (3.10.0) * Macintosh-2:myequity greg$ ruby -v ruby 1.8.6 (200

Re: [rspec-users] Failing in TextMate but not in rake...

2008-09-06 Thread Greg Hauptmann
in the menu at the > bottom of your spec file set to "RSpec"? That does affect which > keyboard shortcuts are active. > > Ed > > On Sep 6, 2:45 pm, "Greg Hauptmann" <[EMAIL PROTECTED]> > wrote: >> thanks Ed, I too can now see the nice colored output

Re: [rspec-users] Failing in TextMate but not in rake...

2008-09-06 Thread Greg Hauptmann
thanks Ed, I too can now see the nice colored output summary for rspec in textmate, however... What is weird is the following. Any ideas? [A] - MENU BEHAVE DIFFERENTLY TO THE KEYBOARD SHORTCUTS: When I: (a) Run the rspec commands via the TextMate menu using my mouse, e.g. Bundle => RSpec => Run

Re: [rspec-users] Failing in TextMate but not in rake...

2008-09-05 Thread Greg Hauptmann
I'm getting the same error & also trying to work this out. Any advice welcomed -- Posted via http://www.ruby-forum.com/. ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] do I use mocking (vs fixtures) for methods that produce results based on non-trivial SQL queries

2008-09-05 Thread Greg Hauptmann
Ben - I like your suggestion, thanks. I'll start trying to structure some of my tests around this concept until there's a better way. Mark - I'm curious to understand what you actually do re "I personally do not use fixtures because my model specs usually don't use a "typical" data set. I'll crea

[rspec-users] do I use mocking (vs fixtures) for methods that produce results based on non-trivial SQL queries

2008-09-05 Thread Greg Hauptmann
Hi, In cases where I have model methods that are generating data based on non-trivial SQL queries to a database (e.g. to pull together data required to plot an appropriate graph), does this really require a traditional fixture (i.e. pre-canned test data) as opposed to use of mocks? That is, the b

Re: [rspec-users] is there a way to create spec tests (including directories) for an existing set of models/controllers?>>

2008-09-05 Thread Greg Hauptmann
thanks Ben - this works nicely On Fri, Sep 5, 2008 at 4:18 PM, Ben Mabey <[EMAIL PROTECTED]> wrote: > Greg Hauptmann wrote: >> Hi, >> >> is there a way to create spec tests (including directories) for an >> existing set of models/controllers? (i.e. as oppose

[rspec-users] is there a way to create spec tests (including directories) for an existing set of models/controllers?>>

2008-09-04 Thread Greg Hauptmann
Hi, is there a way to create spec tests (including directories) for an existing set of models/controllers? (i.e. as opposed to the generate options that rspec provides when you are creating models/controllers etc to start with) Tks ___ rspec-users mai

[rspec-users] RSpec sundry questions

2008-09-02 Thread Greg Hauptmann
Hi, Q1 - Can I assume that the core testing framework (e.g. rails unit testing versus RSpec) is a kind of separate issue to whether you using mocking or not? i.e. you could use Mocha with either the rails unit test framework or Rspec? Or is there something in Rspec that integrates moreso with mock