Re: [rspec-users] how to write “Destroy kid” in cucumber

2013-09-30 Thread Andrew Premdas
d="kid_#{kid.id}"} =link_to 'Destroy' ... Your test is telling you your markup sux (thats why its so difficult to test). So instead of making the test do something really difficult, listen to your test and improve your code. > -- > Posted via http://www.ruby-foru

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

2013-05-16 Thread Andrew Premdas
On 16 May 2013, at 04:22, "Andrey S." wrote: > Yes, I know, that testing private methods it's not a good idea (and I > read this thread - http://www.ruby-forum.com/topic/197346 - and some > others) > > But how can I test the following code? > I use xmpp4r. In my public method #listen I start rece

Re: [rspec-users] RSpec newbie

2012-11-24 Thread Andrew Premdas
rspec-users mailing list > rspec-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users > -- Andrew Premdas blog.andrew.premdas.org ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

[rspec-users] error message for expect{}.should

2012-08-27 Thread Andrew Premdas
Hi all, Having not done any speccing for a few weeks I just spent ages puzzling over why the following code wasn't working it "should require a client" do expect{ }.should raise_error ArgumentError end and giving me a expected ArgumentError, got #__

[rspec-users] stub.as_null_object mock and double

2012-05-09 Thread Andrew Premdas
Hi there, Is there any particular reason why stub is not stub.as_null_object by default? Or alternatively is there some nicer sugar for stub.as_null_object Is RSpec trying to discourage the use of stub.as_null_object, and if so why? TIA Andrew -- Andrew Premdas

Re: [rspec-users] stuck in testing hell...

2012-05-01 Thread Andrew Premdas
e), ... Finally an important lesson is that your tests being green is really not that important. Its much more important that tests 1. say what they do 2. are listened to, so they exert a positive influence on your design 3. make things easy to fix when they go red All best Andrew ___ > rspec-users mailing list > rspec-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users > -- Andrew Premdas blog.andrew.premdas.org ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] what RSpec approach could I use for this.

2012-03-05 Thread Andrew Premdas
T23:59:59+00:00 > * 2012-03-10T00:00:00+00:00, 2012-03-16T23:59:59+00:00 > * 2012-03-17T00:00:00+00:00, 2012-03-23T23:59:59+00:00 > > > thanks > > -- > Posted via http://www.ruby-forum.com/. > ___ > rspec-users mailing li

Re: [rspec-users] can I output the html of the page after calling click_button?

2012-03-02 Thread Andrew Premdas
see below On 2 March 2012 03:33, S Ahmed wrote: > I am not sure why my form submission is failing (request test). > > I am calling: > > # form is filled in a 'before do' block. > > it "should create an account" do > expect { click_button "Create" }.to change(Account, :count).by(1) > put a deb

Re: [rspec-users] Testing selector order

2012-03-01 Thread Andrew Premdas
n to do it correctly. As a hack Capybara's all method in practice will return the paragraphs in order (but this isn't guaranteed by specification). HTH Andrew Andrew Premdas blog.andrew.premdas.org ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] requests: is it possible to put the fill_in's into a method?

2012-02-26 Thread Andrew Premdas
hould ... #{bad_attr}..." do fill_in(good_attrs(:except => {:bad_attr}) etc. All of top of my head so expect syntax errors, but hopefully enough to be useful All best Andrew HTH Andrew -- Andrew Premdas blog.andrew.premdas.org ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Should I use cucumber or Controller RSpecs or both?

2012-02-14 Thread Andrew Premdas
very easy to implement in cucumber e.g - after all you just need to visit a url to generate the request. The only issue is that in Rails you may not get the error page you expect because you are running in test mode. You can address that by using an @allow-rescue tag on the feature. HT

Re: [rspec-users] getting ActionController::RoutingError when I test namespaced controllers

2012-02-02 Thread Andrew Premdas
> app root: > > rpsec spec > > (Sorry to any bothered readers for any undue brevity in the previous > post-response cycle, but I've assumed that the type of error > (RoutingError) in combination with the way rspec works and fails for > my functional tests was adequate to suggest a fix.) > > Thanks, > > Lille > ___ > rspec-users mailing list > rspec-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users > Just a wild guess here, but shouldn't the folder match the namespace, you have a beta folder and a Beta1 namespace -- Andrew Premdas blog.andrew.premdas.org ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] stub().and_raise() ain't raising?

