Re: [rspec-users] Evaluating shared example customisation block before shared block

2010-08-02 Thread David Chelimsky
On Aug 1, 2010, at 10:08 PM, Myron Marston wrote: OK, I tried to implement #module_exec on ruby 1.8.6, and here's what I came up with: http://github.com/myronmarston/rspec-core/commit/364f20ebd5b7d9612227cb6e86a6e8c8c2e9931e It works (at least in the sense that it allows the specs and

Re: [rspec-users] migration question

2010-08-02 Thread David Chelimsky
On Aug 2, 2010, at 8:09 AM, David Chelimsky wrote: On Aug 2, 2010, at 7:46 AM, rogerdpack wrote: Got this: no such file to load -- spec/rake/spectask anybody know off hand what the equivalent is for rspec2? rspec/core/rake_task I'll add that to Upgrade.markdown http

Re: [rspec-users] migration question

2010-08-02 Thread David Chelimsky
On Aug 2, 2010, at 7:46 AM, rogerdpack wrote: Got this: no such file to load -- spec/rake/spectask anybody know off hand what the equivalent is for rspec2? rspec/core/rake_task I'll add that to Upgrade.markdown -r ___ rspec-users mailing

Re: [rspec-users] Evaluating shared example customisation block before shared block

2010-08-01 Thread David Chelimsky
On Aug 1, 2010, at 9:43 AM, David Chelimsky wrote: On Jul 31, 2010, at 1:06 PM, Myron Marston wrote: You can still get the same outcome, but you have to implement it in the group like this: unless defined?(:foo) def foo; foo; end end Good point--I hadn't thought of that. The one

Re: [rspec-users] Evaluating shared example customisation block before shared block

2010-08-01 Thread David Chelimsky
the customization block to define methods, hooks (before/after) and let(). Now it just feels like the rest of RSpec. Thoughts? Myron On Jul 31, 12:56 am, Ashley Moran ashley.mo...@patchspace.co.uk wrote: On 31 Jul 2010, at 1:10 AM, David Chelimsky wrote: You can still get the same outcome

Re: [rspec-users] Evaluating shared example customisation block before shared block

2010-08-01 Thread David Chelimsky
On Aug 1, 2010, at 11:40 AM, Myron Marston wrote: The particular issue of simple values being used in the docstrings and the examples themselves (i.e. exposed to everything in the block scope) could be handled like this: shared_examples_for blah do |a,b| ... end

Re: [rspec-users] Evaluating shared example customisation block before shared block

2010-08-01 Thread David Chelimsky
On Aug 1, 2010, at 5:39 PM, Myron Marston wrote: Seems like your mental model is that of a customization block being a subclass or re-opening of the shared block. What you say makes sense in that model, but that's not the same model I have. My mental model is indeed that the customization

Re: [rspec-users] Evaluating shared example customisation block before shared block

2010-08-01 Thread David Chelimsky
On Aug 1, 2010, at 5:12 PM, Ashley Moran wrote: On 1 Aug 2010, at 3:43 PM, David Chelimsky wrote: shared_examples_for blah do |a,b| ... end it_should_behave_like blah, 1, 2 That wouldn't have worked with the old implementation, but it would work perfectly well now. This would

Re: [rspec-users] how to fix 'rake gems:refresh_specs' gems has no specificati

2010-07-30 Thread David Chelimsky
On Jul 30, 2010, at 2:03 AM, Amit Jain wrote: David Chelimsky wrote: On Jul 29, 2010, at 6:37 AM, Amit Jain wrote: and ~/mygreatapp/ $ ./script/plugin install svn://rubyforge.org/var/svn/rspec/tags/REL_X_Y_Z/vendor/rspec_on_rails/vendor/plugins/rspec rspec_on_rails is 2 years old

Re: [rspec-users] how to fix 'rake gems:refresh_specs' gems has no specificati

2010-07-30 Thread David Chelimsky
On Jul 30, 2010, at 7:47 AM, Amit Jain wrote: David Chelimsky wrote: On Jul 30, 2010, at 6:52 AM, Amit Jain wrote: from /usr/lib/ruby/gems/1.8/gems/rcov-0.9.8/bin/rcov:511 config.gem rspec-rails, :version = = 1.3.2 OK - so the problem now is that you've got rspec-rails

Re: [rspec-users] proposition: warn on rake spec - group :test

2010-07-30 Thread David Chelimsky
On Jul 30, 2010, at 3:09 AM, Rainer Kuhn wrote: On Jul 29, 3:29 pm, David Chelimsky dchelim...@gmail.com wrote: On Jul 27, 2010, at 7:29 AM, Rainer Kuhn wrote: Consider putting out some information on rake spec, when rspec ist only defined in the :test group. This just cost me an hour until

Re: [rspec-users] Evaluating shared example customisation block before shared block

2010-07-30 Thread David Chelimsky
On Jul 30, 2010, at 9:03 AM, David Chelimsky wrote: On Jul 30, 2010, at 5:13 AM, Ashley Moran wrote: Hi I finally looked into why this is not currently possibly in RSpec 2 (beta 19): shared_examples_for Etymology do describe The etymology of foo do it is followed

