Re: [rspec-users] Spec-ing private method

2013-05-16 Thread Matt Wynne
ld I tell, from the outside of this class, that it has been invoked, and whether it has behaved as expected? Is there a collaborator on this class that it will send a message to? Is there some state that it will set on this class that I can read? cheers, Matt -- http://mattwynne.net || h

Re: [rspec-users] expecting one of two conditions

2013-03-10 Thread Matt Wynne
l contemplate 3), which could make life easer. Thanks! Could you give both errors a common base class, then assert on that? cheers, Matt -- http://mattwynne.net || https://twitter.com/mattwynne || http://the-cucumber-book.com || http://bddkickstart.com || http://www.relishapp.com __

Re: [rspec-users] hiiiiiii...........lots of question ..

2012-08-07 Thread Matt Wynne
l answer all of these questions any many many more. http://pragprog.com/book/achbd/the-rspec-book cheers, Matt -- Freelance programmer & coach Author, http://pragprog.com/book/hwcuc/the-cucumber-book Teacher, http://bddkickstart.com Founder, http://ww

Re: [rspec-users] describe, context, feature, scenario

2012-07-16 Thread Matt Wynne
ng I'm describing in this spec), then use #context inside that to explain the different hoops I'm making that thing jump through in my examples. cheers, Matt -- Freelance programmer & coach Author, http://pragprog.com/book/hwcuc/the-cucumber-book Founder, http://www.relishapp

Re: [rspec-users] Selenium+Autotest: how to run browser in background?

2012-07-05 Thread Matt Wynne
best for this. It's fast and you never see it. cheers, Matt -- Freelance programmer & coach Author, http://pragprog.com/book/hwcuc/the-cucumber-book Founder, http://www.relishapp.com/ Twitter, https://twitter.com/mattwynne ___ rspec-u

Re: [rspec-users] Newbie testing questions

2012-06-01 Thread Matt Wynne
les of code where there's more risk that something could get broken in the future, let us see that and we can probably give you more useful advice. > > -- > Posted via http://www.ruby-forum.com/. > ___ > rspec-users ma

Re: [rspec-users] rspec-2.10 is released!

2012-05-05 Thread Matt Wynne
nerated view specs > (Jonathan del Strother) > > ___ > rspec-users mailing list > rspec-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users Maybe you need some tests for this email template ;) cheers, Matt -- Freel

Re: [rspec-users] Smart mocks for ActiveRecord to speed up tests

2012-04-16 Thread Matt Wynne
27;m >> using the new 'where' API and this probably will keep changing each new AR >> release... > This is exactly why I like to wrap finders in domain-specific methods on the > model :) >> Also, in Grails case, the mocked domain classes are maintained alongside

Re: [rspec-users] Argument Non-Matchers

2012-04-11 Thread Matt Hauck
Hmm, that's not exactly what I was thinking of... I don't mean that there should be no arguments at all, but that the arguments should _not_ be of a certain match. On Tuesday, April 10, 2012 8:48:37 PM UTC-7, Justin Ko wrote: > > > On Apr 9, 2012, at 2:41 PM, Matt Hauck wr

[rspec-users] Argument Non-Matchers

2012-04-10 Thread Matt Hauck
Is there a way to specify a message expectation on an object to occur _without_ a particular argument? There is a particular function, which in some special circumstance takes a unique argument, but in normal circumstances does not take this unique argument. I want to say something like this:

Re: [rspec-users] Can't access https://www.relishapp.com/rspec from Chrome

2012-04-07 Thread Matt Wynne
till persists, please email supp...@relishapp.com and we can sort it out offline. cheers, Matt -- Freelance programmer & coach Author, http://pragprog.com/book/hwcuc/the-cucumber-book Founder, http://www.relishapp.com/ Twitter, https://twitter.com/mattwynne

Re: [rspec-users] mocking a reference to a polymorphic model?

2012-03-22 Thread Matt Wynne
n in the > relations table. I tried explicitly setting it, as in: > >post = mock_model("Post", :base_class => "Post") > > but the error was the same. > > For all the reasons that DC espouses, I'd love to mock references to the > polymorphic

Re: [rspec-users] Asserting on a yield

2012-03-07 Thread Matt Wynne
On 7 Mar 2012, at 18:26, Zach Dennis wrote: > Matt, > > I have typically done what you are already doing, but I am also > interested in the answer you seek. Another idea might be something > like since #do-stuff would need to be invoked with a block: > > expect(thing, :d

