[rspec-users] How to write a plugin that uses rspec internally?

2007-09-15 Thread David James
My team is working on a plugin and we want to use RSpec internally for the plugin's tests. (a) What are some different ways to go about this? Should we rely on the RSpec gem? Should we expect that the "host" Rails application has installed the RSpec plugins? Are there other options? (b) Which

Re: [rspec-users] How to write a plugin that uses rspec internally?

2007-09-15 Thread David James
Thanks! ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

[rspec-users] #add method?

2007-09-15 Thread David James
I've seen reference to an 'add' method, as in Model.add. When and why would I want to use it? Is it related to Model.collection.build? Thanks, David ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-user

[rspec-users] How far to go with ActiveRecord unit tests without hitting the database?

2007-09-15 Thread David James
I'm currently try to push my limits a little bit with some of my unit testing -- trying to avoid saving ActiveRecord objects to the database and take advantage of mock/stub objects. How far should I expect to get in this direction? From what I can tell, ActiveRecord seems to fight me when it come

Re: [rspec-users] #add method?

2007-09-16 Thread David James
I wish I was more specific, indeed. :) While scouring the Web for examples of mocking ActiveRecord associations (see other thread), I saw the add method -- but couldn't figure out what it did. That made me wonder if it was perhaps some special construct in RSpec (perhaps for helping with associat

Re: [rspec-users] I lost the RSpec fight

2007-09-16 Thread David James
In case it helps those who want to make it a little easier to try both at the same time (i.e. a bridge), ReinH has got a script that helps use autotest growl with both Test::Unit and RSpec: http://reinh.com/2007/9/12/the-autotest-rosetta-stone ___ rspec-u

Re: [rspec-users] How far to go with ActiveRecord unit tests without hitting the database?

2007-09-18 Thread David James
> > "But otherwise, what exactly are you testing?" > That's a great point. I don't want to be specing Rails if it is not easily separable for testing already. In theory, I would like to have true unit tests for my models. However, in practice, some of my models are coupled to some degree. Gener

[rspec-users] Testing for particular CSS (i.e. display: none)

2007-09-25 Thread David James
I have a page that hides elements using CSS display: none. I don't expect RSpec to test any changes made by Javascript; I just want to test how the page loads initially: what is visible and what is not. Can I test this in RSpec? Or do I need to use something like Selenium? __

Re: [rspec-users] Testing for particular CSS (i.e. display: none)

2007-09-25 Thread David James
Perfect. That's really nifty. I'm also reading the comments in selector_assertions.rb in actionpack. On 9/25/07, David Chelimsky <[EMAIL PROTECTED]> wrote: > > On 9/25/07, David James <[EMAIL PROTECTED]> wrote: > > I have a page that hides elements using

[rspec-users] "should_not ==" vs "should !="

2008-01-18 Thread David James
describe "should_not == vs. should !=" it do 5.should_not == 6 end # passes it do 5.should != 6 end # fails end # I'm running the rspec 1.1.2 gem with the corresponding Textmate bundle # The second failure surprises me. # Is != not supported? # I'd like to hear what you all think.

Re: [rspec-users] helper methods starting with should

2008-01-29 Thread David James
-1* I upgraded a Rails project from rspec 0.9 to 1.1.2 -- and this change caused me some pain. Luckily, I figured it out and confirmed it here on the list before things got too bad. :) * That said, I have to admit that I'm not super-pleased about my helper methods that start with should_ -- they p