Re: [rspec-users] [Q] testing WIN32OLE_EVENT callbacks

2009-08-27 Thread Matt Wynne
On 26 Aug 2009, at 19:57, Chuck Remes wrote: I'm trying to setup some specs (really just assertions) that verify some callbacks are executed in response to COM events. In the WIN32OLE_EVENT class you may subscribe to a COM event and have it delivered to you for processing. Syntax looks lik

Re: [rspec-users] [Q] testing WIN32OLE_EVENT callbacks

2009-08-27 Thread Matt Wynne
On 27 Aug 2009, at 17:02, Chuck Remes wrote: On Aug 27, 2009, at 10:12 AM, Matt Wynne wrote: On 26 Aug 2009, at 19:57, Chuck Remes wrote: I'm trying to setup some specs (really just assertions) that verify some callbacks are executed in response to COM events. In the WIN32OLE_

Re: [rspec-users] Using "with(params)" with stubs make any sense?

2009-08-30 Thread Matt Wynne
On 28 Aug 2009, at 19:44, Marcelo de Moraes Serpa wrote: Hello list, Since stubs don't set expectations, do we have any use-case where stubbing like this makes sense: @mock.stub!(:method).with(anything()).and_return(@collection). It is clear that and_return is the value from stubbing, but

Re: [rspec-users] Using ActiveRecord without Rails

2009-09-01 Thread Matt Wynne
On 1 Sep 2009, at 19:44, Rick DeNatale wrote: On Tue, Sep 1, 2009 at 1:51 PM, Carl Graff wrote: Of less importance: Actually I have considered creating/converting these integration applications as full blown Rails applications since they definitely have a model and controller aspect and

Re: [rspec-users] Fixture replacement vs mock model

2009-09-01 Thread Matt Wynne
On 1 Sep 2009, at 21:11, Jeremy Hageman wrote: As someone relatively new to rspec, I am interested in hearing the wisdom of the group in the area of using a fixture replacement gem (such as machinist or factory girl) instead of mocking the model. To me it seems that using a fixture replacement,

Re: [rspec-users] Nested Partials

2009-09-03 Thread Matt Wynne
On 3 Sep 2009, at 04:29, amkirwan wrote: What is the best way to spec nested partials in rails? Here is the generic type of nesting I am trying to spec. new.html.erb edit.html.erb _outer_partial.html.erb _inner_partial.html.erb Can you be any more specific about the behaviour you wa

Re: [rspec-users] controller specs with non-RESTful routes

2009-09-14 Thread Matt Wynne
On 11 Sep 2009, at 21:28, Giuseppe Bertini wrote: Hello list, this should be an easy one, but I seem to be stuck. What is the proper way to mimic a POST request for a named, non- RESTful route? here's the route and the rest of the setup: map.accept_invitation '/accept_invitation/:id', :cont

Re: [rspec-users] Need Help

2009-09-22 Thread Matt Wynne
On 22 Sep 2009, at 06:34, Mithun Perera wrote: Mithun Perera wrote: Hi all, I am an university student and these days i am on training period. So i want to know about ruby on on rails "cucumber and Rspec". If somebody know about these fields please help me. If not please send me an tutorial

Re: [rspec-users] Need Help

2009-09-25 Thread Matt Wynne
On 25 Sep 2009, at 08:07, Mithun Perera wrote: Mithun Perera wrote: Mithun Perera wrote: Hi all, I am an university student and these days i am on training period. So i want to know about ruby on on rails "cucumber and Rspec". If somebody know about these fields please help me. If not pl

Re: [rspec-users] Need immeadiate help

2009-09-29 Thread Matt Wynne
On 30 Sep 2009, at 06:53, Mithun Perera wrote: Hi all, I am going to do testing using Rspec. But i have no idea about that . so i need good tutorial for that. if anybody has such tutorials please help me by sending them. thanks, mithun http://blog.davidchelimsky.net/2007/05/14/an-introduc

Re: [rspec-users] Grabbing the controller name before a new test case

2009-10-01 Thread Matt Wynne
On 1 Oct 2009, at 00:56, Hates_ wrote: I currently have: describe Publishers::PagesController I want to be able to grab the path "publishers/pages/ and use that to generate a load of tests automatically. Problem is I can't figure out how to do it outside of my "it" block. Any help is greatly

Re: [rspec-users] Running a specific row in cucumber example table

2009-10-02 Thread Matt Wynne
On 2 Oct 2009, at 17:16, Sam Treweek wrote: I want to be able to execute only 1 row in an Scenario/Outline Example table. Is there a method already created for me to access. I have certain validation rules for only running 1 row of data coming from an external request to execute cuke. So havin

Re: [rspec-users] Running a specific row in cucumber example table