Re: [rspec-users] Asserting on a yield

2012-03-07 Thread Matt Wynne
On 7 Mar 2012, at 18:16, David Chelimsky wrote: > On Wed, Mar 7, 2012 at 11:56 AM, Matt Wynne wrote: >> >> On 7 Mar 2012, at 11:39, Morten Møller Riis wrote: >> >> On Mar 7, 2012, at 8:22 AM, Matt Wynne wrote: >> >> >> Hi all, >> >>

Re: [rspec-users] Asserting on a yield

2012-03-07 Thread Matt Wynne
On 7 Mar 2012, at 15:12, Ken Chien wrote: > Hi Matt, > On Wed, Mar 7, 2012 at 2:22 AM, Matt Wynne wrote: > Hi all, > > I'm spec'ing a method that yields a value. Right now, I spec it like this: > > result = nil > thing.do_stuff { |value| re

Re: [rspec-users] Asserting on a yield

2012-03-07 Thread Matt Wynne
On 7 Mar 2012, at 11:39, Morten Møller Riis wrote: > On Mar 7, 2012, at 8:22 AM, Matt Wynne wrote: > >> Hi all, >> >> I'm spec'ing a method that yields a value. Right now, I spec it like this: >> >> result = nil >> thing.do_s

[rspec-users] Asserting on a yield

2012-03-06 Thread Matt Wynne
ield_value(expected) Is there anything built into RSpec to let me do this? If not, how do other people test yields? cheers, Matt -- Freelance programmer & coach Author, http://pragprog.com/book/hwcuc/the-cucumber-book Founder, http://www.relishapp.com/ Twitter, https://twitter

Re: [rspec-users] should_receive_chain

2012-02-22 Thread Matt Wynne
or > un-pragmatic. I just think that if there's another way to get at that > feature, rspec-mocks is better off without it. ^ Yep, what he said ^ cheers, Matt -- Freelance programmer & coach Author, http://pragprog.com/book/hwcuc/the-cucumber-book Founder, http://www.relishapp.c

Re: [rspec-users] stale records with integration testing?

2012-02-17 Thread Matt Wynne
On 16 Feb 2012, at 12:21, David Chelimsky wrote: > On Thu, Feb 16, 2012 at 4:17 AM, Matt Wynne wrote: >> >> On 14 Feb 2012, at 20:44, Justin Ko wrote: >> >> >> On Feb 14, 2012, at 9:23 AM, David Chelimsky wrote: >> >> On Tue, Feb 14, 2012 at 9:

Re: [rspec-users] stale records with integration testing?

2012-02-16 Thread Matt Wynne
but you can minimize that by using transaction by default, and >> specifying truncation for in-browser scenarios (which are already far >> slower than will be impacted by truncation). > > cucumber-rails has good examples on how to set this up in RSpec: > ht

Re: [rspec-users] testing framework for test automation

2012-02-06 Thread Matt Wynne
to help guide teams who want to do this. I'd suggest the material in there would help you, particularly the chapters on using Capybara (which wraps Selenium Webdriver). [1] http://pragprog.com/book/hwcuc/the-cucumber-book cheers, Matt -- Freelance programmer & coach Author, http://pragpr

Re: [rspec-users] Game development: how to test interactions like an attack?

2012-02-02 Thread Matt Wynne
sistance. > A part of these damages may be absorbed by it's armor. > So, what could my specs be with that? I really can't start… :( Have you started to design a domain model for this? Could we see a picture? cheers, Matt -- Freelance programmer & coach Author, http://

Re: [rspec-users] Spec'ing a block

2011-12-05 Thread Matt Wynne
you're trying to introduce your mock into the stuff that happens in the forked process, which isn't going to work. cheers, Matt -- Freelance programmer & coach Author, http://pragprog.com/book/hwcuc/the-cucumber-book (with Aslak Hellesøy) Founder, http://relishapp.com +44(0)

Re: [rspec-users] Write tests for objects with lots of dependencies

2011-11-15 Thread Matt Wynne
setup? > > You can always extract big setup to some helper methods that set things up > for you. All of us do this more than we'd like to admit. But it always ends > up biting you in the end. > > HTH, > David > > ___ > rspec-users mailing list &g

Re: [rspec-users] Setting expections on chained calls

2011-11-07 Thread Matt Wynne
rn( > double('endkey').tap {|endkey| >endkey.should_receive(:endkey).with(['0']).and_return( > double('limit').tap {|limit| >limit.should_receive(:limit).with(2).and_return([@exam1, @exam2]) > } >) >

Re: [rspec-users] problems matching generated html output...

2011-11-04 Thread Matt Wynne
sier to test. Steve Klabnik has been writing about their application in the Ruby / Rails world recently[3] [1] http://martinfowler.com/eaaDev/PassiveScreen.html [2] http://www.objectmentor.com/resources/articles/TheHumbleDialogBox.pdf [3] http://blog.steveklabnik.com/2011/09/06/the-secret-to-rails-oo

Re: [rspec-users] problems matching generated html output...

2011-11-03 Thread Matt Wynne
that makes me go "eww". And makes > all the RSpec readibility go out the window. Is there something I should be > doing with a custom matcher or something to test for case-indifferent text, > ignore whitespace and \n, and be quote indifferent? > > Thanks. >

Re: [rspec-users] rspec 1.3.2, Rails 2.3.14 - plugins not loading

2011-10-21 Thread Matt Wynne
like this near the top: Bundler.require(:default, Rails.env) if defined?(Bundler) That's the magic that tells Bundler to require all the plugins for the test environment when you run the tests. You'll need to stick something like that into your Rails 1 app. One other pro

Re: [rspec-users] URL helpers in model specs

2011-10-11 Thread Matt Wynne
s.url_helpers in both the model and the example group. > Obviously, that's not ideal, because it's only necessary for the specs to > work. Is there any other solution? > > https://gist.github.com/1275799 I don't know about anyone else, but I can't see that gi

Re: [rspec-users] Assertions for asynchronous behaviour

2011-10-02 Thread Matt Wynne
____ > rspec-users mailing list > rspec-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users cheers, Matt -- Freelance programmer & coach Author, http://pragprog.com/book/hwcuc/the-cucumber-book (with Aslak Hellesøy) Founder, http:

Re: [rspec-users] Assertions for asynchronous behaviour

2011-09-21 Thread Matt Wynne
eel free to chime in too. :-) > > [1] https://github.com/pivotal/selenium/blob/master/lib/selenium/wait_for.rb > [2] https://gist.github.com/1228927 cheers, Matt -- Freelance programmer & coach Author, http://pragprog.com/book/hwcuc/the-cucumber-book

Re: [rspec-users] Assertions for asynchronous behaviour

2011-09-21 Thread Matt Wynne
On 20 Sep 2011, at 23:38, Alex Chaffee wrote: > On Tue, Sep 20, 2011 at 4:55 AM, Matt Wynne wrote: >> Thanks for all the ideas. I just rolled my own which expects a block with an >> assertion in it: > > I love the language! > >eventually { white.should be_blac

Re: [rspec-users] Assertions for asynchronous behaviour

2011-09-20 Thread Matt Wynne
/lib/selenium/wait_for.rb > > (Maybe I should put it in Wrong.) > > - A > > On Tue, Sep 13, 2011 at 3:56 AM, Matt Wynne wrote: >> Hi all, >> In GOOS[1] they use an assertion called assertEventually which samples the >> system for a success state until a certain time

[rspec-users] Assertions for asynchronous behaviour

2011-09-13 Thread Matt Wynne
capybara has wait_until { } but that's fairly rudimentary - the failure message isn't very helpful. Is there anything else already out there? [1] http://www.growing-object-oriented-software.com/ cheers, Matt -- Freelance programmer & coach Author, http://pragprog.com/book/hwcuc/the-cucum

Re: [rspec-users] rspec testing inheritance

2011-09-07 Thread Matt Wynne
On 7 Sep 2011, at 07:53, Sidu Ponnappa wrote: > > On 7 September 2011 11:09, Justin Ko wrote: >> >> >> On Tue, Sep 6, 2011 at 9:40 PM, slavix wrote: >>> >>> Hello, >>> Is there any way to test model inheritance in spec? >>> >>> something like.. >>> it { ChildModel.should < ParentModel } >

Re: [rspec-users] Speccing a redirect in routes

2011-08-10 Thread Matt Wynne
On 9 Aug 2011, at 13:11, David Chelimsky wrote: > On Aug 9, 2011, at 2:00 AM, Chris Mear wrote: > >> On 9 Aug 2011, at 01:02, David Chelimsky wrote: >> >>> On Aug 8, 2011, at 6:00 PM, Matt Wynne wrote: >>> >>>> I expected to be

[rspec-users] Speccing a redirect in routes

2011-08-08 Thread Matt Wynne
rtion method that will assert for redirect routing configuration. Did I miss it? Do I need to spec this with a request spec instead? cheers, Matt -- Freelance programmer & coach Author, http://pragprog.com/book/hwcuc/the-cucumber-book (with Aslak Hellesøy) Founder, http://relishapp.com +44(0)7974

Re: [rspec-users] functional testing with(through?) chrome

2011-08-07 Thread Matt Wynne
:selenium do |app| Capybara::Selenium::Driver.new(app, :browser => :chrome) end [1] https://github.com/jnicklas/capybara cheers, Matt -- Freelance programmer & coach Author, http://pragprog.com/book/hwcuc/the-cucumber-book (with Aslak Hellesøy) Founder, http://relishapp.com +44(0)79744

Re: [rspec-users] How can I make before/after all a method?

2011-07-29 Thread Matt Wynne
t available in a describe block, or use RSpec's config.extend method to do that automatically. Does that help? cheers, Matt -- Freelance programmer & coach Author, http://pragprog.com/book/hwcuc/the-cucumber-book (with Aslak Hellesøy) Founder, http://relishapp.com +44(0)7974430184 |

Re: [rspec-users] How to test block parameters which is sending to method with arguments??

2011-07-18 Thread Matt Wynne
Both the Feathers book and the Freeman / Pryce book will teach you how to do that. cheers, Matt -- Freelance programmer & coach Author, http://pragprog.com/books/hwcuc/the-cucumber-book (with Aslak Hellesøy) Founder, http://relishapp.com +44(0)7974430184 | http://twitter.com/mattwynne ___

[rspec-users] tags and spec_helper

2011-06-24 Thread Matt Wynne
like this? cheers, Matt m...@mattwynne.net 07974 430184 [1] https://www.destroyallsoftware.com/screencasts/catalog/fast-tests-with-and-without-rails ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Name of current example's file:line in a before block?

2011-06-15 Thread Matt Wynne
On 15 Jun 2011, at 13:47, David Chelimsky wrote: > On Jun 15, 2011, at 7:29 AM, Matt Wynne wrote: > >> Hi, >> >> I have an idea for a tool I want to build. In a Cucumber Before() block, I >> can say: >> >> Before do |scenario| >> puts scenario.

[rspec-users] Name of current example's file:line in a before block?

2011-06-15 Thread Matt Wynne
to do something similar in an RSpec before block, or do I need to delve into writing a formatter? cheers, Matt m...@mattwynne.net 07974 430184 ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] rake 0.9.0 activated error + debugger not working?

2011-06-07 Thread Matt Wynne
r RSpec tests. In the case of `rspec spec` the `spec` part is the folder where you want the `rspec` program to look for tests to run. Does that make more sense now? cheers, Matt -- Freelance programmer & coach Founder, http://relishapp.com +44(0)7974430

Re: [rspec-users] How do you test a module that extends ActiveSupport::Concern?

2011-05-31 Thread Matt Wynne
behaviour of that object. Make sense? > > Thanks! > > Ken > ___ > rspec-users mailing list > rspec-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users cheers, Matt m...@mattwynne.net 07974 430184 _

Re: [rspec-users] Cucumber and rspec, do cucumber step definitions use rspec?

2011-05-10 Thread Matt Wynne
s in your step definitions. You can also use Ruby's own built-in assertions from the Test::Unit::Assertions namespace. cheers, Matt -- Freelance programmer & coach Founder, http://relishapp.com +44(0)7974430184 | http://twitter.com/mattwynne

Re: [rspec-users] fields_for view spec

2011-05-03 Thread Matt S.
Chris Mear wrote in post #996461: > On 3 May 2011, at 15:05, Matt S. wrote: > >>>> @asset.build_owner >> Here is the rendered content: >>> >> a lot about other things! >> >> If you want to see everything you can do a 'git clone >>

Re: [rspec-users] fields_for view spec

2011-05-03 Thread Matt S.
Chris Mear wrote in post #996234: > On 2 May 2011 00:58, Matt S. wrote: >> accepts_nested_attributes_for.) >> before(:each) do >> end >> <%= f.fields_for :owner do |owner_fields| %> >> >> class AssetController < ApplicationController >> def ne

Re: [rspec-users] fields_for view spec

2011-05-01 Thread Matt S.
of this on the web and have tried about everything I can think of, but I still can't get view specs containing nested model forms to pass, using fields_for on models with accepts_nested_attributes_for.) Much thanks!!! Matt Smith #spec/views/assets/new.html.erb_spec.rb describe "assets/ne

Re: [rspec-users] before(:each) <- need some clarification

2011-04-27 Thread Matt Wynne
ment is calling the #text method that we've defined. This is such a common pattern, that in RSpec 2, David introduced #let blocks, which let you refactor the above code to look like this: describe Dimension do let(:text) { "string here" }

Re: [rspec-users] Faking Files, Data, Git interractions with mocks/stubs/fixtures

2011-04-21 Thread Matt Wynne
ware, Guided by Tests" (GOOS) where they talk about this in detail, as well as many other very useful testing techniques. The examples are in java, but the design principles apply equally to Ruby code. > > -- > Posted via http://www.ruby-forum.com

Re: [rspec-users] added new cool matcher into my framework WatirSplash - #in

2011-04-18 Thread Matt Wynne
predicate [1] to Object that >>> lets you specify that an object is in a collection: >> >>> 4.in?([2,3,4]) >> >>> Also, I'm not sure if I'd want this to be a matcher extension or something >>> built into rspec core. I'm open to ideas though. Anybody else? >> >>&g

Re: [rspec-users] Need suggestions on how to test a class

2011-04-13 Thread Matt Wynne
9022, 1045307475 ].collect { |a| a.to_s( 36 ) > }.join( " " ) > Nicholas Wieland (ngw) > n...@nofeed.org > http://www.nofeed.org > > ___ > rspec-users mailing list > rspec-users@rubyforge.org > http://rubyforge.org/m

Re: [rspec-users] fields_for view spec

2011-04-05 Thread Matt S.
Matt S. wrote in post #991032: >> In similar view specs, I've stubbed #owner_attributes= on the 'assets' >> mock. I think Rails' nested form/assignment implementation does a >> check on the existence of this method to make sure that the Asset >> model d

Re: [rspec-users] fields_for view spec

2011-04-05 Thread Matt S.
Chris Mear wrote in post #990804: > On 4 April 2011 02:00, Matt S. wrote: >> let(:owner) { mock_model("Owner").as_new_record.as_null_object } >> assert_select "input#asset_name", :name => "asset[name]" # passes >> <%= f.label :name %

[rspec-users] fields_for view spec

2011-04-03 Thread Matt S.
For some reason I can't figure out how to make the fields_for tags render in the trivial example below; however, it works in the browser. What does #build_association do that my stubbed method does not replicate? (Or is that even the issue?) I appreciate the insight. Thanks! Matt Smith

Re: [rspec-users] Can't put shared example group in its own file

2011-04-02 Thread Matt Wynne
1/lib/rspec/core/runner.rb:46:in > `run' > from > /Library/Ruby/Gems/1.8/gems/rspec-core-2.5.1/lib/rspec/core/runner.rb:10:in > `autorun' > from /Library/Ruby/Gems/1.8/bin/rspec:19 > rake aborted! > ___ > rspec-users mailing list > rspec-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users cheers, Matt m...@mattwynne.net 07974 430184 ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] given-when-then-and syntax support in Rspec

2011-03-27 Thread Matt Wynne
tml > > What do you think? Why not just use Cucumber? > > Best regards! > > Rodrigo. > > ___ > rspec-users mailing list > rspec-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users cheers, Matt m...@mattwynne.net 07974 430184 ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Stub a controllers helper_method in a view template helper spec

2011-03-21 Thread Matt Wynne
topic (http:// > jakescruggs.blogspot.com/2007/03/mockingstubbing-partials-and- > helper.html), but it seems that this is not valid anymore for Rails 3 > as there is no @controller.template. > > How do I stub that method? > > Kai > __

Re: [rspec-users] Controller Spec & DataMapper Chaining

2011-03-19 Thread Matt Wynne
lman/listinfo/rspec-users > > > ___ > rspec-users mailing list > rspec-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users > > ___ > rspec-users mailing list > rspec-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users cheers, Matt m...@mattwynne.net 07974 430184 ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Post call verification

2011-03-19 Thread Matt Wynne
n quite easily write your own test spy for the odd occasion when it seems necessary: class FakeExternalService attr_reader :who_was_published def publish_user_activation(user) @who_was_published = user end end > ___ > rspec-users mailing list > rspec-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users cheers, Matt m...@mattwynne.net 07974 430184 ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] 'spec' command not working

2011-03-18 Thread Matt Wynne
latest versions of JSpec and Ruby installed. How can I use >> the spec command? Not sure what to put in my PATH environment variables. >> >> Thanks! > > I mean Rspec, not Jspec It does help if you use the right words for things ;) Since RSpec 2.0, the binary comman

Re: [rspec-users] Faking FS in specs

2011-03-13 Thread Matt Wynne
It might need some tweaks. > > -- > Avdi Grimm > http://avdi.org > ___ > rspec-users mailing list > rspec-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users cheers, Matt m...@mattwynne.net 07974 430184 ___ rs

Re: [rspec-users] How to intercept an instance method from StdLib (1.9.2)

2011-03-06 Thread Matt Wynne
On 6 Mar 2011, at 10:30, Hedge Hog wrote: > On Sun, Mar 6, 2011 at 12:27 AM, Matt Wynne wrote: >> >> On 5 Mar 2011, at 12:06, Hedge Hog wrote: >> >>> On Fri, Mar 4, 2011 at 8:12 PM, Matt Wynne wrote: >>>> >>>> On 4 Mar 2011, at 05:45,

Re: [rspec-users] How to intercept an instance method from StdLib (1.9.2)

2011-03-05 Thread Matt Wynne
On 5 Mar 2011, at 12:06, Hedge Hog wrote: > On Fri, Mar 4, 2011 at 8:12 PM, Matt Wynne wrote: >> >> On 4 Mar 2011, at 05:45, Hedge Hog wrote: >> >>> Hi, >>> I'm struggling with something that seems to be simple, and I've not >>>

Re: [rspec-users] How to intercept an instance method from StdLib (1.9.2)

2011-03-04 Thread Matt Wynne
tp://wiki.hedgehogshiatus.com > ___ > rspec-users mailing list > rspec-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users cheers, Matt m...@mattwynne.net 07974 430184 ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Cucumber not inserting record in db

2011-03-03 Thread Matt Wynne
he data. Have a look at log/test.log and you should see some SQL statements running. > > -- > Posted via http://www.ruby-forum.com/. > ___ > rspec-users mailing list > rspec-users@rubyforge.org >

Re: [rspec-users] RSpec doesn't see the DATA constant

2011-02-28 Thread Matt Wynne
;> from first.rb:1:in `require' >> from first.rb:1 >> >> ruby second.rb >> "BAM!\n" >> >> >>> >>> Why RSpec doesn't see the constant when I use the `rspec` command? How >>> can I solve

Re: [rspec-users] Problem with rendering JSON

2011-02-13 Thread Matt Wynne
On 12 Feb 2011, at 12:49, Ants Pants wrote: > > > On 11 February 2011 23:45, Matt Wynne wrote: > > On 11 Feb 2011, at 16:04, Ants Pants wrote: > >> You are my last resort for solving this issue as I have tried and tried to >> solve it myself but can't.

Re: [rspec-users] Problem with rendering JSON

2011-02-11 Thread Matt Wynne
rform_action' > gems/actionpack-2.3.8/lib/action_controller/base.rb:532:in `send' > gems/actionpack-2.3.8/lib/action_controller/base.rb:532:in > `process_without_filters' > gems/actionpack-2.3.8/lib/action_controller/filters.rb:606:in `process' > gems/actionpack-2.3.8/lib/acti

Re: [rspec-users] custom matchers for request specs

2011-02-08 Thread Matt Wynne
ry method for a matcher class. Unless that matcher class includes Capybara and the Rails routing methods module (can't remember the name off-hand) you won't have access to either of these methods in the matcher. Look at the non-DSL way to create a matcher and this will make more sense. A

Re: [rspec-users] Comparing two XML documents

2011-01-31 Thread Matt Wynne
On 31 Jan 2011, at 08:26, Pat Maddox wrote: > I load my XML docs into a hash using Hash#from_xml and then compare the > hashes. Bullseye! Thanks Pat. > On Jan 26, 2011, at 7:26 AM, Matt Wynne wrote: > >> I have a problem. I have a test that needs to assert that one XML

Re: [rspec-users] rspec-rails 2 adding current account helper to all view specs

2011-01-28 Thread Matt Wynne
ple group. You can also filter this, so it only does it to certain types of ExampleGroup. I can't remember exactly what the syntax is for filtering on view specs, but something like this: RSpec.configure do |config| config.extend(MySpecialLoginMethods, :view) end Does that help? c

[rspec-users] Comparing two XML documents

2011-01-26 Thread Matt Wynne
Most annoying. I've seen a couple of RSpec matchers in blog posts that walk and compare XML fragments but I'm surprised there isn't something more concrete that already exists. I feel like I'm missing a way to do it within an XML library, for example. Any clues out there? cheers,

Re: [rspec-users] 'require'ing files from other directories

2011-01-21 Thread Matt Wynne
On 21 Jan 2011, at 16:22, Brian Warner wrote: > Matt Wynne wrote in post #976412: >> On 20 Jan 2011, at 19:32, Brian Warner wrote: >> >>> I have a file in step_definitions that's giving me an error for an >>> uninitialized constant. My guess is I need to &

Re: [rspec-users] 'require'ing files from other directories

2011-01-20 Thread Matt Wynne
er related so you could also ask on the cukes google group. Your guess is right. The best place to put your require statement is in features/support/env.rb I'm surprised that the book doesn't tell you to do that - did you maybe miss a step? cheers, Matt m...@mattwynne.n

Re: [rspec-users] Specing Ajaxy Views

2011-01-02 Thread Matt Wynne
s I decide that there's so little code that I don't need any specs, and I can just rely on the Cucumber test. In that case I'll merge the branch into master and move on. > Cheers, > Shea > > ___ > rspec-users mailing

[rspec-users] Fantastic Thread on Mock Objects

2011-01-02 Thread Matt Wynne
This is a classic, with some terrific insights from Steve Freeman and Nat Pryce, two of the finest practitioners of TDD that I know: http://groups.google.com/group/growing-object-oriented-software/t/af0c4251123fde43 cheers, Matt m...@mattwynne.net 07974 430184

Re: [rspec-users] Webrat or RSpec and Table Headers

2010-12-29 Thread Matt Wynne
On 29 Dec 2010, at 10:21, Matt Wynne wrote: > > On 29 Dec 2010, at 06:14, Shea Levy wrote: > >> Hi all, >> >> Suppose I have a table that lists all of my products, that includes a a >> Description somewhere in the first , and each product has its >>

Re: [rspec-users] Webrat or RSpec and Table Headers

2010-12-29 Thread Matt Wynne
hea > > It's worth looking at the tableish method that cucumber-rails provides. You can use it to turn a HTML table element into an array. You can even diff it against a Cucumber::Ast::Table object. cheers, Matt m...@mattwynne.net 07974 430184 ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] BDD and Performance

2010-12-29 Thread Matt Wynne
they tend to need lots of data and to take several samples to get their average. It's worth tagging them to exclude them from your check-in build run and running them in a nightly build instead. Hope that helps. cheers, Matt m...@mattwynne.net 07974 430184 _

Re: [rspec-users] Failing View Spec, rspec-rails 2.2.1

2010-12-17 Thread Matt S.
Hey David, You rock. Thanks a million. Got it working right away! Thanks, Matt -- 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] RSpec2: How to avoid an example run when previous failed

2010-12-11 Thread Matt Wynne
:14 > > 2) Sample when creating 2 named items last item name > Failure/Error: its(:name) { should == "ITEM:2" } > expected: "ITEM:2", > got: "ITEM:1" (using ==) > # ./sample_spec.rb:23 > > Finished in 0.00

Re: [rspec-users] "unit" vs. "functional" specs

2010-12-11 Thread Matt Wynne
yourself to do things test-first, you'll find you need the code coverage figure less and less, because your conscience knows it's 100%. These days, unless I'm rescuing a legacy project, I only really use code coverage to tell me about unused code that I can delete. cheers, Ma

Re: [rspec-users] Comparing files

2010-12-11 Thread Matt Wynne
On 10 Dec 2010, at 16:21, Ben Mabey wrote: > On 12/10/10 8:56 AM, Matt Wynne wrote: >> Hello folks, >> >> I'm writing some tests for file upload code. The files are binary, images >> mostly. I'm futzing around a bit, trying to figure out how to assert that

Re: [rspec-users] Comparing files

2010-12-10 Thread Matt Wynne
On 10 Dec 2010, at 15:56, Matt Wynne wrote: > Hello folks, > > I'm writing some tests for file upload code. The files are binary, images > mostly. I'm futzing around a bit, trying to figure out how to assert that the > uploaded file is the same as some go

[rspec-users] Comparing files

2010-12-10 Thread Matt Wynne
File.read(path_to_expected_file) Then when it fails, I get an ugly diff of the difference between the binary files. So I'm about to invent something of my own. Has anyone got a good pattern for doing this already? cheers, Matt m...@mattwynne.net 07974 430184

Re: [rspec-users] How can I use nested "before" functions?

2010-12-03 Thread Matt Wynne
of the two, which I think it why you're getting the suprising behaviour. > > I'm using Ruby version 1.9.2p0 with rvm on Mac OS X 10.6.5 and RSpec > 2.1.0. > > Thanks for a wonderful framework! > > Best regards, > Erik > ___

[rspec-users] Failing View Spec, rspec-rails 2.2.1

2010-12-01 Thread Matt Smith
Note the value="Message_#<RSpec::Core::ExampleGroup::Nested_1:0x010312db68>", which must be why the test fails. Is this an intentional change on how stub or assign works? Much thanks! Matt Smith -- matthewcalebsm...@gmail.com __

[rspec-users] view.should render_template best practices?

2010-11-16 Thread Matt Darby
I've been looking for the definitive answer for months now, and the RSpec book doesn't touch on it at all: How do we now handle stubbing out rendering of partials in view specs in RSpec2? I have a large (35K+ lines of views and related specs) that I'm trying to upgrade to Rails3/RSpec2. My views

Re: [rspec-users] no such file to load -- spec/rake/spectask

2010-10-13 Thread Matt Davies
2.0 was getting into the gem list Matt -- 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] no such file to load -- spec/rake/spectask

2010-10-13 Thread Matt Davies
I've found a solution. I upgraded rspec-rails to 1.3.3 in my gemfile, which in turn downgraded rspec from 2.0 to 1.3.1 in the gem list. This configuration now works ok. God knows what was happening there. -- Posted via http://www.ruby-forum.com/. _

[rspec-users] no such file to load -- spec/rake/spectask

2010-10-13 Thread Matt Davies
Hello there I'm running a rails 2.3.5 project and I can't run any rake tasks My error is no such file to load -- spec/rake/spectask Here's a relevant snippet of gem list output rails (2.3.5) rake (0.8.7) random_data (1.5.0) RedCloth (4.2.2) remarkable (3.1.13) remarkable_activerecord (3.1.13)

[rspec-users] render_template giving an odd error?

2010-10-11 Thread Matt Darby
Hey all, I'm trying to migrate over to Rails3/RSpec2 and I cannot seem to get the specing of `render` right. I know there was some changes in RSpec2 that affect this, and I was hoping to get a bit of help. I have this is in a before block in a view spec: view.should render_template("attachments/i

Re: [rspec-users] Factories vs. stubs/mocks

2010-08-31 Thread Matt Wynne
tsoftware.comhttp://GaslightSoftware.com/ >> >> ___ >> rspec-users mailing list >> rspec-us...@rubyforge.orghttp://rubyforge.org/mailman/listinfo/rspec-users > > The method

Re: [rspec-users] Default format for all requests in a spec

2010-08-30 Thread Matt Wynne
://twitter.com/mauriciojr >> ___ >> rspec-users mailing list >> rspec-us...@rubyforge.orghttp://rubyforge.org/mailman/listinfo/rspec-users > ___ > rspec-users mailing list > rspec-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users cheers, Matt http://blog.mattwynne.net +44(0)7974 430184 ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] there should be one test or two?

2010-08-27 Thread Matt Wynne
> it 'should be deposit $10' > user.bank.deposit(10) > user.bank.deposit.saving.should == 10 > user.deposit_record.should == #something. > end > -- > Posted via http://www.ruby-forum.com/. > ___ > rspec-users mailing

Re: [rspec-users] Controller spec with devise.

2010-08-26 Thread Matt Wynne
David Chelimsky wrote: >On Aug 24, 2010, at 6:51 PM, Titinux wrote: > >> Hello, >> >> I'm new in using RSpec and I can't figured out to spec this controller >> action. >> >> class OrdersController < ApplicationController >> before_filter :authenticate_user! >> >> def index >>respond_wi

Re: [rspec-users] Including modules for view test in RSpec 2.0.0.beta.19

2010-08-16 Thread Matt Wynne
! cheers, Matt http://blog.mattwynne.net +44(0)7974 430184 ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Name collision - how would you handle this?

2010-08-09 Thread Matt Wynne
On 9 Aug 2010, at 13:04, David Chelimsky wrote: > > On Aug 9, 2010, at 6:37 AM, Matt Wynne wrote: > >> >> On 9 Aug 2010, at 01:54, David Chelimsky wrote: >> >>> >>> On Aug 8, 2010, at 11:13 AM, Matt Wynne wrote: >>> >>>> &

  1   2   3   4   5   6   7   8   >