Re: [rspec-users] Evaluating shared example customisation block before shared block

2010-07-30 Thread David Chelimsky
On Jul 30, 2010, at 10:57 AM, Ashley Moran wrote: On Jul 30, 2010, at 3:10 pm, David Chelimsky wrote: Maybe that, or a DSL that wraps that, is the better way, so we can get the best of both worlds? shared_examples_for Enumerable do require_instance_method :foo, gotta have foo

Re: [rspec-users] Evaluating shared example customisation block before shared block

2010-07-30 Thread David Chelimsky
On Jul 30, 2010, at 6:56 PM, Myron Marston wrote: On Jul 30, 2:58 pm, Ashley Moran ashley.mo...@patchspace.co.uk wrote: On 30 Jul 2010, at 5:00 PM, David Chelimsky wrote: By all means. I've started on that and filed a ticket[1]. One question I have, is I keep calling the Example Group

Re: [rspec-users] how to fix 'rake gems:refresh_specs' gems has no specificati

2010-07-29 Thread David Chelimsky
On Jul 29, 2010, at 5:19 AM, Amit Jain wrote: Hello, I recently unpacked the latest rspec and rspec rails in my applicaiton. How did you unpack them (what command did you use)? When I run my specs I get: $ rcov user_spec.rb Where are you typing this command? What happens when you type

Re: [rspec-users] Gem post-install messages

2010-07-29 Thread David Chelimsky
On Jul 27, 2010, at 1:45 AM, Mislav Marohnić wrote: When you install the rspec-rails stack, the rspec gem post-install messages take more than 60 lines in total. Most of those messages are something uninformative like thank you for installing the rspec-blah. Um, OK. You're welcome, I

Re: [rspec-users] proposition: warn on rake spec - group :test

2010-07-29 Thread David Chelimsky
On Jul 27, 2010, at 7:29 AM, Rainer Kuhn wrote: Consider putting out some information on rake spec, when rspec ist only defined in the :test group. This just cost me an hour until I read the blog post explaining it. Thing is, rake spec doesn't show on rake -T but it runs fine, just not

Re: [rspec-users] should_receive break the method chain?

2010-07-29 Thread David Chelimsky
On Jul 29, 2010, at 7:46 AM, Zhenning Guan wrote: class A def process @b.calculate end end it 'should change b calculate value' do @b.should_receive(:calculate) @a.process @b.calculae_value.should == 'after_calculae' end it will fail, if I comment out

Re: [rspec-users] Testing controller and action with parameters

2010-07-29 Thread David Chelimsky
On Jul 29, 2010, at 8:37 AM, Anderson Leite wrote: I have an action and I am testing it like this: The action: == def create @event = Evento.new(params[:event]) @event.aproved = false if @event.save redirect_to :action = index else render :action = new

Re: [rspec-users] how to fix 'rake gems:refresh_specs' gems has no specificati

2010-07-29 Thread David Chelimsky
On Jul 29, 2010, at 6:37 AM, Amit Jain wrote: David Chelimsky wrote: On Jul 29, 2010, at 5:19 AM, Amit Jain wrote: Hello, I recently unpacked the latest rspec and rspec rails in my applicaiton. How did you unpack them (what command did you use)? I just install rspec gem through

Re: [rspec-users] about spec.opts and command line options and global options

2010-07-28 Thread David Chelimsky
On Jul 28, 2010, at 1:52 PM, Jarmo Pertman wrote: Hello! I have some questions/proposals which have been quite time on my mind already. Let's suppose i have files under spec directory with the following structure and contents: # spec/helper.rb module Helper end # spec/my_spec.rb

Re: [rspec-users] rspec 1 - nested examples (in an each block) use the final block variable 4 times instead of each of the 4 once

2010-07-28 Thread David Chelimsky
On Jul 28, 2010, at 5:42 PM, nruth wrote: Please correct me if this is fixed in Rspec 2, but in Rspec 1 I have hit upon the following problem (at least thrice, this time it costing me several hours), code is the best example: I have a practice examination system where each record is one of

Re: [rspec-users] Problem running RSpec tests with Rails

2010-07-27 Thread David Chelimsky
On Jul 27, 2010, at 4:10 AM, Bruno Cardoso wrote: David Chelimsky wrote: On Jul 26, 2010, at 12:36 PM, Bruno Cardoso wrote: Thanks for the answers. What both solutions (from Ashley and David) do is not modify the BD in anyway, so nothing gets dropped and nothing is created

Re: [rspec-users] [newbie] rspec, validations and factory_girl

2010-07-26 Thread David Chelimsky
On Jul 26, 2010, at 11:34 AM, Lille wrote: Hi, class B ActiveRecord::Base belongs_to :a validates_numericality_of :some_attribute, :greater_than = 0, :allow_blank=true def some_attribute a.numeric_attr * read_attribute(:some_attribute) end ... If I create an instance

Re: [rspec-users] Problem running RSpec tests with Rails

2010-07-26 Thread David Chelimsky
On Jul 26, 2010, at 11:50 AM, Ashley Moran wrote: On Jul 26, 2010, at 5:12 pm, Bruno Cardoso wrote: Not sure if this is a RSpec problem or Rails but I believe is more a RSpec situation. What happens is that when I run my RSpecs tests all the BD is recreated, ... Anyone know how

