[rspec-users] Mocking Rails association collections

2007-07-18 Thread Paul
with ordinary `mock`. I can replace it with `mock_model`, but this feels unclean. Has anyone come across a good 'best-practice' solution to this problem? TIA, Paul Sadauskas ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Mocking Rails association collections

2007-07-18 Thread Paul
e I wanted: @comment = mock_model(Comment) @article = mock_model(Article, :comments => (@comment = assoc_mock(:find => [EMAIL PROTECTED]))) But this works just like the stub!(Foo, :method => return). I might keep mine, though, its a little more explicit as to what the 'in-between'

[rspec-users] spec failing to run specs when spec.opts is present on 1.2.9

2009-10-22 Thread Paul Carey
tiple failures i.e. a spec containing 4 examples produced the following output 3 examples, 3 failures ... 6 examples, 6 failures Both of these issues disappeared when I reverted to 1.2.8. I'll add more to this thread if and when I re-upgrade. Paul ___ r

Re: [rspec-users] spec failing to run specs when spec.opts is present on 1.2.9

2009-10-29 Thread Paul Carey
> Hi Paul > > I use Merb extensively.  Can you post your spec_helper?  I may be able to > help... > > Ashley Hi Ashley Many thanks for your offer. If I create a new merb app (1.0.12) and model and then run rake spec, all is well. However, if I copy its spec_helper into my own

Re: [rspec-users] Returning a StringIO object from a stub

2009-11-11 Thread Paul Hinze
tringIO#readline, but it should do the trick. (2) I would encourage you to consider this: rather than asserting that every line is _read_, simply verify that the result of your Subject#parse method includes data that would _prove_ that each line has been read. That way

Re: [rspec-users] Color output in pagers

2009-12-02 Thread Paul Hinze
I "color" escape sequences are output in > "raw" form. Unlike -r, the screen appearance is maintained correctly > in most cases. You can set default options for less to use via the LESS evironment variable. As an example, here is the value of mine: $

Re: [rspec-users] Color output in pagers

2009-12-02 Thread Paul Hinze
NSIColor.coloring = false if !STDOUT.tty? and not > ENV.has_key?("AUTOTEST") So, we can either feature request an override variable for this line, or perhaps there is a way to trick a program that STDOUT is actually a tty...? Paul __

Re: [rspec-users] New RSpec methods to Object proposal: should_all and should_none

2009-12-09 Thread Paul Hinze
l :qux" (...fix :foo...) "Expected :bar to equal :qux" (...fix :bar...) "Expected :baz to equal :qux" (...realize the _real_ problem is in dependent code that affects all of foo bar and baz, and fix that...) PASS each

[rspec-users] 'Expected NoMethodError, got NameError'

2009-12-30 Thread Paul Hinze
if someone could help me understand I'll happily open up my expectation to should_raise(NameError) and move along. :) Cheers, Paul ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Loading numerous data structures from YAML files

2010-01-04 Thread Paul Hinze
.create_fixtures('test/fixtures', 'roles') Fixtures.create_fixtures('test/fixtures', 'role_members') Fixtures.create_fixtures('test/fixtures', 'rights') Hope this helps! Paul ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Stub activerecord find given instance?

2010-01-24 Thread Paul Hinze
odd, and I'm not sure without more context why this would be happening. My guess is that something else wasn't wired up correctly when you tried to do this. > Hope this clarified, it's not real production code, but it models a > behavior sometimes I actually needed

[rspec-users] Message expectation that verifies result of passed block

2010-01-28 Thread Paul Hinze
specific argument expectation (along the lines of my suggestion) that executes in a context in which it can call the block. Am I missing something obvious here, or does rspec currently not allow for this easily? If not, let's discuss how it should look and I can work on adding feature. Che

Re: [rspec-users] Message expectation that verifies result of passed block

2010-01-28 Thread Paul Hinze
Ashley Moran on 2010-01-28 at 13:28: > > On Jan 28, 2010, at 1:29 pm, Paul Hinze wrote: > > > I believe the lack of ability to use this notation comes down to a ruby > > limitation, but I'm not sure. If that's the case, then we would need a > > specific arg

[rspec-users] Scaling shared behavior (was: Re: Message expectation that verifies result of passed block)