2012-01-13 Thread Andrew Premdas
_______ > rspec-users mailing list > rspec-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users -- Andrew Premdas blog.andrew.premdas.org ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] cucumber is_admin? testing

2011-12-03 Thread Andrew Premdas
ther account? All best Andrew > -- > Posted via http://www.ruby-forum.com/. > ___ > rspec-users mailing list > rspec-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users -- -------- Andrew P

Re: [rspec-users] cucumber is_admin? testing

2011-12-01 Thread Andrew Premdas
ers@rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users > I'm a moderator on the Cukes list. There are no outstanding messages awaiting moderation. I suggest you try again. Send your message to cu...@googlegroups.com All best Andrew -- And

Re: [rspec-users] oddness with messages_path

2011-11-28 Thread Andrew Premdas
altech.edu > ___________ > rspec-users mailing list > rspec-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users > -- Andrew Premdas blog.andrew.premdas.org ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Rails code reloading in RSpec test environment?

2011-11-23 Thread Andrew Premdas
On 23 November 2011 10:54, Ash Moran wrote: > > On 23 Nov 2011, at 07:19, Andrew Premdas wrote: > >>>> Use Ruby 1.8.7 its much faster. There is a very good screencast on >>>> Destroy All Software that might help also - the one about extracting >>&g

Re: [rspec-users] Rails code reloading in RSpec test environment?

2011-11-22 Thread Andrew Premdas
On 23 November 2011 00:57, Justin Ko wrote: > > On Nov 22, 2011, at 4:52 PM, Andrew Premdas wrote: > >> On 22 November 2011 20:31, Ash Moran wrote: >>> Hi >>> >>> I've worked on a couple of Rails 3 apps recently and the test feedback loop >>&

Re: [rspec-users] Rails code reloading in RSpec test environment?

2011-11-22 Thread Andrew Premdas
t extracting domain objects (or something like that). HTH Andrew ps > > [1] http://jstorimer.github.com/spin/ > > -- > http://www.patchspace.co.uk/ > http://www.linkedin.com/in/ashmoran > > ___ > rspec-users mailing list > rspec-u

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

2011-10-28 Thread Andrew Premdas
27;database_cleaner' > end > > removing the :require => ... lines seemed to fix the problem > > So you were right - it was all my fault ;) > > thanks for prodding me in the right direction. > > cheers > jc your welcome all best Andrew >

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

2011-10-24 Thread Andrew Premdas
ng a new rails project with the same gemset (ideally using RVM) might help isolate the issue. Also publishing the error messages in a gist, or even publishing the whole project on Github might help. All best Andrew > thanks > jc > > On 21 Okt., 22:18, Lenny Marks wrote: >> On

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

2011-10-21 Thread Andrew Premdas
r.run(:set_load_path) end end HTH All best Andrew > > 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 | http://twitter.com/mattwynne > > ___ > rspec-users mailing list > rspec-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users > -- Andrew Premdas blog.andrew.premdas.org ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Mocking expectations on I/O operations

2011-09-15 Thread Andrew Premdas
ted in how that cleanup is implemented. If you want to specify how the cleanup works then make cleanup public - either in this class, or perhaps better yet in another class. e.g. describe "Cleanup.clean" it "should delete files" end ... end describe IconGenerator

Re: [rspec-users] Better visualizations of spec running time besides --profile?

2011-08-31 Thread Andrew Premdas
faster-start-up-time/ > -- > John Feminella > Principal Consultant, BitsBuilder > LI: http://www.linkedin.com/in/johnxf > SO: http://stackoverflow.com/users/75170/ > ___ > rspec-users mailing list > rspec-users@rubyforge.org > htt

Re: [rspec-users] Tests that require a logged in user / session cookie

2011-08-25 Thread Andrew Premdas
t; ___ > rspec-users mailing list > rspec-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users > If you are using Cucumber (which is in your minimal set of Gems), you don't need to write this sort of test. A Cucumber fea

Re: [rspec-users] How should I interpret RCov, code coverage?

2011-08-25 Thread Andrew Premdas
roblem, but it does not tell you what the problem is. Using multiple metrics and viewing them over time will give you many indicators of possible problems with a project. Properly identifying a problem, with enough precision to have a chance of implementing solutions for it, requires the investigation

[rspec-users] --profile and ci