Re: [rspec-users] Problem running RSpec tests with Rails

2010-07-26 Thread David Chelimsky
On Jul 26, 2010, at 12:36 PM, Bruno Cardoso wrote: Thanks for the answers. What both solutions (from Ashley and David) do is not modify the BD in anyway, so nothing gets dropped and nothing is created. This resolves the problem but what if I want a clean installation in each test run? So

[rspec-users] what is the value of the distinction between exceptions and failures?

2010-07-25 Thread David Chelimsky
There is a feature request to make a distinction between exceptions and logical failures in RSpec's output. If this topic interests you, please take a look at http://github.com/rspec/rspec-core/issues/#issue/93 and add your thoughts to the conversation there. Thx, David

Re: [rspec-users] newbie: how to preserve NoMethodError under stubbing?

2010-07-24 Thread David Chelimsky
On Fri, Jul 23, 2010 at 6:46 PM, Lille lille.pengu...@gmail.com wrote: Hi, I've been browsing the RSpec book and the RDoc, but I can't see how to ensure the following: Stub an instance with a method it doesn't have and raise NoMethodError (or something like it.) RSpec doesn't support

Re: [rspec-users] [Rails] Stubbed static methods are bleeding over into other specs and making them fail

2010-07-24 Thread David Chelimsky
On Fri, Jul 23, 2010 at 7:29 PM, Patrick Gannon patgan...@gmail.com wrote: I just got a chance to try this, and ran into more problems.  Prior to trying this, we were running RSpec2 beta 13.  When I changed our Gemfile to depend on 'edge' RSpec et al (as you suggested above), I get a very

Re: [rspec-users] newbie: how to preserve NoMethodError under stubbing?

2010-07-24 Thread David Chelimsky
On Jul 24, 2010, at 4:35 AM, Wincent Colaiuta wrote: El 24/07/2010, a las 08:26, David Chelimsky escribió: On Fri, Jul 23, 2010 at 6:46 PM, Lille lille.pengu...@gmail.com wrote: Hi, I've been browsing the RSpec book and the RDoc, but I can't see how to ensure the following: Stub

Re: [rspec-users] Controller stub and helper spec with lastest beta

2010-07-24 Thread David Chelimsky
On Jul 24, 2010, at 9:33 AM, chatgris wrote: Hello, I have two issues with beta 2.0.0.beta.18. First, here's the gems : gem rails, 3.0.0.beta4 gem mongoid, 2.0.0.beta10 group :test do gem rspec-rails, 2.0.0.beta.18 gem factory_girl_rails, 1.0 end My spec_helper :

Re: [rspec-users] should_receive test unexpectedly failing

2010-07-22 Thread David Chelimsky
On Jul 22, 2010, at 10:48 AM, ericindc wrote: I'm unsure why this test is still failing. I've tested it in console and the code works as expected. Is there something wrong with how I have my test written? ** error 1) Job selecting the next job to be processed should

Re: [rspec-users] 'its' not working

2010-07-21 Thread David Chelimsky
On Jul 21, 2010, at 10:09 AM, Andrew Premdas wrote: trying out new syntax from jon larkowski's rspec presentation. Following doesn't work in that when I run the line from the command prompt or from textmate no specs are run context cancel do subject do order =

Re: [rspec-users] spec w/o db:test:prepare

2010-07-21 Thread David Chelimsky
On Jul 21, 2010, at 4:17 PM, David Chelimsky wrote: On Jul 21, 2010, at 3:32 PM, Peter Fitzgibbons wrote: On Tue, Jul 20, 2010 at 6:40 PM, David Chelimsky dchelim...@gmail.com wrote: On Jul 20, 2010, at 4:18 PM, Peter Fitzgibbons wrote: HI All, I would like to perform my spec runs

Re: [rspec-users] spec w/o db:test:prepare

2010-07-21 Thread David Chelimsky
On Jul 21, 2010, at 3:32 PM, Peter Fitzgibbons wrote: On Tue, Jul 20, 2010 at 6:40 PM, David Chelimsky dchelim...@gmail.com wrote: On Jul 20, 2010, at 4:18 PM, Peter Fitzgibbons wrote: HI All, I would like to perform my spec runs without the db:test:prepare rake prereq. It would

Re: [rspec-users] bundle exec rspec vs rake spec

2010-07-20 Thread David Chelimsky
On Jul 19, 2010, at 7:51 AM, Jay wrote: I'm in the process of upgrading my rails app to rails 3 and I'm getting different results from running the 2 commands above. The bundle exec rspec runs my tests correctly, but when I run rake spec it doesn't seem to do anything. I get 0 examples, 0

Re: [rspec-users] controller.should_receive(:render) problem

2010-07-20 Thread David Chelimsky
On Jul 12, 2010, at 4:18 AM, Ruprict wrote: Hi. My issue is similar to the one in this post: http://groups.google.com/group/rspec/browse_thread/thread/973d770e45bdd6cd/8ba067476003f08f?lnk=gstq=render+controller+should_receive#8ba067476003f08f (which, btw, I could not reply to...only