2010-02-02 Thread Paul Hinze
r than behavior. So the question that I pose to you, list, is this: is there any way to change the way we're dealing with this problem to minimize the disadvantages I mentioned above or is the answer "yup, that's pretty much how you would need to set this up"? Thanks again for all your feedback and attention folks, it has been incredibly helpful. Cheers, Paul ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] raise_error suggestion

2010-04-14 Thread Paul Hinze
clear up the potential confusion in this behavior. Less confusion = happier devs Cheers, Paul ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

[rspec-users] Error when trying to run rspec

2010-09-04 Thread Paul Denlinger
from /Users/pdenlinger/.rvm/gems/ruby-1.9.2-p0/bin/spec:19:in `' What do I need to do to make things work? Thanks in advance, Paul Denlinger ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

[rspec-users] Routes are not available in RSpec integration test

2010-10-05 Thread Paul Yoder
My RSpec integration tests do not seem to have access to the rails routes methods. Here's a link to my more descriptive question on stack overflow: http://stackoverflow.com/questions/3847102/routes-are-not-available-in-rspec-integration-test Does anyone know how to fix this? __

Re: [rspec-users] "no such file to load -- sqlite3" error

2010-11-11 Thread Paul Nelligan
Hi Dean it seems that you have sqlite3-ruby installed, but not sqlite3 installed ... 'gem install sqlite3' might fix it ? cheers Paul On Thu, Nov 11, 2010 at 12:49 PM, Dean Richardson wrote: > David: > > Thanks for your help. I've followed the set-up instruction

Re: [rspec-users] Testing update, flash[:error]

2010-11-22 Thread Paul Nelligan
Hi Andrew I suspect that flash[:error] is not a valid identifier, and therefore is returning a nil value. Hope this is of use to you. Paul On Mon, Nov 22, 2010 at 2:00 PM, Andrew Davis wrote: > Hello everyone, > > I'm trying to write a failure test for updating a model, b

Re: [rspec-users] Testing update, flash[:error]

2010-11-22 Thread Paul Nelligan
t a simple case of 'what's accessible in the controller is accessible in the controller spec' (for example) ?, or is it more complicated ? cheers On Mon, Nov 22, 2010 at 9:55 PM, Robert Dober wrote: > On Mon, Nov 22, 2010 at 4:04 PM, Paul Nelligan wrote: > > Hi Andrew &

Re: [rspec-users] [Sinatra] "tried to create Proc object without a block"

2010-12-05 Thread Paul D.
oriented-design-with-ruby/tree/master/chapter_01 README for chapter 1 code: https://github.com/pauldix/service-oriented-design-with-ruby/blob/master/chapter_01/README I'll be updating the other code examples more today and in the coming week. Let me know if there are any issues. Thanks, Pa

Re: [rspec-users] RSpec2 not supported in Netbeans

2010-12-10 Thread Paul Nelligan
Generally I use the command line for testing. Netbeans can be a little flakey. That said, check the config of your project in netbeans. Some of the defaults applied by netbeans aren't always the correct options. sent via Android mobile On 10 Dec 2010 17:11, "George Dinwiddie" wrote: > On 12/

[rspec-users] Functional Tests with custom routes

2011-03-18 Thread Paul H.
Say I have a custom route like this... map.connect 'item/:id/some_action', :controller => 'object', :action => 'change_color', :conditions => {:method => :put} I've been writing my tests like this... describe ObjectController describe "PUT item/:id/some_action" do [...] put :chang

[rspec-users] Skipping callbacks that aren't necessary for what i'm testing

2011-04-13 Thread Paul S.
lback by default for all tests on a model and then re-enable it for specific tests that are testing the geocoding functionality. I'm using Rspec 2.5, Factory Girl and also Shoulda matchers. Any tips greatly received. Paul. -- Posted via http://www.ruby-forum.com/.

Re: [rspec-users] Help to spec a rails helper method that uses content_for

2011-05-24 Thread Paul P.
r with unexpected arguments expected: (:title, "funtitle") got: (:title) # ./app/helpers/application_helper.rb:5:in `title' # ./spec/helpers/application_helper_spec.rb:9:in `block (3 levels) in ' Can you see anything I'm doing wrong? Thanks, Paul -- Po

[rspec-users] Rspec testing (gunfight at coral)