2009-10-05 Thread Matt Wynne
On 5 Oct 2009, at 09:49, Zoltan Penzeli wrote: I have no idea if this will work, but you could try to sense for the table row you want to skip in a Before block, then call skip_invoke! on it: Before(scenario_or_example_row) do if the_one_to_skip?(scenario_or_example_row) scenario_or_ex

Re: [rspec-users] spec-ing private methods?

2009-10-14 Thread Matt Wynne
On 14 Oct 2009, at 20:49, Scott Taylor wrote: On Oct 14, 2009, at 3:36 PM, Joaquin Rivera Padron wrote: hello there, how do you tipically spec private methods? The thing is Ï have something like this: You have a few options: 1. Make the method public in the object you are testing 2. Make

Re: [rspec-users] spec-ing private methods?

2009-10-14 Thread Matt Wynne
On 14 Oct 2009, at 22:33, Matt Wynne wrote: On 14 Oct 2009, at 20:49, Scott Taylor wrote: On Oct 14, 2009, at 3:36 PM, Joaquin Rivera Padron wrote: hello there, how do you tipically spec private methods? The thing is Ï have something like this: You have a few options: 1. Make the

Re: [rspec-users] Help me with Controllers spec

2009-10-16 Thread Matt Wynne
You're getting mixed up between stubbing the methods on the class (Brand) and the instance (Brand.new) Try the corrections below: On 16 Oct 2009, at 05:25, Elza wrote: I am starting with Rspec and I am having some errors in the Get/index Can someone help me with this? describe BrandsContro

Re: [rspec-users] How can I spec protect method

2009-10-21 Thread Matt Wynne
On 21 Oct 2009, at 17:31, Elza wrote: How can I spec the 3rd line of my controller? What does that method do to the other objects in your domain? Can you describe that behaviour easily using mocks and stubs? If not, you would be best to move the method out of the controller and onto an

Re: [rspec-users] Stub that returns hash values

2009-10-21 Thread Matt Wynne
Hi Carl, Some thoughts below... On 21 Oct 2009, at 18:12, Carl Graff wrote: Well i just started using RSpec about a week ago and mostly I was just trying to learn how to use mocks as I could have easily just created the real object in this case. Anyway, I had a real object, that needed to

Re: [rspec-users] Rspec Tutorial

2009-10-28 Thread Matt Wynne
I did have a crack at writing some 'ground rules' a while back after we had quite a bit of chump-traffic: http://wiki.github.com/dchelimsky/rspec/get-in-touch It would be good to have a single URL we can reply with when people send these kind of feckless requests. Maybe the problem with that

Re: [rspec-users] Problem with before filters

2009-11-02 Thread Matt Wynne
On 2 Nov 2009, at 14:19, David Chelimsky wrote: On Nov 2, 2009, at 3:35 AM, Amit Kulkarni wrote: Following is the scenario. describe BbPostsController, "POST Create" do context "Admin" do fixtures :users, :bb_posts, :user_channels, :channels, :channel_features it "should save post" do

Re: [rspec-users] [BDD] View specs and cucumber -- duplication of effort?

2009-11-09 Thread Matt Wynne
On 4 Nov 2009, at 15:56, Andrew Premdas wrote: 2009/10/29 nruth Hi Guys I'm going to put the cat amongst the pigeons here in the hope of some clarity falling out of the sky on me. My question is this: In a world with Cucumber what is the value of view specs? In the community (railscamp, for

Re: [rspec-users] Display Rspec output in an html file

2009-11-09 Thread Matt Wynne
On 9 Nov 2009, at 11:13, Amit Kulkarni wrote: Hello, I had written some model scenarios. Now i want to generate that output in an html file. i am executing the models using rake i.e. rake spec:models from spec directory. But the html file is not getting generated. Following is the error trace:

Re: [rspec-users] describe "RSpec's documentation" do

2009-11-09 Thread Matt Wynne
On 6 Nov 2009, at 12:49, David Chelimsky wrote: In the long run, what I'd like is the following: * Cucumber features that ship with RSpec become the authoritative end-user documentation. This is something that anybody can contribute to with patches, as it's all in files that ship with RS

Re: [rspec-users] Display Rspec output in an html file

2009-11-09 Thread Matt Wynne
On 10 Nov 2009, at 06:46, Amit Kulkarni wrote: Yes i get an error message as rake aborted. spec/models/survey_spec.rb" --format html:result.html failed Have you looked in the survey_spec.rb file to see if there's a problem then? Does the 'error message' give you a line number to look at?

Re: [rspec-users] rspec-rails gem changing connection adapter

2009-11-18 Thread Matt Wynne
On 18 Nov 2009, at 18:39, David Nawara wrote: This thread should be titled: "rspec-rails gem changing connection adapter?" I did some puts's and found that something is changing the connection adapter to ActiveRecord::ConnectionAdapters::SQLite3Adapter, from my specified ActiveRecord::Connecti