Re: [rspec-users] methods not available...

2010-07-20 Thread David Chelimsky
On Jul 20, 2010, at 1:07 PM, rogerdpack wrote: Hi all. Noticed that with rspec 1.x methods at higher levels aren't available in lower, ex: context a do def go end it should pass do go end it should pass again do context a::b do You can't wrap contexts inside examples.

Re: [rspec-users] spec w/o db:test:prepare

2010-07-20 Thread David Chelimsky
On Jul 20, 2010, at 4:18 PM, Peter Fitzgibbons wrote: HI All, I would like to perform my spec runs without the db:test:prepare rake prereq. It would be nice if I could alter spec to prereq db:test:purge only. Could you give me some advice/urls/pointers on how best to go about this?

Re: [rspec-users] rspec2 help output has brackets?

2010-07-19 Thread David Chelimsky
On Jul 19, 2010, at 8:17 AM, rogerdpack wrote: Hi all. Saw this: Usage: rspec [options] [files or directories] -b, --backtrace Enable full backtrace -c, --[no-]color, --[no-]colour Enable color in the output -d, --debug Enable debugging

[rspec-users] deprecate mock_model?

2010-07-19 Thread David Chelimsky
Hey all, I'm thinking of deprecating mock_model in rspec-rails-2. stub_model is more stable, reliable (not dependent on Rails internals like mock_model is), much less intrusive, and I find that I use it all the time in spite of the need to create a real model to back it up. Anybody attached

Re: [rspec-users] deprecate mock_model?

2010-07-19 Thread David Chelimsky
On Jul 19, 2010, at 7:47 PM, David Chelimsky wrote: Hey all, I'm thinking of deprecating mock_model in rspec-rails-2. stub_model is more stable, reliable (not dependent on Rails internals like mock_model is), much less intrusive, and I find that I use it all the time in spite of the need

Re: [rspec-users] Gem conflict with RSpec::Rails and Sunspot

2010-07-18 Thread David Chelimsky
On Jul 18, 2010, at 8:21 PM, Shane Mingins wrote: On 19 July 2010 12:32, Shane Mingins e...@mingins.com wrote: Hi All I was wondering if someone could perhaps point me to where in RSpec::Rails is the Rails ActionController being subclassed by an Object instance? My ruby-fu is not high

Re: [rspec-users] Gem conflict with RSpec::Rails and Sunspot

2010-07-18 Thread David Chelimsky
On Jul 18, 2010, at 8:29 PM, Shane Mingins wrote: And so ... # Sets the controller class name. Useful if the name can't be inferred from test class. # Expects +controller_class+ as a constant. Example: tttests WidgetController/tt. def tests(controller_class)

Re: [rspec-users] Gem conflict with RSpec::Rails and Sunspot

2010-07-18 Thread David Chelimsky
On 19 July 2010 13:45, David Chelimsky dchelim...@gmail.com wrote: On Jul 18, 2010, at 8:29 PM, Shane Mingins wrote: And so ... # Sets the controller class name. Useful if the name can't be inferred from test class. # Expects +controller_class+ as a constant. Example: tttests

Re: [rspec-users] assigns and should eql don't work as expected

2010-07-17 Thread David Chelimsky
On Jul 17, 2010, at 3:29 AM, Daniel Salmeron Amselem wrote: Today I've been writing some tests for a new rails 3 app, but after reading the doc from http://rdoc.info/projects/rspec/rspec-expectations, I still can't understand why the test doesn't work. My setup is: rvm 0.1.41 ruby

Re: [rspec-users] assigns and should eql don't work as expected

2010-07-17 Thread David Chelimsky
On Jul 17, 2010, at 8:09 AM, David Chelimsky wrote: On Jul 17, 2010, at 3:29 AM, Daniel Salmeron Amselem wrote: Today I've been writing some tests for a new rails 3 app, but after reading the doc from http://rdoc.info/projects/rspec/rspec-expectations, I still can't understand why

Re: [rspec-users] How are people speccing Rails 3 ActiveRecord queries?

2010-07-17 Thread David Chelimsky
On Jul 17, 2010, at 10:37 AM, doug livesey wrote: Hi -- how are people speccing Rails 3 ActiveRecord queries? At the minute I'm chaining a load of should_receive calls on mock relation objects, but can't help thinking that there must be a more elegant way of going about it. Is there a best

Re: [rspec-users] assigns and should eql don't work as expected

2010-07-17 Thread David Chelimsky
On Jul 17, 2010, at 2:25 PM, Daniel Salmeron Amselem wrote: On Jul 17, 9:41 am, David Chelimsky dchelim...@gmail.com wrote: On Jul 17, 2010, at 8:09 AM, David Chelimsky wrote: On Jul 17, 2010, at 3:29 AM, Daniel Salmeron Amselem wrote: Today I've been writing some tests for a new rails 3

Re: [rspec-users] Data-wise context combination for controller speccing

2010-07-17 Thread David Chelimsky
On Jul 17, 2010, at 1:18 PM, Costa Shapiro wrote: Hello, I've been thinking of how to express my idea in code, but since I've never been involved in RSpec development, I'd better have some feedback here first. The feature suggestion below applies to any controller-like code under spec,