2011-07-27 Thread Andrew Premdas
--profile is not a formatter (its not a formatter in I'm using Jenkins for Ci and rspec2, on a rails app TIA Andrew -- -------- Andrew Premdas blog.andrew.premdas.org ___ rspec-users mailing list rspec-users@rub

Re: [rspec-users] How to mock when there seems to be a requirement for chained mocked calls?

2011-06-14 Thread Andrew Premdas
ervable behavior of a model without > mocking its internals. This is _not_ the same as setting expectations on > model methods called from controllers, in which case we're specifying how > one component (the controller) talks to another component (the

[rspec-users] rspec with debug does not pick up .rdebugrc settings

2011-06-08 Thread Andrew Premdas
Hi there, latest rspec2, running in debug mode, does not seem to pick up settings from project .rdebugrc or home ~/.rdebugrc. Wondering if others experience this and if its anything obvious TIA Andrew -- Andrew Premdas blog.andrew.premdas.org

Re: [rspec-users] Request for comments: Scenario

2011-06-05 Thread Andrew Premdas
th spec_helper 3. No explanation of where files should be put (in spec folder?) 4. I think the fixtures section could be fleshed out a bit with an example HTH Andrew > ___________ > rspec-users mailing list > rspec-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-use

Re: [rspec-users] Migrating cucumber tm_bundle to rspec 2

2011-06-04 Thread Andrew Premdas
On 3 June 2011 15:17, David Chelimsky wrote: > On Jun 3, 2011, at 7:39 AM, Andrew Premdas wrote: > > > Hi there, > > > > I need some help migrating some code in the cucumber textmate bundle so I > can run the specs with rspec2. > > > > The following code l

[rspec-users] Migrating cucumber tm_bundle to rspec 2

2011-06-03 Thread Andrew Premdas
still getting errors, although it could be something unrelated TIA Andrew -- -------- Andrew Premdas blog.andrew.premdas.org ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Writing a spec for HTTP OPTIONS verb

2011-05-24 Thread Andrew Premdas
(0 bytes > 0.09s) > => # @http_response=#> > ruby-1.9.2-p180 :002 > response.body > => nil > > Interestingly, that same uri does actually have a body when invoked with a > get. > > Best, > Sidu. > http://c42.in > http://about.me/ponnappa > >

Re: [rspec-users] Writing a spec for HTTP OPTIONS verb

2011-05-24 Thread Andrew Premdas
___ > rspec-users mailing list > rspec-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users > -- Andrew Premdas blog.andrew.premdas.org ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Problems installing rspec 2.6

2011-05-24 Thread Andrew Premdas
follow that do you get the same error? If so can you gist the following rvm --version ruby --version gem list --local Perhaps you need to update rvm, or revert it back? HTH Andrew ___________ > rspec-users mailing list > rspec-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users

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

2011-05-09 Thread Andrew Premdas
s) behaviour. The best place to see how they work in tandem is the RSpec Book. All best Andrew ___ > rspec-users mailing list > rspec-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users > -- ---

Re: [rspec-users] Fixtures not loading when running full test suite

2011-01-28 Thread Andrew Premdas
o with mysql not resetting its numbering between tests, so it is actually loading a user, but not with ID=1. I'm pretty sure I've seen that behaviour in the past. All best Andrew ___ > rspec-users mailing list > rspec

Re: [rspec-users] major release required?

2011-01-22 Thread Andrew Premdas
]On 22 January 2011 09:47, David Chelimsky wrote: > On Fri, Jan 21, 2011 at 5:13 PM, Andrew Premdas > wrote: > > On 21 January 2011 13:56, David Chelimsky wrote: > >> > >> On Jan 19, 2011, at 6:48 AM, Rick DeNatale wrote: > >> > >> > On Tue, J

Re: [rspec-users] Best Practice for Controllers

2011-01-21 Thread Andrew Premdas
controllers in the namespace inherit from it. Something like: > > https://gist.github.com/784363 > > Doing it this way does create seeming duplication in the views, but > partials can be used very easily to deal with that. This method also > more or less demands a menu structure that completely separates the > functionality of each role, but in the projects that I've been working > on, that has been a benefit. To have all of the role-based > functionality separated in controllers and menus has provided clear > lines that are easy to follow. In short, it has worked out really > well. But, as always, your own mileage may vary. > > Peace. > Phillip > > ___ > rspec-users mailing list > rspec-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users > +1 for the many controllers for one model pattern, you can really simplify controllers with this approach. Having a separate view hierarchy for each of these controllers also makes for simpler views, with less logic. However you have be very disciplined with your view partials, or the number of files can get a bit confusing All best Andrew -- Andrew Premdas blog.andrew.premdas.org ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

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