Re: [rspec-users] Cucumber Cygwin

2009-11-24 Thread Matt Wynne
On 24 Nov 2009, at 11:01, Peter Ritchie wrote: Peter Ritchie wrote: Aslak Hellesøy wrote: Stuck as to what dependency is calling for cucumber 0.4.4 - config/environments/cucumber.rb? (Failing that - search for the string "0.4.4" among your project's files) we want to stick to 0.4.3 but C

Re: [rspec-users] Introductory recommendations?

2009-11-25 Thread Matt Wynne
+1 And have a coding dojo ASAP. It's much easier to learn when you're having fun. On 25 Nov 2009, at 18:07, Pat Maddox wrote: Pair with them. How big's the team? Lots of ways you can do this. If there are 5 other devs, you can pair with one each day, bam, training in a week. If there are

Re: [rspec-users] Stubbing helper methods in controller specs when integrate_views is On

2009-11-26 Thread Matt Wynne
On 25 Nov 2009, at 16:02, Krasimir Angelov wrote: Hi all, I'm using rspec-caching-test-plugin to test caching (obviously) in my controller specs. Because views are also involved in caching integrate_views have to be turned On. The problem comes when mock is passed to a helper, for examle

Re: [rspec-users] how to test a observer model?

2009-11-26 Thread Matt Wynne
On 26 Nov 2009, at 02:31, Zhenning Guan wrote: I have a user_observer, code like this: def after_create(user) UserMailer.deliver_signup_notification(user) user.random_key = random_key_method user.save end before do @user = mock_model(User) @user_observer = UserObserver.instance end

Re: [rspec-users] spork doesn't find helpers

2009-11-28 Thread Matt Wynne
I should try asking about this on http://groups.google.com/group/sporkgem On 28 Nov 2009, at 00:52, Martin wrote: I forgot to tell you the versions I'm using: spork: 0.7.3 rspec: 1.2.9 rails: 2.3.5 Hi, I'm running into a problem with spork: The helper methods in app/helpers/simpler_helper.r

Re: [rspec-users] Custom Matcher and Webrat methods

2009-12-09 Thread Matt Wynne
On 8 Dec 2009, at 22:04, Rodrigo Rosenfeld Rosas wrote: I would like to be able to write a custom matcher so that I could call this test, for instance: @user.should be_allowed_to_visit(url) @non_welcome.should_not be_allowed_to_visit(url) The matcher would call Webrat methods such as 'visit

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

2009-12-09 Thread Matt Wynne
On 9 Dec 2009, at 19:16, Wincent Colaiuta wrote: El 09/12/2009, a las 19:15, David Chelimsky escribió: On Wed, Dec 9, 2009 at 11:55 AM, Pat Maddox > wrote: [...@admin, @allowed_user].should all(be_allowed_to_visit(url)) [...@admin, @allowed_user].should all_be_allowed_to_visit(url) On Dec

Re: [rspec-users] Custom Matcher and Webrat methods

2009-12-10 Thread Matt Wynne
On 10 Dec 2009, at 00:53, Rodrigo Rosenfeld Rosas wrote: Matt Wynne escreveu: On 8 Dec 2009, at 22:04, Rodrigo Rosenfeld Rosas wrote: I would like to be able to write a custom matcher so that I could call this test, for instance: @user.should be_allowed_to_visit(url

Re: [rspec-users] RSpec wire protocol Was:Re: describe "RSpec's documentation" do

2009-12-11 Thread Matt Wynne
if they wanted some help with that. [1]http://segment7.net/projects/ruby/drb/introduction.html [2]http://fitnesse.org/FitNesse.UserGuide.SliM On Mon, Nov 9, 2009 at 5:03 PM, Matt Wynne wrote: On 6 Nov 2009, at 12:49, David Chelimsky wrote: [3]http://github.com/aslakhellesoy/cucumber/blob/master/featu

Re: [rspec-users] Cuke4PHP Was: RSpec wire protocol Was:Re: describe "RSpec's documentation" do

2009-12-11 Thread Matt Wynne
Let's move this bit of the discussion over to the cukes mailing list. Are you on that list Ed? On 11 Dec 2009, at 22:29, Ed Howland wrote: BTW, does Cuke's wire protocol allow for a mixture of Ruby side and SUT side step definitions? Yes. With Cucumber you can implement steps in a mixture o

Re: [rspec-users] spec'ing controllers

2009-12-16 Thread Matt Wynne
On 16 Dec 2009, at 16:56, Stefan Kanev wrote: Hey guys. I switched completely to RSpec and Cucumber this spring and I am really happy with. While I think I've gotten quite good with it, I'm not sure I understand the value of spec'ing controllers (in Rails). I would appreciate if you can

Re: [rspec-users] spec with user culture

2009-12-23 Thread Matt Wynne
On 23 Dec 2009, at 10:07, Gnagno Gnagno wrote: Sorry, I have one more question, I didn't find the cucumber forum, so please forgive me if I am too much out of topic here. http://wiki.github.com/aslakhellesoy/cucumber/get-in-touch I was trying to achieve the same with cucumber, so I wrot

Re: [rspec-users] be_true and be_false are suddenly undefined

2009-12-24 Thread Matt Wynne
On 24 Dec 2009, at 06:09, Doug wrote: after upgrading cucumber to 5.1 be_true and be_false are undefined switching to == true or == false works. ??? thanks. The rails integration changed quite a bit for that release. See [1] plus a few recent threads on this list. It sounds like your sp

Re: [rspec-users] DB does not reset between runs

2009-12-27 Thread Matt Wynne
Look at your rails logs very carefully and see what's going on, paying special attention to each call to BEGIN TRANSACTION, COMMIT TRANSACTION. When this has happened to me in the past, it was because I had a call to ActiveRecord::Base.connection to do some dirty raw SQL query, and those ca

Re: [rspec-users] Submitting a Custom Matcher: gem or other method?

2009-12-31 Thread Matt Wynne
On 30 Dec 2009, at 22:31, Ashley Moran wrote: Wasn't expecting you to drop everything and build a matcher hosting platform :) I think he should. It is Christmas, and it's not like David ever does anything else for the community ;) cheers, Matt http://mattwynne.net +447974 430184 __

Re: [rspec-users] get to a different controller

2010-01-05 Thread Matt Wynne
Subclass it in your spec with class TestController < Admin::BaseController def index end end ...then use the TestController in your tests for Admin::BaseController. That might mean you'll need to add special routing for TestController which is annoying but can be done. On 5 Jan 2010,

Re: [rspec-users] describe "RSpec's documentation" do

2010-01-06 Thread Matt Wynne
On 5 Jan 2010, at 12:17, Matt Patterson wrote: On 9 Nov 2009, at 22:03, Matt Wynne wrote: On 6 Nov 2009, at 12:49, David Chelimsky wrote: In the long run, what I'd like is the following: * Cucumber features that ship with RSpec become the authoritative end-user documentation. Th

Re: [rspec-users] get to a different controller

2010-01-07 Thread Matt Wynne
On 7 Jan 2010, at 07:22, Wincent Colaiuta wrote: El 07/01/2010, a las 03:53, Phillip Koebbe escribió: Wincent Colaiuta wrote: Well, there is more than one way to skin a cat, but the thing I like about my proposed solution is that: - the specification of the behavior appears in the "desc

Re: [rspec-users] Stubbing through multiple layers

2010-01-09 Thread Matt Wynne
On 9 Jan 2010, at 12:02, David Chelimsky wrote: On Fri, Jan 8, 2010 at 9:37 PM, DeNigris Sean wrote: Hi list, I'm writing an example for a class that represents the "pickaxe" e- book, which I view in Preview.app: describe PickaxeBook do ... it "should tell whether it's ready to re

Re: [rspec-users] nested steps

2010-01-12 Thread Matt Wynne
On 12 Jan 2010, at 22:40, rogerdpack wrote: Question. Currently rspec appears to allow for a two-step test system, like context "abc" it 'should do y' do end end It might be convenient to have an arbitrary number of nests, like context "abc" it 'should do y' do it 'should also be able

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

2010-01-28 Thread Matt Wynne
On 28 Jan 2010, at 21:14, Paul Hinze wrote: 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 argume

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

2010-01-28 Thread Matt Wynne
On 28 Jan 2010, at 21:43, Nicolás Sanguinetti wrote: You're definitely testing too much implementation and not enough behavior. Basically, what you want to spec, is that provided some options, when you call a certain method of your form builder, you get a certain html output. At least that's

Re: [rspec-users] somewhat confused by the help instructions...

2010-01-30 Thread Matt Wynne
On 30 Jan 2010, at 06:45, David Chelimsky wrote: On Thu, Jan 28, 2010 at 12:54 PM, rogerdpack wrote: As a note of feedback, when I do a spec --help, I saw this line... -e, --example [NAME|FILE_NAME] Execute example(s) with matching name(s). If the argument is

Re: [rspec-users] somewhat confused by the help instructions...

2010-02-01 Thread Matt Wynne
On 1 Feb 2010, at 14:53, Phillip Koebbe wrote: David Chelimsky wrote: Agreed: http://github.com/rspec/rspec-core/blob/master/features/command_line/example_name_option.feature Thanks, David. I don't want to sound all gushy or anything, but you have got to be one of the most helpful, cou

Re: [rspec-users] Testing controller plugin

2010-02-01 Thread Matt Wynne
On 1 Feb 2010, at 15:14, Phillip Koebbe wrote: I have just recently started creating some plugins, mainly of the controller variety. I have been looking for a tutorial or other documentation detailing how to go about testing these plugins with RSpec, but have not yet found anything helpful

Re: [rspec-users] Passing parameters to Rspec scripts

2010-02-03 Thread Matt Wynne
One way would be to use an environment variable: $ CUSTOMER=foo spec spec Then read out the customer name in your specs: login = ENV['CUSTOMER'] Otherwise, I would guess you might be able to look at ARGV from within, say, spec_helper.rb but I've never tried it. On 3 Feb 2010, at 03

Re: [rspec-users] When to use Factories, Mock Models, Mocks & Stubs

2010-02-03 Thread Matt Wynne
On 3 Feb 2010, at 11:35, J. B. Rainsberger wrote: I find this rule of thumb helpful: stub unless you're certain to want to verify this time that the client invoke the server correctly, and never, never mock multiple methods at once. Right, because the mock (should_receive) is an assertion, an

Re: [rspec-users] Best practices to managing RSpec code for very large projects?

2010-02-04 Thread Matt Wynne
On 4 Feb 2010, at 14:09, J. B. Rainsberger wrote: On Thu, Feb 4, 2010 at 00:12, David Mitchell wrote: What is the 'best practice' way to structure RSpec code and documentation when testing a very large project, where the RSpec code base has to be maintained and extended over a long per

Re: [rspec-users] Testing controller plugin

2010-02-08 Thread Matt Wynne
On 8 Feb 2010, at 02:34, Phillip Koebbe wrote: Matt Wynne wrote: On 1 Feb 2010, at 15:14, Phillip Koebbe wrote: I have just recently started creating some plugins, mainly of the controller variety. I have been looking for a tutorial or other documentation detailing how to go about

Re: [rspec-users] Testing controller plugin

2010-02-08 Thread Matt Wynne
On 8 Feb 2010, at 16:53, David Chelimsky wrote: On Mon, Feb 8, 2010 at 11:58 AM, Phillip Koebbe > wrote: Matt Wynne wrote: Yeah, you need to convince RSpec that the describe blocks you're using are describing an ExampleGroup that's about a Rails Controller, then it will mix

Re: [rspec-users] OT: Identifying unused code?

2010-02-11 Thread Matt Wynne
On 11 Feb 2010, at 04:46, Alex Satrapa wrote: I'm sure this has been covered before, but after some time all I've been able to find on the intarwebs are references to the use of code coverage tests to identify code that is not used by any current tests. I guess the assumption is that you'v

Re: [rspec-users] Question About Cleaning Up Specs?

2010-02-18 Thread Matt Wynne
On 18 Feb 2010, at 16:25, m...@franklakatos.com wrote: I know we are suppose to keep specs obvious and readable, but is it normal (or there any opposition) to stubbing every method call that you needed in a before block and simply over-riding the same method with a should_receive in the ac

Re: [rspec-users] Recall a example inside another (just like in Cucumber)

2010-02-18 Thread Matt Wynne
On 18 Feb 2010, at 19:33, Marcelo de Moraes Serpa wrote: Hello guys, I was spec'ing a model and just tried to do something like this it "should create a payment with period_start & period_end set correctly" do it "should create a new payment for an approved transaction"

Re: [rspec-users] Do you still Write Tests First on code that is churning hard?

2010-02-19 Thread Matt Wynne
On 19 Feb 2010, at 08:59, Erik Pukinskis wrote: Hello Specmeisters! I have a bit of a philosophical question for the TDD witches and wizards out there. I'm working on some code that is really churning... It's doing complicated calculations, but the actual desired results are a moving target.

[rspec-users] Suggested shorthand for and_return when stubbing

2010-02-20 Thread Matt Wynne
I keep wanting to do this, and I don't think it's possible so I thought I'd suggest it. Similarly to the way I can specify stub values as hash key/value pairs when constructing a test double, I'd like to be able to the same when subsequently calling stub on that double: me.stub(:name =>

Re: [rspec-users] Suggested shorthand for and_return when stubbing

2010-02-20 Thread Matt Wynne
On 20 Feb 2010, at 23:22, David Chelimsky wrote: On Sat, Feb 20, 2010 at 4:09 PM, Matt Wynne wrote: I keep wanting to do this, and I don't think it's possible so I thought I'd suggest it. Similarly to the way I can specify stub values as hash key/value pairs when cons

Re: [rspec-users] Module instance variable remains set

2010-02-22 Thread Matt Wynne
On 22 Feb 2010, at 19:45, Harm wrote: Hi, I have an issue with rSpec when spec'ing a module. The module in question looks like this: module Sheep def self.sound @sound ||= produce_sound() end end This module is used all around the application (and corresponding specs) and somehow values

Re: [rspec-users] Shared Helpers

2010-02-23 Thread Matt Wynne
On 23 Feb 2010, at 17:30, Scott Taylor wrote: Has there been any development on shared helpers / it_should_behave_like feature in rspec? I forget the reasons, but I remember a patch for something like this was rejected: it_should_behave_like "an_entry", :locals => { :entry => Entr

Re: [rspec-users] Is there a way to terminate a long running spec job...

2010-02-23 Thread Matt Wynne
On 23 Feb 2010, at 19:11, rlw wrote: and still get the output of accumulated errors? My environment is awful, slow, and not modifiable. (Just don't go there! At least I get to program in Ruby, which makes up for everything else.) So when I see some errors in a 300 example test file, it takes a

Re: [rspec-users] where can I find a discusion happened earlier

2010-02-24 Thread Matt Wynne
http://groups.google.com/group/rspec On 24 Feb 2010, at 06:54, Diwakar, ANGLER - EIT wrote: I need a look on a definition given for rspec and cucumber earlier by a member in rspec group. Where can I find it Regards, Diwakar ___ rspec-users mailing

Re: [rspec-users] rspec "output which test it is running before running it"

2010-02-25 Thread Matt Wynne
Do you mean --format specdoc ? On 25 Feb 2010, at 15:29, rogerdpack wrote: I'm trying to find a spec parameter that will do something like the following $ spec file.spec Spec: running "it should pass spec x" . Spec: running "it should pass spec y" . That type of thing. The use case is that

Re: [rspec-users] RSpec framework question

2010-03-02 Thread Matt Wynne
On 2 Mar 2010, at 21:05, Adam R wrote: An update for this issue. This script works, but only if I explicitly define the array that I'm iterating over (][countryname, url]].each do, rather than @countries.each do). Can someone help me understand why my array here (@countries) is not reco

Re: [rspec-users] Disabling database access in controller specs

2010-03-03 Thread Matt Wynne
You could use something like NullDb to achieve this, I think: http://www.slideshare.net/bmabey/disconnecting-the-database-with-activerecord On 3 Mar 2010, at 20:43, Stefan Kanev wrote: It took a while, but now I an totally convinced that controller specs should not access the database and stu

Re: [rspec-users] Insufficient database clean-up between specs

2010-03-16 Thread Matt Wynne
On 15 Mar 2010, at 12:34, David Chelimsky wrote: On Mon, Mar 15, 2010 at 7:24 AM, jollyroger wrote: Hey guys, unfortunately I've got one more issue with rspec right now. It seems like rspec isnt properly cleaning up the database after each spec. I have the following spec:

Re: [rspec-users] continuing on my quest to learn rspec...

2010-03-23 Thread Matt Wynne
On 23 Mar 2010, at 17:43, Patrick J. Collins wrote: Ok, So... My first attempt at specing a method in my photo model didn't go so well.. http://gist.github.com/341447 Both of these tests are failing, and I am not even sure if I am structuring this anywhere near correct or not... In o

Re: [rspec-users] setting partial stub for just one value and letting obj handle the rest

2010-04-01 Thread Matt Wynne
On 1 Apr 2010, at 21:35, David Chelimsky wrote: On Apr 1, 2010, at 3:14 PM, drewB wrote: Occasionally, I find myself in a situation where I want to have a mock obj returned if a method is called with a particular argument but handled normally otherwise. For example, lets say I have a Model

Re: [rspec-users] setting partial stub for just one value and letting obj handle the rest

2010-04-01 Thread Matt Wynne
pain many times :) This book is a great read when you're working with other people's crap: http://www.amazon.com/Working-Effectively-Legacy-Michael-Feathers/dp/0131177052 On Apr 1, 1:45 pm, Matt Wynne wrote: On 1 Apr 2010, at 21:35, David Chelimsky wrote: On Apr 1, 2010, at 3:14

Re: [rspec-users] Can I use mocking in this way?

2010-04-04 Thread Matt Wynne
When I started programming Ruby and I wanted abstract classes I would raise an exception in the initialize method telling the client that they were trying to instantiate an abstract class. That was my best attempt at self-documenting code at the time. Nowadays, however, when I have behaviou

Re: [rspec-users] [Cucumber:4066] Cucumber vs, RSpec

2010-04-21 Thread Matt Wynne
Here's an idea relevant to this discussion that came up last week when I did a talk on Cucumber to ScotRUG. Paul Wilson was describing how he used to use Fit, back in the day, for testing at different levels in the stack rather than just for end- to-end tests. The idea was to surface the tes

Re: [rspec-users] testing against a live environment

2010-04-27 Thread Matt Wynne
On 27 Apr 2010, at 10:36, Martin DeMello wrote: I have a series of tests I want to automate, which involve running shell scripts in a "live" environment (i.e. nothing mocked or stubbed), and then verifying the state of the system. I thought that, even though it doesn't fit the classic definitio

Re: [rspec-users] more rspec questions

2010-04-27 Thread Matt Wynne
On 27 Apr 2010, at 22:51, Patrick J. Collins wrote: Hi, What if they didn't? Is there a different way you could design this so that the interesting bits (The small methods) didn't depend so much on the other bits around them? Well this is for importing vCards... http://gist.github.com/

Re: [rspec-users] Future of RSpec Integration Testing

2010-04-29 Thread Matt Wynne
On 29 Apr 2010, at 18:48, James H wrote: Greetings. My team at work is trying to decide between Cucumber and RSpec integration tests for all future integration-style testing. The team is divided on this, so I thought I'd approach the community to see what the future of RSpec integration tests

Re: [rspec-users] What are the common causes of rspec hanging?

2010-05-10 Thread Matt Wynne
You might want to try running the specs with --format specdoc so you can do a better post mortem. Also remember you can look at log/test.log to see what was happening when it hung. On 8 May 2010, at 20:59, RFine wrote: > I'm responsible for a relatively large RoR application, and have been > st

Re: [rspec-users] First Post (Best Practices)

2010-05-13 Thread Matt Wynne
On 13 May 2010, at 12:41, Ants Pants wrote: > Hello everyone, Hello and welcome :) > I'm just working my way through the RSpec/Cucumber book, I love the tool but > not so much the learning curve :( > > Starting with my first view, is it okay for me, in the BDD world, to do the > following or

Re: [rspec-users] Quickcheck testing framework

2010-05-18 Thread Matt Wynne
On 16 May 2010, at 18:54, Scott Taylor wrote: > > Hey all, > > I'm wondering if anyone has any experience with an automated test-case > generation tool like Quickcheck (for erlang/haskell). I'd be interested in > hearing any impressions, war stories, or dev workflows regarding a tool like >

Re: [rspec-users] How to separate unit and integration spec suites?

2010-05-20 Thread Matt Wynne
On 19 May 2010, at 22:11, Myron Marston wrote: > On my current rails project we're using both rspec and cucumber. > We've been diligent about keeping our specs as true unit tests, using > nulldb and mocking/stubbing to disconnect the specs from the database > and keep each spec focused on the cla

Re: [rspec-users] old crumbly rspec

2010-05-25 Thread Matt Wynne
Cursory look at that blog post seems like it's covered most of what's in this talk, but worth mentioning anyway, it's good: http://pure-rspec-rubynation.heroku.com/ http://video2010.scottishrubyconference.com/show_video/3/1 On 24 May 2010, at 10:33, Andrew Premdas wrote: > Hi List, > > Being p

Re: [rspec-users] How do I improve the readability of my specs

2010-05-26 Thread Matt Wynne
On 27 May 2010, at 04:44, David Chelimsky wrote: > On May 26, 2010, at 9:37 PM, Nadal wrote: > >> Here is my spec. >> >> describe Exception2db do >> context "attributes" do >> subject { Exception2db.create(:exception => $exception_data_xml) } >> >> specify { subject.controller.should == 'e

Re: [rspec-users] Understanding how to better use stub! and stub_chain

2010-06-01 Thread Matt Wynne
Did you try looking at the specs for any examples? I imagine there'd be a couple... ;) Joseph DelCioppio wrote: >I've been looking through the RSpec source to better understand how >RSpec works and I've got a question about the functionality of stub!. >I noticed that you can pass a symbol to st

Re: [rspec-users] (no subject)

2010-06-07 Thread Matt Wynne
On 7 Jun 2010, at 15:13, Ben Butler-Cole wrote: > Hello. > > I'm trying to use RSpec's mocks to describe code which passes a block to a > collaborator. I want to write an assertion against the value returned by the > block. I can't find any explicit support for this in RSpec, but perhaps I >

Re: [rspec-users] mock assertions on block parameters

2010-06-07 Thread Matt Wynne
On 7 Jun 2010, at 15:56, Ben Butler-Cole wrote: > On 7 June 2010 15:25, Matt Wynne wrote: > > Have you seen and_yield? I can't quite get my head around what you're trying > to do, but it might help anyway > > Thank you, I have. My understanding is that #and_yield

Re: [rspec-users] mock assertions on block parameters

2010-06-07 Thread Matt Wynne
On 7 Jun 2010, at 16:52, Ben Butler-Cole wrote: > On 7 June 2010 16:34, Matt Wynne wrote: > > I'm still not quite clear what you're trying to achieve. Do you want to > assert that a specific block is passed to the collaborator, or do you want to > assert that any ol

Re: [rspec-users] Rails 3 , RSpec 2.0.0.beta.11

2010-06-12 Thread Matt Wynne
On 11 Jun 2010, at 23:54, juange wrote: > Hi, > > I was doing some testing to mi controller and a error raise, and it's > driving me crazy. This are the lines that I wanna test: > >@cloning_vector = CloningVector.new(params[:cloning_vector]) >@cloning_vector.sequence = Sequence.new(para

Re: [rspec-users] accessing constants from another module within examples

2010-06-16 Thread Matt Wynne
On 16 Jun 2010, at 15:11, Jarmo Pertman wrote: > Hello. > > I wanted to include module into ExampleGroup to write less code within > examples, but was unable to do so. This seems to be strange, because > in regular Class it works and all methods within that module are also > accessible. See the

Re: [rspec-users] accessing constants from another module within examples

2010-06-16 Thread Matt Wynne
On 16 Jun 2010, at 15:20, Matt Wynne wrote: > > On 16 Jun 2010, at 15:11, Jarmo Pertman wrote: > >> Hello. >> >> I wanted to include module into ExampleGroup to write less code within >> examples, but was unable to do so. This seems to be strange, because >

Re: [rspec-users] Mocking/Faking requests for js/ajax-based tests

2010-06-19 Thread Matt Wynne
On 19 Jun 2010, at 00:35, David Chelimsky wrote: > On Jun 18, 2010, at 5:02 PM, Marcelo de Moraes Serpa wrote: > >> Hi David, thanks for the reply, >> >> Hmm, considering we have: >> 1) The ruby process where the spec is running >> 2) A mongrel server serving request (test environment) >> >>

Re: [rspec-users] Using RSpec and Cucumber with Rails 3 Engines

2010-06-29 Thread Matt Wynne
On 29 Jun 2010, at 06:54, aslak hellesoy wrote: > On Tue, Jun 29, 2010 at 4:58 AM, Brandon Olivares > wrote: >> Hi, >> >> I recently upgraded to Rails 3 beta, a few weeks ago. One thing I would >> really like to do is to develop components of my application, because some >> of them I'd really l

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

2010-07-05 Thread Matt Wynne
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 feel unhappy. > > Principal causes of un

Re: [rspec-users] (rspec2/rails3) spec'ing the details of a controller that is not purely *skinny* by design.

2010-07-12 Thread Matt Wynne
On 12 Jul 2010, at 06:43, Kevin wrote: > Awesome discussion you've started here, very fun read for a new rspec > follower. > > Just wanted to throw in that I've found setting a > "cattr_accessor :current_user" in the user model to hold the current > user to be very handy in terms of simplifying

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

2010-07-14 Thread Matt Wynne
On 14 Jul 2010, at 15:26, Chuck Remes wrote: > I find myself using this pattern quite a bit. > > rspec 1.30 > ruby 1.9.1, 1.9.2-rc2, jruby 1.51 all on osx 10.6.4 > > class Foo > def initialize >@bar = Bar.new > end > end > > context "init" do > it "should allocate a helper class Bar" do

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

2010-07-16 Thread Matt Wynne
On 15 Jul 2010, at 14:55, Chuck Remes wrote: > > On Jul 14, 2010, at 4:20 PM, Matt Wynne wrote: > >> >> You can do this, by using a test spy to remember the value of foo passed >> into the stubbed constructor and then later comparing it: >> >>

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

2010-07-16 Thread Matt Wynne
On 16 Jul 2010, at 10:45, 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. >&

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

2010-07-19 Thread Matt Wynne
On 18 Jul 2010, at 00:10, David Chelimsky wrote: > 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 sugg

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

2010-07-19 Thread Matt Wynne
On 19 Jul 2010, at 11:38, Wincent Colaiuta wrote: > El 19/07/2010, a las 10:58, Matt Wynne escribió: > >> On 18 Jul 2010, at 00:10, David Chelimsky wrote: >> >>> On Jul 17, 2010, at 1:18 PM, Costa Shapiro wrote: >>> >>>> Hello, >>>>

Re: [rspec-users] How do I setup Rspec, Cucumber to test a Gem?

2010-07-19 Thread Matt Wynne
On 19 Jul 2010, at 19:05, Walther Diechmann wrote: > Hi, > > my question unwields me as a complete noob - which is okay - but I > apologize for this totally basic question <:) > > I've bought the PragProg Rspec Book and googled, been reading blogs and > what-have-I-not, but nowhere have I been

  1   2   3   4   5   6   7   >