Re: [rspec-users] set expectation using self in constructor?

2010-07-16 Thread David Chelimsky
On Jul 16, 2010, at 4:45 AM, Tom Stuart wrote: On 16 Jul 2010, at 10:29, Matt Wynne wrote: For those following along at home, this exact technique did not work. The +actual_foo+ variable was holding some mock value instead of the real self value. Sorry. Do we think this is a bug in rspec?

Re: [rspec-users] Questions about testing a module method that randomly creates stuff from list.

2010-07-16 Thread David Chelimsky
On Jul 15, 2010, at 12:18 PM, Greg Ditrick wrote: All, I have a method in a shared Module that shuffles data and then output other data. The method is somewhat large (maybe 50 lines) and sometimes calls other sub methods to help to complete the output which must meet a specific

Re: [rspec-users] rspec route question

2010-07-16 Thread David Chelimsky
On Jul 15, 2010, at 6:24 PM, Matt Kolenda wrote: Hello I'm having some trouble getting rspec to recognize a route. # This works describe routes do it should have a route do { :get = /accounts/3/jobs/3/ applications/1/edit }.should route_to(:controller = 'applications',

[rspec-users] shared example groups

2010-07-16 Thread David Chelimsky
Hey all, For anyone interested in shared example groups, please read and feel free to comment on http://github.com/rspec/rspec-core/issues/#issue/71. Cheers, David ___ rspec-users mailing list rspec-users@rubyforge.org

Re: [rspec-users] Questions about testing a module method that randomly creates stuff from list.

2010-07-16 Thread David Chelimsky
On Jul 16, 2010, at 11:38 AM, Greg Ditrick wrote: David Chelimsky dchelim...@gmail.com wrote: On Jul 15, 2010, at 12:18 PM, Greg Ditrick wrote: This sounds like a long, procedural method. Can it be broken down any further (i.e. delegating more of its work to other methods)? Yes

Re: [rspec-users] spec for a rails helper that renders a partial template

2010-07-15 Thread David Chelimsky
On Jul 13, 2010, at 6:59 PM, Jonathan Rochkind wrote: David Chelimsky wrote: On Jul 13, 2010, at 6:05 PM, Jonathan Rochkind wrote: Do you know about integrate_views? http://rspec.info/rails/writing/controllers.html I read about it in my quest through the documentation for a solution

Re: [rspec-users] Help needed for instslling rspec

2010-07-15 Thread David Chelimsky
On Jul 15, 2010, at 12:36 PM, Patel, Mihir wrote: Hi All, I am new to BDD. I have ruby 1.8.7 on my RHEL5 computer. I am trying to install RSpec by “gem install rspec” but I get an error saying : “could not find rspec locally or in a repository”, Please help me out. Please type gem env

Re: [rspec-users] Heckle RSpec 2

2010-07-15 Thread David Chelimsky
On Jul 15, 2010, at 5:53 PM, ericindc wrote: How do I run Heckle with RSpec? I've tried rake spec --heckle but get no output. I've tried just -heckle too, as mentioned in the docs, but that isn't accepted as a valid option and the help out is displayed. I have both the heckle and

Re: [rspec-users] Hiding test_unit Generators ?

2010-07-14 Thread David Chelimsky
On Jul 13, 2010, at 8:49 PM, Arco wrote: In a recent blog post, David wrote: Because RSpec is the test framework of record, Rails doesn’t know to hide the test_unit generators. If you want to hide them, just add this to one of your config files:

Re: [rspec-users] pending blocks

2010-07-14 Thread David Chelimsky
On Jul 14, 2010, at 7:44 PM, rogerdpack wrote: Would it be possible to have pending be accessible everywhere? Curgem rently with describe '' do pending 'abc' do end end In rspec-2, you can do this: describe something, :pending = true do ... end And all the examples in that group

Re: [rspec-users] before(:all) to set up mocks and stubs

2010-07-13 Thread David Chelimsky
On Jul 13, 2010, at 7:25 AM, Ivo Dancet wrote: Hi I'm upgrading an application to rspec2/rails3. A certain suite of tests, that generates a pdf document, uses a before(:all) filter to set the environment using mocks and stubs. Then the pdf gets generated and after that all the tests run

Re: [rspec-users] spec for a rails helper that renders a partial template

2010-07-13 Thread David Chelimsky
On Jul 13, 2010, at 5:43 PM, Jonathan Rochkind wrote: So the stock answer to this is don't do it. But I'm in a situation where it's really what I want to do to test what I want to test. a helper method: def some_helper render(:partial = some/partial, :locals = {:some = some} end

Re: [rspec-users] [Rspec] Difference between stub and message expectation with any_number_of_times

2010-07-13 Thread David Chelimsky
On Jul 13, 2010, at 11:29 AM, Benyi Wang wrote: I'm wondering what's the difference between stub and message expectation with any_number_of_times, for example: myMock = mock(mymock) myMock.stub!(:is_a?).with(MyClass).and_return(false) and myMock = mock(mymock)

Re: [rspec-users] spec for a rails helper that renders a partial template

