[rspec-users] Test-Driving Screencast

2013-07-02 Thread Alex Chaffee
A few months ago I gave a talk on TDD/BDD for a client. I've put up the slides, notes, and live video on my instructional site Code Like This: http://codelikethis.com/lessons/agile_development/test_driven The video's in two parts -- first a lecture on TDD/BDD concepts, then a live coding demo of

Re: [rspec-users] Test JSON with Cucumber

2013-06-20 Thread Hagar Chen
Hi, I have a question about writing scenarios in cucumber that include a JSON. I have the following scenario in cucumber: Scenario Outline: Given I send and accept JSON And I send a POST request to with the following: """ { "field1":"text", "emails":[ { "work"

Re: [rspec-users] Test configuration information

2013-01-24 Thread Jim Coble
s-boun...@rubyforge.org [mailto:rspec-users-boun...@rubyforge.org] On Behalf Of J. B. Rainsberger Sent: Wednesday, January 23, 2013 5:27 PM To: rspec-users Subject: Re: [rspec-users] Test configuration information On Wed, Jan 23, 2013 at 2:54 PM, Jim Coble mailto:jim.co...@duke.edu>> wrote: One

Re: [rspec-users] Test configuration information

2013-01-23 Thread J. B. Rainsberger
On Wed, Jan 23, 2013 at 2:54 PM, Jim Coble wrote: > One of my tests needs to be provided with a particular directory path. > While I can code this path as a literal directly in the test spec, it seems > to me it might be better to have it in a configuration file somewhere so > that I have one pl

Re: [rspec-users] Test configuration information

2013-01-23 Thread Perry Smith
I think I would put it with the test. My logic is, if it breaks (needs to change), the test will break. You will look there first to see what happened. On Jan 23, 2013, at 12:54 PM, Jim Coble wrote: > One of my tests needs to be provided with a particular directory path. While > I can code t

[rspec-users] Test configuration information

2013-01-23 Thread Jim Coble
One of my tests needs to be provided with a particular directory path. While I can code this path as a literal directly in the test spec, it seems to me it might be better to have it in a configuration file somewhere so that I have one place to maintain it and look for it. Would spec_helper.rb

Re: [rspec-users] test case creation for a pizza ordering site

2012-11-17 Thread George Dinwiddie
Chaitra, You'll get better help on Cucumber if you use the Cucumber mailing list rather than the rspec list. I've CC'd that list on this reply. Please join that list and reply only there. On 11/17/12 9:57 PM, chaitra b. wrote: Hi, I am new to Ruby and Cucumber. Can anyone help me with creat

[rspec-users] test case creation for a pizza ordering site

2012-11-17 Thread chaitra b.
Hi, I am new to Ruby and Cucumber. Can anyone help me with creating test scripts using cucumber for a pizza ordering site which requires a login or new user creation to place an order. Thanks ! -- Posted via http://www.ruby-forum.com/. ___ rspec-user

Re: [rspec-users] test for "lambda {...}.should change(x, y).by(z)" failing.. ?

2011-11-24 Thread Patrick J. Collins
> As you can see, @seller.reload is only evaluated once, and its reputation > score is going to be the same both times. Aha.. Makes perfect sense. Thanks. > Tangent: this is testing two things - @seller.reputation_score and > Event.reputation_change_for(:mark_helpful). If either is failing to w

Re: [rspec-users] test for "lambda {...}.should change(x, y).by(z)" failing.. ?

2011-11-24 Thread David Chelimsky
On Nov 23, 2011, at 3:33 PM, Patrick J. Collins wrote: > I wrote a test that looked like this: > > it "increases the user's reputation" do > lambda { @comment.update_attribute(:helpful, true) }.should > change(@seller.reload, > :reputation_score).by(Event.reputation_change_

[rspec-users] test for "lambda {...}.should change(x, y).by(z)" failing.. ?

2011-11-23 Thread Patrick J. Collins
I wrote a test that looked like this: it "increases the user's reputation" do lambda { @comment.update_attribute(:helpful, true) }.should change(@seller.reload, :reputation_score).by(Event.reputation_change_for(:mark_helpful)) end And I am getting this error: 1

Re: [rspec-users] Test execution time filtering

2011-08-17 Thread Sidu Ponnappa
> But a sophisticated test will make decisions in mid test. Quis custodiet ipsos custodes? You'll need to write specs for the logic in your specs then. Best, Sidu. http://c42.in http://blog.sidu.in On 10 August 2011 04:53, Mike Jr wrote: > As I understand it, RSpec runs in two passes.  The first

Re: [rspec-users] Test execution time filtering

2011-08-17 Thread Stefan Kanev
On Wed, Aug 10, 2011 at 2:23 AM, Mike Jr wrote: > But a sophisticated test will make decisions in mid test. If a > certain test condition occurs, set a singleton hash and then have > later tests condition their processing on that hash. In my tests, > these if statements are within the it blocks

Re: [rspec-users] Test execution time filtering

2011-08-17 Thread Stefan Kanev
> > RSpec is built around the premise that each example is run in its own > environment, and that one should not depend on the outcome of another. This > is not unique to RSpec, btw. It's how all of the unit testing frameworks of > which I am aware work. > I know I'm going off-topic, but TestNG su

Re: [rspec-users] Test execution time filtering

2011-08-16 Thread David Chelimsky
On Aug 9, 2011, at 6:23 PM, Mike Jr wrote: > As I understand it, RSpec runs in two passes. The first pass reads > your code and invokes factory methods to generate instances of example- > group and example subclasses. The second pass then invokes these > generated instance to run your test. > >

[rspec-users] Test execution time filtering

2011-08-15 Thread Mike Jr
As I understand it, RSpec runs in two passes. The first pass reads your code and invokes factory methods to generate instances of example- group and example subclasses. The second pass then invokes these generated instance to run your test. RSpec filters (via RSpec.configure) are set and operate

Re: [rspec-users] Test Design Question #1

2011-03-31 Thread Pat Maddox
What do you mean that it's "leaking" into the other test? If you have transactions turned on, then any records inserted into the db will be removed for the next test. My guess is that other tests just don't set up the required data...which is a problem with ActiveRecord callbacks and observers.

Re: [rspec-users] Test Design Question #2

2011-03-31 Thread Pat Maddox
Use mocks to define your interface, not to define TCPSocket directly. I would suggest running a TCP server just to test your wrapping object. Pat On Mar 30, 2011, at 9:34 AM, Curtis j Schofield wrote: > I am designing a test around a class that interacts with TCPSocket - I > have used a mock a

[rspec-users] Test Design Question #1

2011-03-30 Thread Curtis j Schofield
I have an model in rails with an after_create that generates another object (for the purpose of making an audit trail). In the unit test - i want to verify this behavior. This behaviour - in other tests is breaking some exceptions around (include) - since the creation of the new audit trail is le

[rspec-users] Test Design Question #2

2011-03-30 Thread Curtis j Schofield
I am designing a test around a class that interacts with TCPSocket - I have used a mock and have asserted as minimal an interface as I can - centered around the IO methods. Should i be using a stub instead and stub on open and read - instead of mock with open, read , close and so forth. Is there

Re: [rspec-users] Test Spies for RSpec 2

2011-01-21 Thread Tom Stuart
If the idea of having to say 'stubs(:method)' for every method that you're going to call and verify, give my new mocking library Matahari a go: https://github.com/mortice/matahari It's brand new and deficient in many ways but I'm planning on improving it and it sounds like we appreciate the sa

Re: [rspec-users] Test Spies for RSpec 2

2011-01-21 Thread JDeville
Scott, check out Bourne. It's an add on to mocha that gives you spies. I'm using it, and like it a lot. On Dec 2 2010, 8:53 am, David Chelimsky wrote: > On Dec 2, 2010, at 1:44 AM, Scott Bellware wrote: > > > I've tried three test spy mocking frameworks for RSpec that I know of. > > Presently,

Re: [rspec-users] Test Spies for RSpec 2

2010-12-02 Thread David Chelimsky
On Dec 2, 2010, at 1:44 AM, Scott Bellware wrote: > I've tried three test spy mocking frameworks for RSpec that I know of. > Presently, all three (Not A Mock, RR, rspec-spies) don't work with > RSpec 2. Have you contacted the maintainers of the projects that offer spies? I'm a bit surprised they

[rspec-users] Test Spies for RSpec 2

2010-12-01 Thread Scott Bellware
I've tried three test spy mocking frameworks for RSpec that I know of. Presently, all three (Not A Mock, RR, rspec-spies) don't work with RSpec 2. Does anyone have a line on any other mocking frameworks for RSpec 2 that allow the AAA style to be supported? I'm really hoping to not have to roll of

Re: [rspec-users] test spies

2010-04-13 Thread David Chelimsky
On Apr 12, 2010, at 2:38 PM, Michael Guterl wrote: > On Mon, Apr 12, 2010 at 1:16 PM, David Chelimsky wrote: >> On Apr 12, 2010, at 11:17 AM, Michael Guterl wrote: >> >>> I'm curious what the current state of test spies in rspec is? >>> >>> What is everyone using for this? not a mock? rr? rs

Re: [rspec-users] test spies

2010-04-12 Thread Michael Guterl
On Mon, Apr 12, 2010 at 1:16 PM, David Chelimsky wrote: > On Apr 12, 2010, at 11:17 AM, Michael Guterl wrote: > >> I'm curious what the current state of test spies in rspec is? >> >> What is everyone using for this?  not a mock?  rr?  rspec-spies? >> I see that spies were going to be added to rspe

Re: [rspec-users] test spies

2010-04-12 Thread David Chelimsky
On Apr 12, 2010, at 11:17 AM, Michael Guterl wrote: > I'm curious what the current state of test spies in rspec is? > > What is everyone using for this? not a mock? rr? rspec-spies? > I see that spies were going to be added to rspec 1.3.0, but pulled > because of a bug > (https://rspec.lightho

[rspec-users] test spies

2010-04-12 Thread Michael Guterl
I'm curious what the current state of test spies in rspec is? What is everyone using for this? not a mock? rr? rspec-spies? I see that spies were going to be added to rspec 1.3.0, but pulled because of a bug (https://rspec.lighthouseapp.com/projects/5645/tickets/938), will this be brought back

Re: [rspec-users] test-unit oddities

2010-01-13 Thread rogerdpack
> so the question is...whose fault is this? gems? rails? I think it's rails' fault for not being careful when running $LOAD_PATH.uniq! ... -r ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

[rspec-users] test-unit oddities

2010-01-13 Thread rogerdpack
I think I've tracked down why rspec dislikes test-unit gems > 1.3.5 this code: gem 'rails', '= 2.3.5' puts $LOAD_PATH.find{|l| l.instance_variables.include? (:@gem_prelude_index)} puts $LOAD_PATH.uniq.find{|l| l.instance_variables.include? (:@gem_prelude_index)} [if you take off the '= 2.3.5' i

Re: [rspec-users] Test doubles: expect "x" and don't care about anything else

2009-06-29 Thread Wincent Colaiuta
El 29/6/2009, a las 17:15, Wincent Colaiuta escribió: El 29/6/2009, a las 16:26, Ben Mabey escribió: You probably know this, but for the benefit of others... Pat made a change a while back that makes it so the stubbed return value will still be returned even if an expectation is added. Mea

Re: [rspec-users] Test doubles: expect "x" and don't care about anything else

2009-06-29 Thread Wincent Colaiuta
El 29/6/2009, a las 16:26, Ben Mabey escribió: You probably know this, but for the benefit of others... Pat made a change a while back that makes it so the stubbed return value will still be returned even if an expectation is added. Meaning, assuming the stub is in the before block, you ca

Re: [rspec-users] Test doubles: expect "x" and don't care about anything else

2009-06-29 Thread Ben Mabey
Matt Wynne wrote: On 28 Jun 2009, at 23:02, Wincent Colaiuta wrote: El 28/6/2009, a las 23:04, Matt Wynne escribió: On 28 Jun 2009, at 13:07, Wincent Colaiuta wrote: I've had one of my recurring doubts about test doubles come up again. The full post is here but I'll abbreviate the content

Re: [rspec-users] Test doubles: expect "x" and don't care about anything else

2009-06-29 Thread Wincent Colaiuta
El 29/6/2009, a las 9:33, Matt Wynne escribió: On 28 Jun 2009, at 23:02, Wincent Colaiuta wrote: El 28/6/2009, a las 23:04, Matt Wynne escribió: On 28 Jun 2009, at 13:07, Wincent Colaiuta wrote: I've had one of my recurring doubts about test doubles come up again. The full post is here

Re: [rspec-users] Test doubles: expect "x" and don't care about anything else

2009-06-29 Thread Matt Wynne
On 28 Jun 2009, at 23:02, Wincent Colaiuta wrote: El 28/6/2009, a las 23:04, Matt Wynne escribió: On 28 Jun 2009, at 13:07, Wincent Colaiuta wrote: I've had one of my recurring doubts about test doubles come up again. The full post is here but I'll abbreviate the content in this messag

Re: [rspec-users] Test doubles: expect "x" and don't care about anything else

2009-06-28 Thread Wincent Colaiuta
El 28/6/2009, a las 23:04, Matt Wynne escribió: On 28 Jun 2009, at 13:07, Wincent Colaiuta wrote: I've had one of my recurring doubts about test doubles come up again. The full post is here but I'll abbreviate the content in this message in any case: https://wincent.com/blog/thinking-abou

Re: [rspec-users] Test doubles: expect "x" and don't care about anything else

2009-06-28 Thread Matt Wynne
On 28 Jun 2009, at 13:07, Wincent Colaiuta wrote: I've had one of my recurring doubts about test doubles come up again. The full post is here but I'll abbreviate the content in this message in any case: https://wincent.com/blog/thinking-about-switching-to-rr Basically, in one of my contr

[rspec-users] Test doubles: expect "x" and don't care about anything else

2009-06-28 Thread Wincent Colaiuta
I've had one of my recurring doubts about test doubles come up again. The full post is here but I'll abbreviate the content in this message in any case: https://wincent.com/blog/thinking-about-switching-to-rr Basically, in one of my controller specs I wanted to verify that the following

Re: [rspec-users] Test JSON with Cucumber

2009-05-11 Thread Bill Kocik
ooh - I love this solution. The downsides that immediately come to mind are that I'd be putting XPath expressions in my acceptance tests which aren't necessarily readable, but since I'm the only one who has to read them that's alright, and that I have to parse JSON into a hash, convert the hash to

Re: [rspec-users] Test JSON with Cucumber

2009-05-11 Thread Zach Dennis
On Mon, May 11, 2009 at 5:31 PM, Bill Kocik wrote: > On Mon, May 11, 2009 at 4:32 PM, Ben Mabey wrote: > >> Well.. IIRC ActiveSupport::JSON.decode will return a ruby hash of the JSON, >> correct?  So you should be able to make expectations on it just like a >> regular hash object. > > You're abso

Re: [rspec-users] Test JSON with Cucumber

2009-05-11 Thread Michael Schuerig
On Monday 11 May 2009, Bill Kocik wrote: > On Mon, May 11, 2009 at 4:32 PM, Ben Mabey wrote: > > Well.. IIRC ActiveSupport::JSON.decode will return a ruby hash of > > the JSON, correct? So you should be able to make expectations on > > it just like a regular hash object. > > You're absolutely cor

Re: [rspec-users] Test JSON with Cucumber

2009-05-11 Thread Bill Kocik
On Mon, May 11, 2009 at 4:32 PM, Ben Mabey wrote: > Well.. IIRC ActiveSupport::JSON.decode will return a ruby hash of the JSON, > correct?  So you should be able to make expectations on it just like a > regular hash object. You're absolutely correct - I think I did a poor job of asking my questi

Re: [rspec-users] Test JSON with Cucumber

2009-05-11 Thread Ben Mabey
Bill Kocik wrote: Hi Folks - I'm hoping someone has come before me in trying to do this. I want to use Cucumber to acceptance-test my JSON output. So far all I can do is validate that the JSON is valid, with this step: Then /^I should get valid JSON$/ do assert_nothing_raised do ActiveSup

[rspec-users] Test JSON with Cucumber

2009-05-11 Thread Bill Kocik
Hi Folks - I'm hoping someone has come before me in trying to do this. I want to use Cucumber to acceptance-test my JSON output. So far all I can do is validate that the JSON is valid, with this step: Then /^I should get valid JSON$/ do assert_nothing_raised do ActiveSupport::JSON.decode(@r

Re: [rspec-users] Test for a gem/plugin?

2008-12-11 Thread James Byrne
Pat Maddox wrote: >> >> Scenario: Application has known users >> Given that the application has users >> When the user signs on >> Then the user is authenticated > > WTBV? > > (Where's the business value (I totally made that up, but I'm gonna stick > with it :)) I like it too. That said, r

Re: [rspec-users] Test for a gem/plugin?

2008-12-11 Thread Pat Maddox
James Byrne writes: > Matt Wynne wrote: >> On 9 Dec 2008, at 19:06, James Byrne wrote: >> >>> should >>> >>> When /authentication by authlogic/ do >>> #TODO: Find out how to test for a loaded gem within an application >>> end >> >> If you're working at the level of Cucumber features, I would s

Re: [rspec-users] Test for a gem/plugin?

2008-12-11 Thread James Byrne
Ashley Moran wrote: > > Then you already have the name to verify if you want to display a > personalised message. (On the other hand, putting too much data in > the steps gets cumbersome; I tend to write them more like this: > >Scenario: A known user signs in successfully > Given I am

Re: [rspec-users] Test for a gem/plugin?

2008-12-11 Thread Ashley Moran
On 10 Dec 2008, at 17:40, James Byrne wrote: So, if I understand you correctly, then I should write features somewhat like this: Scenario: A known user signs in successfully Given a known user "myuser" with a password "myuserpassword" When user "myuser" signs on with a password "myuserpass

Re: [rspec-users] Test for a gem/plugin?

2008-12-10 Thread Andrew Premdas
I put a starter application with a bunch of features to test authorisation code implemented by Restful Authentication on Github a few days ago. In theory you could apply these features directly to your Authlogic implementation. http://github.com/diabolo/fbrp/tree/master All best Andrew 2008/12/

Re: [rspec-users] Test for a gem/plugin?

2008-12-10 Thread James Byrne
Ashley Moran wrote: > > Don't confuse library code with code you write to use this library. > The AuthLogic config in your app is code too, and it adds behaviours > to your app. The fact there are 10, 100 or 10,000 lines of code > behind it is irrelevant. So, if I understand you correctly, then

Re: [rspec-users] Test for a gem/plugin?

2008-12-10 Thread Matt Wynne
On 10 Dec 2008, at 16:26, James Byrne wrote: James Byrne wrote: Of course, the last example should have been: When /user is authenticated/ do # We use Authlogic for authentication so just test that gem is loaded assert defined?("Authlogic") end To verify that the user has been authenticate

Re: [rspec-users] Test for a gem/plugin?

2008-12-10 Thread Ashley Moran
On 10 Dec 2008, at 16:04, James Byrne wrote: Nonetheless, in the step definitions I must test the behaviour in a fashion which first drives and then confirms the implementation details. This is not the path to BDD, it's the path to state-based testing. Matt has already explained this wel

Re: [rspec-users] Test for a gem/plugin?

2008-12-10 Thread James Byrne
James Byrne wrote: Of course, the last example should have been: When /user is authenticated/ do # We use Authlogic for authentication so just test that gem is loaded assert defined?("Authlogic") end -- Posted via http://www.ruby-forum.com/. ___ rs

Re: [rspec-users] Test for a gem/plugin?

2008-12-10 Thread James Byrne
Matt Wynne wrote: > On 9 Dec 2008, at 19:06, James Byrne wrote: > >> should >> >> When /authentication by authlogic/ do >> #TODO: Find out how to test for a loaded gem within an application >> end > > If you're working at the level of Cucumber features, I would stay well > away from implementati

Re: [rspec-users] Test for a gem/plugin?

2008-12-10 Thread Matt Wynne
On 9 Dec 2008, at 19:06, James Byrne wrote: I have decided that for now I am going to use the authlogic gem to provide authentication for the project I am creating. The question arises, since authentication is a user feature request and since it is to be satisfied through the use of a gem (not

[rspec-users] Test for a gem/plugin?

2008-12-09 Thread James Byrne
I have decided that for now I am going to use the authlogic gem to provide authentication for the project I am creating. The question arises, since authentication is a user feature request and since it is to be satisfied through the use of a gem (not a plugin) then should one test for the availabi

Re: [rspec-users] Test::Unit Functional failure puzzle

2008-11-24 Thread Matt Wynne
On 24 Nov 2008, at 17:56, James Byrne wrote: Matt Wynne wrote: Make sense? Matt Yes. I am afraid that my original post is based upon a naive sense of how things work in this environment. Clearly, whenever one is dealing with human input then the possibility of incomplete, contradictory,

Re: [rspec-users] Test::Unit Functional failure puzzle

2008-11-24 Thread James Byrne
Matt Wynne wrote: > > Make sense? > Matt Yes. I am afraid that my original post is based upon a naive sense of how things work in this environment. Clearly, whenever one is dealing with human input then the possibility of incomplete, contradictory, or simply wrong data must be accommodated

Re: [rspec-users] Test::Unit Functional failure puzzle

2008-11-24 Thread Mark Wilden
On Sun, Nov 23, 2008 at 10:51 AM, Zach Dennis <[EMAIL PROTECTED]> wrote: > > def create > @user = User.create! params[:user] > rescue ActiveRecord::RecordInvalid > # this won't work, because @user never gets assigned, since > create! raised an exception > render :action => "new" >

Re: [rspec-users] Test::Unit Functional failure puzzle

2008-11-24 Thread Matt Wynne
On 21 Nov 2008, at 14:44, James Byrne wrote: David Chelimsky wrote: Without seeing the controller code, I'd guess that the controller uses create, and not create! and that a validation failure is not getting reported anywhere. If so, try changing create to create! and you should get your

Re: [rspec-users] Test::Unit Functional failure puzzle

2008-11-24 Thread Zach Dennis
Bah, hit send on accident... here's the last create! example... def create @user = User.create! params[:user] rescue ActiveRecord::RecordInvalid # this won't work, because @user never gets assigned, since create! raised an exception render :action => "new" end In any of the

Re: [rspec-users] Test::Unit Functional failure puzzle

2008-11-24 Thread Zach Dennis
On Fri, Nov 21, 2008 at 9:44 AM, James Byrne <[EMAIL PROTECTED]> wrote: > David Chelimsky wrote: > >> >> Without seeing the controller code, I'd guess that the controller uses >> create, and not create! and that a validation failure is not getting >> reported anywhere. >> >> If so, try changing cre

Re: [rspec-users] Test::Unit Functional failure puzzle

2008-11-23 Thread James Byrne
David Chelimsky wrote: > > Without seeing the controller code, I'd guess that the controller uses > create, and not create! and that a validation failure is not getting > reported anywhere. > > If so, try changing create to create! and you should get your error. > Thank you. You were close eno

Re: [rspec-users] Test::Unit Functional failure puzzle

2008-11-20 Thread David Chelimsky
On Thu, Nov 20, 2008 at 1:30 PM, James Byrne <[EMAIL PROTECTED]> wrote: > Not an RSpec question, but I was led to this problem by starting to use > autotest with cucumber and so, however unjustly, I feel that RSpec has > to shoulder some of the blame. > > I have a failing test in my clients_control

[rspec-users] Test::Unit Functional failure puzzle

2008-11-20 Thread James Byrne
Not an RSpec question, but I was led to this problem by starting to use autotest with cucumber and so, however unjustly, I feel that RSpec has to shoulder some of the blame. I have a failing test in my clients_controller test and I cannot figure out what is wrong from the information provided from

Re: [rspec-users] Test HTML output from Rails helper

2008-10-19 Thread Pat Maddox
"Zach Dennis" <[EMAIL PROTECTED]> writes: > On Sat, Oct 18, 2008 at 11:34 AM, Nick Hoffman <[EMAIL PROTECTED]> wrote: >> On 2008-10-18, at 09:16, Pat Maddox wrote: >>> >>> Scott Taylor <[EMAIL PROTECTED]> writes: You'd be able to write a spec like the following: it "should link

Re: [rspec-users] Test HTML output from Rails helper

2008-10-18 Thread Ashley Moran
On Oct 18, 2008, at 10:50 am, Scott Taylor wrote: No - that's not really an option. The rails stack has no idea about a DOM. One option, though, is to stub methods and use message expectations. For instance, if you had a helper like the following: Hi Scott Another option would be Hpr

Re: [rspec-users] Test HTML output from Rails helper

2008-10-18 Thread Scott Taylor
On Oct 18, 2008, at 9:16 AM, Pat Maddox wrote: Scott Taylor <[EMAIL PROTECTED]> writes: On Oct 18, 2008, at 4:40 AM, Thomas Watson Steen wrote: Hi I'm using RSpec in with Ruby on Rails. I've made a helper module method that generates some HTML and would like to create a rspec test to valid

Re: [rspec-users] Test HTML output from Rails helper

2008-10-18 Thread Zach Dennis
On Sat, Oct 18, 2008 at 11:34 AM, Nick Hoffman <[EMAIL PROTECTED]> wrote: > On 2008-10-18, at 09:16, Pat Maddox wrote: >> >> Scott Taylor <[EMAIL PROTECTED]> writes: >>> >>> You'd be able to write a spec like the following: >>> >>> it "should link with the correct name" do >>> helper.should_receiv

Re: [rspec-users] Test HTML output from Rails helper

2008-10-18 Thread Mark Wilden
On Sat, Oct 18, 2008 at 6:16 AM, Pat Maddox <[EMAIL PROTECTED]> wrote: > Does have_tag work with plain strings > Yep, it does. That's how I spec #to_amcharts. :) ///ark ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailma

Re: [rspec-users] Test HTML output from Rails helper

2008-10-18 Thread Nick Hoffman
On 2008-10-18, at 09:16, Pat Maddox wrote: Scott Taylor <[EMAIL PROTECTED]> writes: You'd be able to write a spec like the following: it "should link with the correct name" do helper.should_receive(:link_to).with("foo", {:controller => "foo", :action => "foo"}) helper.my_method("foo") end

Re: [rspec-users] Test HTML output from Rails helper

2008-10-18 Thread Pat Maddox
Scott Taylor <[EMAIL PROTECTED]> writes: > On Oct 18, 2008, at 4:40 AM, Thomas Watson Steen wrote: > >> Hi >> >> I'm using RSpec in with Ruby on Rails. I've made a helper module >> method that generates some HTML and would like to create a rspec >> test to validate this HTML. I can of cause use re

Re: [rspec-users] Test HTML output from Rails helper

2008-10-18 Thread Scott Taylor
On Oct 18, 2008, at 4:40 AM, Thomas Watson Steen wrote: Hi I'm using RSpec in with Ruby on Rails. I've made a helper module method that generates some HTML and would like to create a rspec test to validate this HTML. I can of cause use regex to validate it as a string, but would much rat

[rspec-users] Test HTML output from Rails helper

2008-10-18 Thread Thomas Watson Steen
Hi I'm using RSpec in with Ruby on Rails. I've made a helper module method that generates some HTML and would like to create a rspec test to validate this HTML. I can of cause use regex to validate it as a string, but would much rather validate it by traversing the DOM and checking that t

Re: [rspec-users] test - ignore

2008-06-13 Thread Pat Maddox
Green! On Fri, Jun 13, 2008 at 10:44 AM, Chuck Remes <[EMAIL PROTECTED]> wrote: > Verify I can successfully send to the list. > ___ > rspec-users mailing list > rspec-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users > _

[rspec-users] test - ignore

2008-06-13 Thread Chuck Remes
Verify I can successfully send to the list. ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] test log

2008-05-16 Thread Ben Mabey
Jonathan Linowes wrote: Is there an easy way to inject each example text into test.log so I can isolate the log output per example? ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users You could cr

[rspec-users] test log

2008-05-16 Thread Jonathan Linowes
Is there an easy way to inject each example text into test.log so I can isolate the log output per example? ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Test data problem (in general and with acts_as_tree)

2008-02-26 Thread Edvard Majakari
> Yeah but then I get to say RTFM. Right now, TFM doesn't exist :( rant << EOF Indeed. People see much trouble in writing documentation so that they don't have to answer the same questions ad nauseam. It would be nice if we appreciated their efforts and check the documentation first. EOF -- "

Re: [rspec-users] Test data problem (in general and with acts_as_tree)

2008-02-26 Thread David Chelimsky
On Tue, Feb 26, 2008 at 8:31 AM, Max Williams <[EMAIL PROTECTED]> wrote: > hehe, tbh even if the documentation had been there i probably wouldn't have > read it :) Yeah but then I get to say RTFM. Right now, TFM doesn't exist :( > > thanks! > > > > On 26/02/2008, David Chelimsky <[EMAIL PROTECTED

Re: [rspec-users] Test data problem (in general and with acts_as_tree)

2008-02-26 Thread Max Williams
hehe, tbh even if the documentation had been there i probably wouldn't have read it :) thanks! On 26/02/2008, David Chelimsky <[EMAIL PROTECTED]> wrote: > > On Tue, Feb 26, 2008 at 8:08 AM, Max Williams > > <[EMAIL PROTECTED]> wrote: > > > > > > > > On 26/02/2008, David Chelimsky <[EMAIL PROTECTE

Re: [rspec-users] Test data problem (in general and with acts_as_tree)

2008-02-26 Thread David Chelimsky
On Tue, Feb 26, 2008 at 8:08 AM, Max Williams <[EMAIL PROTECTED]> wrote: > > > > On 26/02/2008, David Chelimsky <[EMAIL PROTECTED]> wrote: > > > > On Tue, Feb 26, 2008 at 7:39 AM, Max Williams > > <[EMAIL PROTECTED]> wrote: > > > > > > > > This does not happen for you implicitly when you use before

Re: [rspec-users] Test data problem (in general and with acts_as_tree)

2008-02-26 Thread Max Williams
On 26/02/2008, David Chelimsky <[EMAIL PROTECTED]> wrote: > > On Tue, Feb 26, 2008 at 7:39 AM, Max Williams > <[EMAIL PROTECTED]> wrote: > > > This does not happen for you implicitly when you use before(:all) > because there is no mechanism for running a group of examples in a > transaction. ah..

Re: [rspec-users] Test data problem (in general and with acts_as_tree)

2008-02-26 Thread David Chelimsky
On Tue, Feb 26, 2008 at 7:39 AM, Max Williams <[EMAIL PROTECTED]> wrote: > I'm using before(:all) because i want to create a single 'family' of tree > objects and then run tests against it. If i have all the object creation as > a before(:each) then the database will be even more full of duplicati

Re: [rspec-users] Test data problem (in general and with acts_as_tree)

2008-02-26 Thread Max Williams
I'm using before(:all) because i want to create a single 'family' of tree objects and then run tests against it. If i have all the object creation as a before(:each) then the database will be even more full of duplications, won't it? My problem, though, is that the data is left over from the last

Re: [rspec-users] Test data problem (in general and with acts_as_tree)

2008-02-26 Thread David Chelimsky
On Tue, Feb 26, 2008 at 5:41 AM, Edvard Majakari <[EMAIL PROTECTED]> wrote: > > My problems seem to be arising from the fact that when i run the test, the > > objects i created last time are still in the database. Shouldn't they be > > cleared out automatically? This in turn is preventing me fr

Re: [rspec-users] Test data problem (in general and with acts_as_tree)

2008-02-26 Thread Edvard Majakari
> My problems seem to be arising from the fact that when i run the test, the > objects i created last time are still in the database. Shouldn't they be > cleared out automatically? This in turn is preventing me from saving root I don't know RSpec that well, but I'd guess before(:all) is run only

[rspec-users] Test data problem (in general and with acts_as_tree)

2008-02-26 Thread Max Williams
Hi all I'm having problems with data in my specs - i'm probably just going about things the wrong way though. I'm testing a model (called Property) that uses acts_as_tree, and for now have just done some specs for the basic acts_as_tree functionality - just as a sanity check, i thought, but i'm g

Re: [rspec-users] test

2008-02-15 Thread Colin Campbell-McPherson
Now implement and refractor and you're correctly doing BDD. On 16/02/2008, at 12:11 AM, [EMAIL PROTECTED] wrote: > test > ___ > rspec-users mailing list > rspec-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users ___

Re: [rspec-users] test

2008-02-15 Thread Rick DeNatale
On Fri, Feb 15, 2008 at 10:27 AM, David Chelimsky <[EMAIL PROTECTED]> wrote: > D'oh! Let's try that again. > > behave Austin "Chelimsky" Powers ?! -- Rick DeNatale My blog on Ruby http://talklikeaduck.denhaven2.com/ ___ rspec-users mailing list rspe

Re: [rspec-users] test

2008-02-15 Thread David Chelimsky
D'oh! Let's try that again. behave On Fri, Feb 15, 2008 at 10:25 AM, Mike Vincent <[EMAIL PROTECTED]> wrote: > On Fri, Feb 15, 2008 at 9:11 AM, [EMAIL PROTECTED] > <[EMAIL PROTECTED]> wrote: > > test > > 1 tests, 0 assertions, 0 failures, 0 errors > > >

Re: [rspec-users] test

2008-02-15 Thread Mike Vincent
On Fri, Feb 15, 2008 at 9:11 AM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > test 1 tests, 0 assertions, 0 failures, 0 errors ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

[rspec-users] test

2008-02-15 Thread [EMAIL PROTECTED]
test ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Test case for file import

2007-11-14 Thread aslak hellesoy
On 11/14/07, Karni Karni <[EMAIL PROTECTED]> wrote: > Karni Karni wrote: > > aslak hellesoy wrote: > > > > Could u pls give any URL form u written this code? > > Thanks for ur reply. But in my case the total code is in the controller. It shouldn't be. Put business logic in the model. http://weblo

Re: [rspec-users] Test case for file import

2007-11-14 Thread Karni Karni
Karni Karni wrote: > aslak hellesoy wrote: > > Could u pls give any URL form u written this code? Thanks for ur reply. But in my case the total code is in the controller. I' submitting the from to a specific action with CSV file. Hoew can I pass my CSV file to that specific action -- Posted vi

Re: [rspec-users] Test case for file import

2007-11-14 Thread Karni Karni
aslak hellesoy wrote: Could u pls give any URL form u written this code? -- 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] Test case for file import

2007-11-13 Thread aslak hellesoy
look at the RDoc for should change... describe Task do fixtures :tasks # should put 2 tasks in the database it "should not import twice from CSV" do csv = File.dirname(__FILE__) + '/sample.csv' # It should have 4 new tasks lambda do Task.import_from_csv(csv) end.should chang

Re: [rspec-users] Test case for file import

2007-11-13 Thread Karni Karni
aslak hellesoy wrote: > On Nov 12, 2007 11:36 AM, KarniRevuri <[EMAIL PROTECTED]> wrote: >> typical windows file open controls." >> >> >> Please give me any ideas >> > > Is this related to the post that you replied to? > Your question is too vague. Can you be more specific about what you > need he

Re: [rspec-users] Test case for file import

2007-11-12 Thread aslak hellesoy
On Nov 12, 2007 11:36 AM, KarniRevuri <[EMAIL PROTECTED]> wrote: > > I want to write below specs > > specify "The system allows users to import a pre-formatted CSV file into > project." > specify "Each row in the spreadsheet is imported as one new Task." > specify "The import WILL NOT update ex

Re: [rspec-users] Test case for file import

2007-11-12 Thread KarniRevuri
I want to write below specs specify "The system allows users to import a pre-formatted CSV file into project." specify "Each row in the spreadsheet is imported as one new Task." specify "The import WILL NOT update existing tasks." specify "If the import file has any records that fail due t

  1   2   >