2011-01-21 Thread Andrew Premdas
all require. In the code above, you're pushing the lib directory onto the > load path. > > > The require statement I ended up using is > > > > require 'codebreaker/game' > > Maybe the lib/codebreaker file was supposed to do that? > > It should, mine

Re: [rspec-users] major release required?

2011-01-21 Thread Andrew Premdas
rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users > Whilst its very noble to try and follow the ruby gems document to the letter, some consideration has to be given to the overall effect of rapidly changing major version numbers on the project. RSpec has a very large user base, a close tie in with Rails major versions, in particular the idea to Rails 3 should use RSpec 2, and a history of changing major versions very infrequently with major consequences to the vast majority of users. This I think is a fair assessment of RSpec's context re version numbers. To move to RSpec 3, for such a small change would be completely out of character for the project. To end up in 4 months time with RSpec 9 would be very detrimental to the projects reputation. So I think the pragmatic approach is a minor release with a big caveat in the history and a big announcement on the mailing list All best Andrew -- Andrew Premdas blog.andrew.premdas.org ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Feedback Requested (pretty please)

2011-01-21 Thread Andrew Premdas
for Jamis Buck's fat model skinny controller blog post, make your controllers do as little as possible and put all logic in the model. Then use rspec to test the public methods in your model. This will give you a much shallower learning curve, and be much more productive

Re: [rspec-users] Testing html email content with have_selector rspec2 rails3 fails

2010-12-20 Thread Andrew Premdas
Rob, This doesn't make sense 1. None of your examples here are using have_selector ! 2. Why is OrderMailer no longer creating a receipt 3. Why is @mailer being encoded Is mailer.body the same in both versions, can you show this. Have you tried using a debugger before the first have_tag line. A

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

2010-12-19 Thread Andrew Premdas
When doing BDD, especially at the start, I found it really easy to write more code than you need to, when implementing a particular functional spec. I also found it really easy to miss the point where you should move into the inner cycle (unit cycle). Using the unit test coverage metric to make su

Re: [rspec-users] What should I test/specify?

2010-10-30 Thread Andrew Premdas
On 30 October 2010 14:40, Andrew Wagner wrote: > Ok, so here's the scenario. I have a top-level module, with a method called > load_file. It should take a file name, get the YAML module (Syck) to parse > it, and then send the result to a class, which should convert that result > into a series of

Re: [rspec-users] Testing initialize methods and chained methods

2010-10-19 Thread Andrew Premdas
Set an expectation that do_something should be called once. Then create a new Foo. With the method chain set an expectation that your chained method should be called, then call the original method. You should be able to check that the original method is passed as a param. Further information in R

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

2010-07-22 Thread Andrew Premdas
On 21 July 2010 17:06, David Chelimsky wrote: > On Jul 21, 2010, at 10:09 AM, Andrew Premdas wrote: > > > trying out new syntax from jon larkowski's rspec presentation. Following > doesn't work in that when I run the line from the command prompt or from &g

[rspec-users] 'its' not working