2012-02-10 Thread Paul Fashanu
Can any one give me an explanation on whats going on in this exercise. And any advice on how i should go about it. I dont need any exact codes just yet. But at least a good idea on how to start will be good Thanks Exercise 2: Gunfight at the OK Corral Description Overview This exercise is

[rspec-users] RSpec with devise test helpers

2013-10-16 Thread Paul Ols
I've set my Rails (engine) project to include devise and other tools like FactoryGirl. I'd like to write some tests with contexts around anon/authenticated users. In my spec_helper.rb's RSpec.configure block, I have this: config.include Devise::TestHelpers, type: :controller Which gives me this,

[rspec-users] testing call to super in rails helper

2008-12-09 Thread Ivor Paul
Hi I have the following code: def will_paginate(items, options = {}) options = options.merge(:container => true, :class => 'paging') super(items, options) end I am curious about how to test that the call to super is infact being called with the added options. I have this it 'shou

Re: [rspec-users] testing call to super in rails helper

2008-12-09 Thread Ivor Paul
Thanks Nick the first approach seems the best for my situation. Appreciate the response Ivor On Tue, Dec 9, 2008 at 4:45 PM, Nick Hoffman <[EMAIL PROTECTED]> wrote: > On 2008-12-09, at 06:29, Ivor Paul wrote: > >> Hi >> >> I have the following code: >>

[rspec-users] assigns variable maintaining state across request?

2008-12-10 Thread Ivor Paul
Hi I found that if I set assigns[:variables] in a spec, the value is maintained in subsequent specs. Example rails helper method: def return_at_variable @variable end Specs: #this passes obviously it 'should return true if assigns[:variable] is true' do assigns[:variable] = true

[rspec-users] testing rails mailers

2008-12-11 Thread Ivor Paul
Hi Guys I am trying to spec some rails mailers. The only info I found was this post http://kpumuk.info/ruby-on-rails/testing-mailers-with-rspec/ by Dmytro Shteflyuk. I am hoping there is somewhat more on the topic - could someone point me towards a resource where I can find more? Regards Ivor _

Re: [rspec-users] testing rails mailers

2008-12-14 Thread Ivor Paul
thanks a lot! This looks great. On Sun, Dec 14, 2008 at 4:21 AM, Mischa Fierer wrote: > I found this useful: > http://madhatted.com/2008/7/10/rspec-real-world-testing > > > On Thu, Dec 11, 2008 at 7:42 AM, Ivor Paul wrote: >> >> Hi Guys >> >> I am tryin

Re: [rspec-users] Broken rake tasks

2008-12-17 Thread Ivor Paul
HI Andrew I am getting the same problem. I only get it when I install rspec-rails alongside rspec as gems. Did you get a resolution to this problem? Ivor On Thu, Dec 4, 2008 at 10:54 AM, Andrew Premdas wrote: > I've got a couple of rake tasks that seem to have broken with rspec 1.1.11. > http:

Re: [rspec-users] Broken rake tasks

2008-12-19 Thread Ivor Paul
The latest rspec-rails and rspec worked for me. Are you using the remarkable gem? On Fri, Dec 19, 2008 at 3:08 AM, Andrew Premdas wrote: > No I don't think so. I'll post something when I next try and get the tasks > to work > > 2008/12/17 Ivor Paul > > HI Andrew

[rspec-users] options:229 error