2010-07-13 Thread David Chelimsky
On Jul 13, 2010, at 6:05 PM, Jonathan Rochkind wrote: David Chelimsky wrote: On Jul 13, 2010, at 5:43 PM, Jonathan Rochkind wrote: against the return strings? Any way at all? I've been trying for a while with no success. Thanks for any advice. RSpec version? Good point. Rails2

Re: [rspec-users] does rspec2 work with datamapper?

2010-07-11 Thread David Chelimsky
On Jul 10, 2010, at 2:08 PM, Kevin wrote I keep getting this error message: /Users/kevin/.bundle/ruby/1.8/gems/rspec-rails-2.0.0.beta.16/lib/ rspec/ rails/fixture_support.rb:12: uninitialized constant RSpec::Rails::FixtureSupport::ActiveRecord (NameError) from

Re: [rspec-users] Strange behavior with using webrat in requests tests

2010-07-11 Thread David Chelimsky
On Jul 6, 2010, at 10:43 AM, Mike Gehard wrote: Good morning, I am using Rails3 (beta4) and RSpec2 (beta 15) under RVM and am running into an interesting issue. My request tests using webrat seem to think that they are running in the development Rails environment (I know this because

Re: [rspec-users] How to test a method that return random values

2010-07-11 Thread David Chelimsky
On Jul 6, 2010, at 1:35 PM, Guilherme wrote: Hi, How can I test this method using rspec ? def self.generate_calculation number1, number2, operation number1 = rand(number1) number2 = rand(number2) ... end This method return an operation with those random numbers.

Re: [rspec-users] Rspec-method missing error

2010-07-11 Thread David Chelimsky
On Jul 9, 2010, at 1:28 AM, siva wrote: Hi Thanks in advance for helping me. I got the following error: /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/ active_support/whiny_nil.rb:52:in `method_missing': undefined method `strip' for nil:NilClass (NoMethodError) from

Re: [rspec-users] Devise: session variable is empty on session_serializer.rb#store

2010-07-10 Thread David Chelimsky
On Jul 10, 2010, at 1:26 PM, Daniel Salmeron Amselem wrote: On Jul 9, 2:45 pm, Daniel Salmeron Amselem daniel.amse...@gmail.com wrote: I've been trying to test a very simple action on a controller with this setup: rspec 1.3.0 ruby 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0]

Re: [rspec-users] Devise: session variable is empty on session_serializer.rb#store

2010-07-10 Thread David Chelimsky
On Jul 10, 2010, at 2:45 PM, Daniel Salmeron Amselem wrote: On Jul 10, 2:31 pm, David Chelimsky dchelim...@gmail.com wrote: On Jul 10, 2010, at 1:26 PM, Daniel Salmeron Amselem wrote: On Jul 9, 2:45 pm, Daniel Salmeron Amselem daniel.amse...@gmail.com wrote: I've been trying

Re: [rspec-users] Devise: session variable is empty on session_serializer.rb#store

2010-07-10 Thread David Chelimsky
On Jul 10, 2010, at 3:21 PM, Daniel Salmeron Amselem wrote: On Jul 10, 3:53 pm, David Chelimsky dchelim...@gmail.com wrote: On Jul 10, 2010, at 2:45 PM, Daniel Salmeron Amselem wrote: On Jul 10, 2:31 pm, David Chelimsky dchelim...@gmail.com wrote: On Jul 10, 2010, at 1:26 PM, Daniel Salmeron

Re: [rspec-users] Devise: session variable is empty on session_serializer.rb#store

2010-07-10 Thread David Chelimsky
On Jul 10, 2010, at 3:38 PM, Daniel Salmeron Amselem wrote: You're right David, my fault. Than you very much for all your help. You got it working then? On Jul 10, 4:32 pm, David Chelimsky dchelim...@gmail.com wrote: On Jul 10, 2010, at 3:21 PM, Daniel Salmeron Amselem wrote: On Jul 10, 3:53

Re: [rspec-users] Setting up rspec-rails for hacking

2010-07-09 Thread David Chelimsky
On Jul 9, 2010, at 6:59 AM, garren wrote: On Jul 7, 12:34 pm, David Chelimsky dchelim...@gmail.com wrote: On Jul 7, 2010, at 5:26 AM, Trevor Lalish-Menagh wrote: Did you know about the rspec-dev meta project? http://github.com/rspec/rspec-dev That is great. I should have looked

Re: [rspec-users] Setting up rspec-rails for hacking

2010-07-09 Thread David Chelimsky
On Jul 9, 2010, at 8:06 AM, David Chelimsky wrote: On Jul 9, 2010, at 6:59 AM, garren wrote: On Jul 7, 12:34 pm, David Chelimsky dchelim...@gmail.com wrote: On Jul 7, 2010, at 5:26 AM, Trevor Lalish-Menagh wrote: Did you know about the rspec-dev meta project? http://github.com/rspec

Re: [rspec-users] How to test an app with multiple databases?

2010-07-08 Thread David Chelimsky
On Jul 8, 2010, at 2:27 AM, Juanma Cervera wrote: Ben Mabey wrote: Spec::Runner.configure do |c| c.before(:each) do ActiveRecord::Base::establish_connection :secondary_db DatabaseCleaner.start ActiveRecord::Base::establish_connection :primary_db end c.after(:each) do

Re: [rspec-users] RSpec uses at_exit - forks and stuff

2010-07-08 Thread David Chelimsky
On Jul 8, 2010, at 4:24 AM, Andrew Premdas wrote: On 8 July 2010 01:01, David Chelimsky dchelim...@gmail.com wrote: On Jul 7, 2010, at 8:22 AM, Andrew Premdas wrote: Hi there. My understanding (which is limited) is that rspec uses at_exit to run its specs. I don't really know why

Re: [rspec-users] Accessing view helpers to spec cell views, Rails3, RSpec2

2010-07-08 Thread David Chelimsky
On Jul 8, 2010, at 4:29 AM, doug livesey wrote: Hi -- I'm trying to use the excellent Cells gem in a Rails 3 project with RSpec 2. I've got the 'controller' bit of the cells specced okay, but I'm struggling with the 'view' bit. What I want to do is to use RSpec's view helper methods to

Re: [rspec-users] Testing equality

2010-07-08 Thread David Chelimsky
On Jul 8, 2010, at 5:04 AM, Juanma Cervera wrote: Hello How can I test equality with two objects when they include some attribute that is BigDecimal? if I make something like this: it should ...whatever do obj = Factory.create(:my_object) ... MyObject.first.should == obj end.

[rspec-users] RSpec.tmbundle failure after removing at_exit hook

2010-07-08 Thread David Chelimsky
Hey all, Following up on the problem with textmate after removing the at_exit hook (see http://groups.google.com/group/rspec/browse_thread/thread/37bbe78aa52682b0): The problem is that the file(s) do(es) not get loaded by the rspec runner. They appear to be required by TextMate prior to

Re: [rspec-users] RSpec TM bundle question

2010-07-08 Thread David Chelimsky
On Jul 8, 2010, at 2:37 PM, Jay McGaffigan wrote: a little more investigation shows that the bundle is really having trouble loading the 'spec/autorun' file in mate.rb it appears that rubygems is not loaded (I'm not using bundler on this project (yet)). If I mod mate.rb to require

Re: [rspec-users] Setting up rspec-rails for hacking

2010-07-07 Thread David Chelimsky
On Jul 7, 2010, at 5:26 AM, Trevor Lalish-Menagh wrote: Did you know about the rspec-dev meta project? http://github.com/rspec/rspec-dev That is great. I should have looked for that before setting this up. I just didn't think about it. Perhaps we should update the rspec-* READMEs

Re: [rspec-users] Possible improvements to routing spec API

2010-07-07 Thread David Chelimsky
On Jul 7, 2010, at 7:39 AM, Wincent Colaiuta wrote: El 07/07/2010, a las 13:29, David Chelimsky escribió: Seems as though this format has been abandoned in this conversation: it { should route(get /issues/new).to(issues#new) } it { should generate(/issues/new).from(issues#new) } I

Re: [rspec-users] RSpec uses at_exit - forks and stuff

2010-07-07 Thread David Chelimsky
On Jul 7, 2010, at 8:22 AM, Andrew Premdas wrote: Hi there. My understanding (which is limited) is that rspec uses at_exit to run its specs. I don't really know why - could somoene explain? The initial motivation was that it makes it easy to make sure it works whether you run it with the

Re: [rspec-users] rspec rake tasks fail inside active record

2010-07-06 Thread David Chelimsky
On Jul 6, 2010, at 6:49 AM, andreyr wrote: Hi, i have a problem that any of my rspec rake tasks fail with the following error: rake -f unittests.rake spec ** Invoke spec (first_time) ** Execute spec

Re: [rspec-users] Possible improvements to routing spec API

2010-07-06 Thread David Chelimsky
On Jul 5, 2010, at 2:59 PM, Lalish-Menagh, Trevor wrote: OK, I will chime in here, since I think I might have opened up this can of worms. :) I agree with David that we should stick with wrapping the Rails public APIs. That is: assert_generates, assert_recognizes, and assert_routing

Re: [rspec-users] Possible improvements to routing spec API

2010-07-05 Thread David Chelimsky
On Jul 5, 2010, at 4:14 AM, Matt Wynne wrote: On 5 Jul 2010, at 08:00, Wincent Colaiuta wrote: Hi folks, I've been unhappy with routing specs for a long time now and last night when updating some old 1.3 specs for 2.0 I decided to see if I could come up with something that didn't make me

Re: [rspec-users] spec'ing namespaced routes

2010-07-05 Thread David Chelimsky
On Jul 4, 2010, at 7:15 PM, Frank Mattia wrote: What's the appropriate way to test namespaced routes with rspec-2 rails 3? I imagined that the following would work but it does not. describe Admin::UsersController do describe routing do it recognizes and generates #index do {

Re: [rspec-users] Problem specing application layout, missing partial?

2010-07-05 Thread David Chelimsky
On Jul 5, 2010, at 9:52 AM, Pixel wrote: In an effort to teach myself BDD I'm trying it out. I'm trying to do a simple (should be straightforward) spec on my application.html.haml file first looking for a div tag with the class 'nav' it seems that rspec isn't able to render the

Re: [rspec-users] Possible improvements to routing spec API

2010-07-05 Thread David Chelimsky
On Jul 5, 2010, at 9:04 AM, Wincent Colaiuta wrote: El 05/07/2010, a las 13:56, David Chelimsky escribió: Nice overall. Much of the code belongs in Rails, though, so I'd like to try to get a patch in to Rails once we get this worked out. I'd like the rspec-rails matchers to be simple

Re: [rspec-users] Possible improvements to routing spec API

2010-07-05 Thread David Chelimsky
On Jul 5, 2010, at 11:58 AM, Wincent Colaiuta wrote: El 05/07/2010, a las 18:18, David Chelimsky escribió: The thing that concerns me the most is the DestinationParser. Even though it seems simple, that's the sort of code that ends up making rspec-rails a rails-dependent maintenance

Re: [rspec-users] Loading problem with engine extending ActionController::Base

2010-07-05 Thread David Chelimsky
On Jul 3, 2010, at 4:40 PM, Michael Schuerig wrote: On Saturday 03 July 2010, David Chelimsky wrote: On Jul 3, 2010, at 3:34 PM, Michael Schuerig wrote: [double loading of Rails framework classes] require File.dirname(__FILE__) + /../config/environment unless defined?(Rails

Re: [rspec-users] Problem specing application layout, missing partial?

2010-07-05 Thread David Chelimsky
On Jul 5, 2010, at 12:21 PM, Pixel wrote: On Mon, Jul 5, 2010 at 11:16 AM, David Chelimsky dchelim...@gmail.com wrote: On Jul 5, 2010, at 9:52 AM, Pixel wrote: In an effort to teach myself BDD I'm trying it out. I'm trying to do a simple (should be straightforward) spec on my

Re: [rspec-users] Possible improvements to routing spec API

2010-07-05 Thread David Chelimsky
On Jul 5, 2010, at 12:38 PM, Wincent Colaiuta wrote: El 05/07/2010, a las 19:17, David Chelimsky escribió: On Jul 5, 2010, at 11:58 AM, Wincent Colaiuta wrote: El 05/07/2010, a las 18:18, David Chelimsky escribió: The thing that concerns me the most is the DestinationParser. Even though

Re: [rspec-users] [Rails] Stubbed static methods are bleeding over into other specs and making them fail

2010-07-05 Thread David Chelimsky
On Jul 2, 2010, at 7:25 PM, Patrick Gannon wrote: Hi all, I'm having a problem where stubbed static methods aren't properly becoming unstubbed. I have tried manually unstubbing them, but it still doesn't work. Spec is as follows: it creates user accounts for unknown users do

Re: [rspec-users] Loading problem with engine extending ActionController::Base

2010-07-03 Thread David Chelimsky
On Jul 3, 2010, at 3:34 PM, Michael Schuerig wrote: I'm working on an engine that extends ActionController::Base like this module MyEngine class Engine Rails::Engine config.after_initialize do ActionController::Base.class_eval do include MyEngine::ControllerExtension

Re: [rspec-users] Rspec2 / Rails3 / test_unit

2010-07-02 Thread David Chelimsky
On Jul 2, 2010, at 11:11 AM, Arco wrote: I generate a new rails3 app using rails new my_app -T. Then i run cd my_app ; rails generate, and I don't see any test_unit options. (as expected). Then I put gem 'rspec-rails' into my Gemfile, and re-run rails generate. Now I see options for

Re: [rspec-users] rspec 2 not cleaning up after examples run?

2010-07-01 Thread David Chelimsky
Amir On Jun 30, 2010 10:56 PM, David Chelimsky dchelim...@gmail.com wrote: On Jun 30, 2010, at 11:55 AM, Timo Rößner wrote: On Jun 29, 12:14 pm, David Chelimsky dchelim. The command is rspec in rspec 2. Try: bundle exec rspec spec/models/challenge_spec.rb @David, alright, I tried

Re: [rspec-users] Rake spec options

2010-07-01 Thread David Chelimsky
On Jul 1, 2010, at 11:41 AM, Ibrahim Awwal wrote: On Jul 1, 9:25 am, David Chelimsky dchelim...@gmail.com wrote: On Jul 1, 2010, at 11:13 AM, Ibrahim Awwal wrote: Hi guys, Apologies if this is a dumb question. I'm new to rails and most of the information online is about rails 2

Re: [rspec-users] using LINE with nested example groups

2010-07-01 Thread David Chelimsky
On Jul 1, 2010, at 1:27 PM, Arco wrote: I would like to use the --line parameter with nested example groups (describe / context). It looks to me like rspec handles this fine if I select the innermost group. But if I select an outer group, rspec ignores all the nested examples. Is this

Re: [rspec-users] Rspec-rails 2 and spec/spec.opts or other configuration options for rake spec

2010-07-01 Thread David Chelimsky
On Jul 1, 2010, at 1:52 AM, Ibrahim Awwal wrote: Hi guys, I apologize if this is a dumb question, but in rspec-rails version 2.0.0.14 (for rails 3.0.0b4) I'm trying to add configuration options like some tutorials mention in a file spec/spec.opts, but this has no effect. I glanced through

<    4   5   6   7   8   9   10   11   12   13   >