2010-07-21 Thread Andrew Premdas
trying out new syntax from jon larkowski's rspec presentation. Following doesn't work in that when I run the line from the command prompt or from textmate no specs are run context "cancel" do subject do order = at_dropshipping order.cancel_dropship! order end its(:

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

2010-07-08 Thread Andrew Premdas
On 8 July 2010 11:46, David Chelimsky wrote: > On Jul 8, 2010, at 4:24 AM, Andrew Premdas wrote: > > On 8 July 2010 01:01, David Chelimsky wrote: > >> On Jul 7, 2010, at 8:22 AM, Andrew Premdas wrote: >> >> > Hi there. >> > >> > My understandi

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

2010-07-08 Thread Andrew Premdas
On 8 July 2010 01:01, David Chelimsky wrote: > On Jul 7, 2010, at 8:22 AM, Andrew Premdas wrote: > > > Hi there. > > > > My understanding (which is limited) is that rspec uses at_exit to run its > specs. I don't really know why - could somoene explain? > &

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

2010-07-07 Thread Andrew Premdas
Hi there. My understanding (which is limited) is that rspec uses at_exit to run its specs. I don't really know why - could somoene explain? My problem with this behaviour is that I would like the running of a spec to start an instance of solr (using Sunspot) if one is not running. The problem wit

Re: [rspec-users] [OT] programming (OOP) principles resources

2010-06-10 Thread Andrew Premdas
Link doesn't work typo? On 10 June 2010 10:43, Julian Leviston wrote: > I'm not so sure "We all know good principles of OOP" actually. > > I'd recommend www.vpri.com.au and looking into the work of Alan Kay. A lot > of his stuff can be found for free online, because it's decades old. > > Julian

Re: [rspec-users] [CUCUMBER] Noob question

2010-05-26 Thread Andrew Premdas
On 25 May 2010 18:50, Pito Salas wrote: > Meta question: is this the right/best place to ask for assistance with > Cucumber or am I in the wrong place? > > Anyway, here goes. I just started using cucumber and it's very > impressive! > > Check out this fragment: > > And I go to the home page > The

[rspec-users] old crumbly rspec

2010-05-24 Thread Andrew Premdas
Hi List, Being pretty lazy here, but I figure you can help very quickly and others might benefit from the results. I write old crumbly rspec (see gist http://gist.github.com/411689), and I would like to improve, can you take my crumbly spec and make it shiny? Also if you can post any links to rec

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

2010-03-09 Thread Andrew Premdas
On 4 February 2010 05:12, David Mitchell wrote: > Hello group, > > I've searched through several months messages in the archive, but haven't > found an answer to this... > > What is the 'best practice' way to structure RSpec code and documentation > when testing a very large project, where the RS

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

2010-02-21 Thread Andrew Premdas
On 19 February 2010 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 movin

Re: [rspec-users] GET a path in a controller spec

2010-02-21 Thread Andrew Premdas
On 31 January 2010 22:02, Nick Hoffman wrote: > One of my controller actions sends a redirect if the request URI begins > with /foods/search > > 34 def search > 35return redirect_to "/#{params[:name]}" if > request.request_uri.match /^\/foods\/search/ > > Unfortunately, I can't figure out

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

2010-01-07 Thread Andrew Premdas
2010/1/7 Phillip Koebbe > > > 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 "describe" block that >> corresponds to the controller where the behav

Re: [rspec-users] 'Expected NoMethodError, got NameError'

2010-01-05 Thread Andrew Premdas
2010/1/4 David Chelimsky > On Mon, Jan 4, 2010 at 2:57 PM, Andrew Premdas wrote: > >> 2009/12/30 Paul Hinze >> >> Given this simple cucumber feature (related to another rspec bug I am >>> working on): >>> >>> http://gist.github.com/266335

Re: [rspec-users] 'Expected NoMethodError, got NameError'

2010-01-04 Thread Andrew Premdas
2009/12/30 Paul Hinze > Given this simple cucumber feature (related to another rspec bug I am > working on): > > http://gist.github.com/266335 > > I'm fighting with this error messages that _only_ shows up in certain > situations that I can't quite pin down (rake features breaks, individual > cu

Re: [rspec-users] more verbosity for be_an?

2010-01-03 Thread Andrew Premdas
2010/1/2 David Chelimsky > > > On Sat, Jan 2, 2010 at 3:23 PM, Andrew Premdas wrote: > >> 2009/12/30 rogerdpack >> >> > What about something like: >>> > >>> > expected # => Fixnum to be a kind of Fixnum >>> > >>&g

Re: [rspec-users] more verbosity for be_an?

2010-01-03 Thread Andrew Premdas
2010/1/3 rogerdpack > > > The very first test I thought up was "this method should return an > > > integer" so kind of a basic test for a not yet existent method. > > > > Isn't this a bit anti-ruby though. Surely the things we should be testing > is > > that the object exists, responds to certain

Re: [rspec-users] more verbosity for be_an?

2010-01-02 Thread Andrew Premdas
2009/12/30 rogerdpack > > What about something like: > > > > expected # => Fixnum to be a kind of Fixnum > > > > That is more aligned with other failure messages. WDYT? > > I quite like it. > In this instance it was > > 3.class.should be_a Fixnum # fails > > I suppose it would be something like

Re: [rspec-users] class variables different between spec and runtime?

2009-12-27 Thread Andrew Premdas
2009/12/22 Rick DeNatale > On Tue, Dec 22, 2009 at 10:24 AM, David Chelimsky > wrote: > > > > > > On Tue, Dec 22, 2009 at 9:22 AM, David Chelimsky > > wrote: > >> > >> > >> On Tue, Dec 22, 2009 at 9:14 AM, Peter Fitzgibbons > >> wrote: > >>> > >>> Hello Folks, > >>> > >>> This gist http://gist

Re: [rspec-users] undefined method `route_for

2009-12-14 Thread Andrew Premdas
2009/12/14 Amit Kulkarni > Thanks David. > Also i am little bit confused regarding routes. > > Consider a routing example > > it "should map { :controller => 'channels', :action => 'new' } to > /channels/new" do > route_for(:controller => "channels", :action => "new").should == > "/channels/new"

Re: [rspec-users] [rspec-rails] spec vs. autospec

2009-12-05 Thread Andrew Premdas
2009/12/4 Andy Koch > Hi All, > > any reason why some tests might pass via spec ... and fail from within > autospec? > > I have a rails app using AuthLogic and Declarative Authorization. I > have tests that create user_sessions and assign roles against which > CRUD rules are tested. > > This has

Re: [rspec-users] Spec helper configuration problem

2009-11-30 Thread Andrew Premdas
2009/11/27 Ben Mabey > Andrew Premdas wrote: > >> Hi all, >> >> I have a rails application whose specs run on about eight different boxes, >> but I can't get them to work on my integration server. The bit thats >> breaking concerns some modules that

[rspec-users] Spec helper configuration problem

2009-11-27 Thread Andrew Premdas
Hi all, I have a rails application whose specs run on about eight different boxes, but I can't get them to work on my integration server. The bit thats breaking concerns some modules that I have in spec/support/modules which are loaded by the following line in spec_helper # get any macros etc

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

2009-11-07 Thread Andrew Premdas
2009/11/5 Chuck van der Linden > On Nov 4, 5:30 pm, David Chelimsky wrote: > > On Wed, Nov 4, 2009 at 3:36 PM, Stephen Eley wrote: > > > On Wed, Nov 4, 2009 at 3:24 PM, Andrew Premdas > wrote: > > > > > > Personally I now think nested steps are evil - bu

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

2009-11-04 Thread Andrew Premdas
2009/11/4 Stephen Eley > On Wed, Nov 4, 2009 at 10:56 AM, Andrew Premdas > wrote: > > > > Putting lots of > > view details in the features (and I should see a wibble field etc. ...) > > pollutes this map with clutter that is not relevant to the "business"

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

2009-11-04 Thread Andrew Premdas
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 example) there are a fair number of

Re: [rspec-users] Rspec - In views

2009-10-28 Thread Andrew Premdas
2009/10/28 Rails ROR > Hi All, > > I want to test my application with rspec. > > In order to test my views, I have written few specs as given in the > examples. > > Is there any way to test the user acceptance? > > i.e suppose the field takes a string. > > I want to test it for integers, float va

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

2009-10-15 Thread Andrew Premdas
2009/10/15 Stephen Eley > On Thu, Oct 15, 2009 at 3:59 AM, Andrew Premdas > wrote: > > > > You can take this further and state that no public method should ever do > > anything, it should just contain calls to private methods which document > how > > the public

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

2009-10-15 Thread Andrew Premdas
2009/10/14 Joaquin Rivera Padron > hello there, > how do you tipically spec private methods? The thing is Ï have something > like this: > > def some_method >complex_method + other_complex_methods > end > > private > def complex_method... > def other_complex_methods ... > > and the two complex

Re: [rspec-users] Need Help

2009-10-07 Thread Andrew Premdas
2009/10/7 David Chelimsky > On Wed, Oct 7, 2009 at 3:57 PM, aslak hellesoy > wrote: > > > > > > On Wed, Oct 7, 2009 at 10:24 PM, Andrew Premdas > wrote: > >> > >> 2009/9/25 Mithun Perera > >>> > >>> Mithun Perera wrote: >

Re: [rspec-users] Need Help

2009-10-07 Thread Andrew Premdas
2009/10/7 aslak hellesoy > > > On Wed, Oct 7, 2009 at 10:24 PM, Andrew Premdas wrote: > >> 2009/9/25 Mithun Perera >> >>> Mithun Perera wrote: >>> > Mithun Perera wrote: >>> >> Hi all, >>> >> I am an university student

Re: [rspec-users] Need Help

2009-10-07 Thread Andrew Premdas
2009/9/25 Mithun Perera > 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 s

[rspec-users] Where to put macros

2009-06-22 Thread Andrew Premdas
Recently I got some wonderful help from the list to create my NamedAddress module/macro which tests NamedAddresses for a number of different resources. The question I have is where should I put this module? At the moment I've got it in spec_helper, but this feels a bit messy Many thanks Andrew __

Re: [rspec-users] shared examples sharing methods

2009-06-18 Thread Andrew Premdas
2009/6/18 Ben Mabey > David Chelimsky wrote: > >> On Wed, Jun 17, 2009 at 10:14 AM, Andrew Premdas >> wrote: >> >> >>> Please have a look at >>> http://gist.github.com/131277 >>> What I'd like to do is create a shared_examples group

[rspec-users] shared examples sharing methods

2009-06-17 Thread Andrew Premdas
Please have a look at http://gist.github.com/131277 What I'd like to do is create a shared_examples group which I can parametize a method. So my shared example would perhaps use method named_address=, or set_named_address and then groups that behave like "Named address" would be able to override

Re: [rspec-users] get_via_redirect in controller specs

2009-05-26 Thread Andrew Premdas
2009/5/26 David Chelimsky > On Tue, May 26, 2009 at 9:42 AM, Andrew Premdas > wrote: > > Want to do the following in my controller spec > > describe CheckoutController, "handling stale session" do > > > > before do > >session[:order_id] =

[rspec-users] get_via_redirect in controller specs

2009-05-26 Thread Andrew Premdas
Want to do the following in my controller spec describe CheckoutController, "handling stale session" do before do session[:order_id] = 5 Order.delete_all end it "should not throw a 404" do get_via_direct :index end Getting the following error message, NoMethodError in 'CheckoutCo

Re: [rspec-users] Writing specs pointed out I need to refactor my admin area

2009-05-24 Thread Andrew Premdas
2009/5/24 Fernando Perez : > So I tried to implement Django's AutoAdmin, but actually it quite > quickly blew in my face. Although the views all look similar, there > almost as many little differences as they are models and that's painful > to abstract. So I prefer to write my views for each model.

Re: [rspec-users] Cucumber broke my rake tasks! 0.3.5

2009-05-18 Thread Andrew Premdas
Sorry for being a bit slow, but what would you like me to set it to?? 2009/5/18 aslak hellesoy : >> 2009/5/15 aslak hellesoy : >>>> Andrew Premdas wrote: >>>>> >>>>> Seem to be having a problem with the new releases 0.3.5 which >>>>>

Re: [rspec-users] Cucumber broke my rake tasks! 0.3.5

2009-05-16 Thread Andrew Premdas
2009/5/15 aslak hellesoy : >> Andrew Premdas wrote: >>> >>> Seem to be having a problem with the new releases 0.3.5 which >>> completely breaks my rake tasks http://gist.github.com/112149. >>> >>> WIth the >>> >>>  t.fork = true

[rspec-users] Cucumber broke my rake tasks! 0.3.5

2009-05-15 Thread Andrew Premdas
Seem to be having a problem with the new releases 0.3.5 which completely breaks my rake tasks http://gist.github.com/112149. WIth the t.fork = true # Explicitly fork for cucumber 0.3.4 and rails lines added to the tasks none of my steps are recognised (see second file in gists) Without t.fork

Re: [rspec-users] Features failing to run correctly under 0.3.2

2009-05-07 Thread Andrew Premdas
Tried this out using your github repository. Can confirm this fixes our bug - looking forward to next gem release Thanks Andrew 2009/5/7 Andrew Premdas : > Thanks Aslak, I'll try this out when I get to work. > > Andrew > > 2009/5/6 aslak hellesoy >> >> >>

Re: [rspec-users] Features failing to run correctly under 0.3.2

2009-05-06 Thread Andrew Premdas
Thanks Aslak, I'll try this out when I get to work. Andrew 2009/5/6 aslak hellesoy > > > On Wed, May 6, 2009 at 9:20 AM, Andrew Premdas wrote: > >> Having significant problems getting an upto date environment with cucumber >> and rspec since 0.3.0. I have put t

Re: [rspec-users] Features failing to run correctly under 0.3.2

2009-05-06 Thread Andrew Premdas
2.2.2 at the moment. 2009/5/6 aslak hellesoy > > Having significant problems getting an upto date environment with cucumber >> and rspec since 0.3.0. I have put the relevant files including a backtrace >> in a gist http://gist.github.com/107586. I'd really appreciate it if >> someone could take

[rspec-users] Features failing to run correctly under 0.3.2

2009-05-06 Thread Andrew Premdas
Having significant problems getting an upto date environment with cucumber and rspec since 0.3.0. I have put the relevant files including a backtrace in a gist http://gist.github.com/107586. I'd really appreciate it if someone could take a look at this. All these features ran fine using cuc 0.3.0

Re: [rspec-users] [cucumber] Setting a constant in step definition

2009-04-27 Thread Andrew Premdas
want to do form based admin for this setting (and >> similar ones) because such a change would be very infrequent, so we are >> currently happy to redeploy to make the change. >> > > I would do something like this: http://gist.github.com/102586 > > > >&g

Re: [rspec-users] [cucumber] Setting a constant in step definition

2009-04-27 Thread Andrew Premdas
09 at 7:00 AM, Andrew Premdas > wrote: > > Currently I have a very simple constants implementation being loaded as a > > Rails initialiser > > > > module MVOR > > module Postage > > THRESHOLD = BigDecimal.new('6.99') > > RATE = BigD

Re: [rspec-users] [cucumber] Setting a constant in step definition

2009-04-27 Thread Andrew Premdas
the change. 2009/4/27 aslak hellesoy > > > On Mon, Apr 27, 2009 at 2:00 PM, Andrew Premdas wrote: > >> Currently I have a very simple constants implementation being loaded as a >> Rails initialiser >> >> module MVOR >> module Postage >>

Re: [rspec-users] Background and scenario outline interaction

2009-04-27 Thread Andrew Premdas
Is this with 0.3.0? If not this might have been recently fixed as I reported a similar bug recently 2009/4/24 Jim Morris > Hi, > > I was surprised by this so I suspect it may be a bug. > > I have a Scenario Outline, and a Background in my Feature and nothing > else, > > The Background got execu

[rspec-users] [cucumber] Setting a constant in step definition

2009-04-27 Thread Andrew Premdas
Currently I have a very simple constants implementation being loaded as a Rails initialiser module MVOR module Postage THRESHOLD = BigDecimal.new('6.99') RATE = BigDecimal.new('30.00') end end My scenarios of my postage feature want to deal with two situations when the THRESHOLD has

Re: [rspec-users] Depot app, Demeter's law and troubles cleanly specing

2009-04-19 Thread Andrew Premdas
+1 what we are doing here is rendering resources in different contexts. In the original example we are rendering product resources in an order context. We should let the product define how it should be viewed - after all it knows best. If we need different views in different contexts then just crea

Re: [rspec-users] Spec run heuristics (Re: Cucover: coverage-aware 'lazy' cucumber runs)

2009-04-14 Thread Andrew Premdas
One simple thing I asked about the other day was running multiple instances of autotest to do different things. Currently I'd like to run one for my specs and one for my features, but you could easily extend this idea. Creating several profiles that run at the same time, with the long running ones

Re: [rspec-users] [cucumber] Cucumber and restful_authentication

2009-04-13 Thread Andrew Premdas
You could look at fbrp (http://github.com/diabolo/fbrp/tree/master) which has lots of tests like this. You could add a debug statement when you visit a page that you actually have to be logged in, to see if you actually are logged in. I suspect of the top of my head that you are not logged in when

Re: [rspec-users] [Cucumber] Bug with background

2009-03-31 Thread Andrew Premdas
Submitted bug : https://rspec.lighthouseapp.com/projects/16211-cucumber/tickets/270-background-transactions-and-xx Put some features and output in a gist that show this bug, hope its sufficient. All best Andrew 2009/3/30 aslak hellesoy > > > 2009/3/30 Andrew Premdas > > Seem

[rspec-users] [Cucumber] Bug with background

2009-03-30 Thread Andrew Premdas
Seem to be getting a problem when running a feature with background. Running the whole file works fine however running an individual feature fails. The background steps are Background: Given an admin user Philip exists When I login as Philip Then I should be logged in as Philip running the

  1   2   3   >