2009-01-06 Thread Ivor Paul
Hi Guys I am really having incredible issues with this error i...@theluggage:~/workspace/talkies$ rake db:migrate (in /home/ivor/workspace/talkies) /usr/lib/ruby/gems/1.8/gems/rspec-1.1.11/lib/spec/runner/options.rb:229:in `files_to_load': File or directory not found: db:migrate (RuntimeError)

Re: [rspec-users] [cucumber] before/after scenarios

2009-01-14 Thread Paul Covell
I don't want to contaminate other features with this particular venue setup (and it will be out of plain sight, which I don't want either). I am still new to BDD so please holler if I'm missing something fundamental. -Paul -- View this me

[rspec-users] question about throw_symbol

2009-08-18 Thread Paul Mylchreest
er limit should throw symbol :over_limit' FAILED expected :over_limit but nothing was thrown ./spec/rspec_tests/rutabaga_spec.rb:125: When the catch is removed, it works. Can anyone reproduce this behavior? thanks Paul Mylchreest paul.mylchre...@mac.com ___

Re: [rspec-users] question about throw_symbol

2009-08-18 Thread Paul Mylchreest
18, 2009 at 12:19 PM, Paul Mylchreest wrote: Given rspec 1.2.8 ruby 1.8.6 (2008-08-11 patchlevel 287) [universal-darwin9.0] And the following spec: def over_limit?(a) catch(:over_limit) do a.each do |x| throw(:over_limit) if x > 10 end end end describe "when ove

Re: [rspec-users] rspec_resource error

2007-07-26 Thread Paul Brackenridge
Cheers, Marcus Ahhh!! Great news. Thanks for that :-) -- Paul Brackenridge -- E - [EMAIL PROTECTED] B - http://paulbrackenridge.com ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyf

[rspec-users] rspec_resource error

2007-07-26 Thread Paul Brackenridge
. Any help would be much appreciated. Thanks, P [1] http://rspec.rubyforge.org/documentation/rails/install.html -- Paul Brackenridge -- E - [EMAIL PROTECTED] B - http://paulbrackenridge.com ___ rspec

[rspec-users] Stubbing a Kernel method?

2007-10-19 Thread Paul Dlug
Is it possible to stub a Kernel method? I'm specifically interested in the 'open' method to test some code using open-uri. I've tried: Kernel.should_receive(:open).with('filename').and_return('data') However, this doesn't seem to work. A

[rspec-users] Autotest just sits there

2008-02-01 Thread Paul Cameron
I have had this problem for a while. autotest has never worked properly for me. I have tried different versions of rspec with different versions of ZenTest. I have tried it with .autotest files and without. When I run autotest from my rails app root, it says: loading autotest/rails_rspec and

Re: [rspec-users] [ANN] RSpec-1.1.3

2008-02-01 Thread Paul Cameron
Nikolay Pavlov wrote: >> http://blog.zenspider.com/archives/2008/01/zentest_version_391_has_been_ >>released.html >> > > WOW. Thanks for quick response. :) > Fixed. > > -- > == > - Best regards, Nikolay Pavlov. <<<---

Re: [rspec-users] Autotest just sits there

2008-02-01 Thread Paul Cameron
Paul Cameron wrote: > I have had this problem for a while. > > autotest has never worked properly for me. I have tried different > versions of rspec with different versions of ZenTest. I have tried it > with .autotest files and without. > > When I run autotest from my ra

[rspec-users] disabling transactional fixtures for one spec

2008-02-23 Thread Paul Dowman
igure { |config| config.use_transactional_fixtures = false } end after(:all) do Spec::Runner.configure { |config| config.use_transactional_fixtures = true } end end ... but that doesn't work. Thanks, Paul ___ rspec-users mailing list rspec-users@rubyforge.org http://r

[rspec-users] Autotest with TDD "test-first" problem

2008-02-23 Thread Paul Dowman
time I'm stuck waiting to see if my next spec will pass or not. Is it possible to change that behavior somehow, so that it doesn't re- run the entire suite every time? Thanks, Paul ___ rspec-users mailing list rspec-users@rubyforge.org http://r

[rspec-users] matchers not working...?

2008-07-01 Thread Ivor Paul
Hi. I am pretty new to rspec so forgive my ignorance. I am getting errors that seem to be the matchers not working - example: vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:478:in `const_missing': uninitialized constant Spec::Rails::Example::ModelExampleGrou

Re: [rspec-users] matchers not working...?

2008-07-02 Thread Ivor Paul
s. Thanks for the help. Ivor On Tue, Jul 1, 2008 at 10:57 PM, David Chelimsky <[EMAIL PROTECTED]> wrote: > On Jul 1, 2008, at 3:48 PM, Ivor Paul wrote: > >> I am getting errors that seem to be the matchers not working - example: >> >> >> vendor/rails/activerec

Re: [rspec-users] matchers not working...? Solved (weird autotest error though)

2008-07-03 Thread Ivor Paul
t for your help so far. Regards Ivor On Wed, Jul 2, 2008 at 2:02 PM, Ivor Paul <[EMAIL PROTECTED]> wrote: > Hi David > > thanks for the response! > This is what the error looks like for be_valid > /activesupport/lib/active_support/dependencies.rb:478:in > `const_missing&#x