Re: [rspec-users] Variance in behaviour: rake features vs. autotest

2008-11-27 Thread James Byrne
Ben Mabey wrote: > would be extremely helpful for your insights to be added to the wiki to > help other people who are beginning and will probably have the same > questions you have had. As soon as I have an insight, my wife will faint... I would love to assist in this manner, the difficulty bei

Re: [rspec-users] Variance in behaviour: rake features vs. autotest

2008-11-27 Thread James Byrne
Ben Mabey wrote: > As the cucumber wiki page says about autotest > (http://github.com/aslakhellesoy/cucumber/wikis/autotest-integration) if > you want to override the arguments used by autotest you need to define > an 'autotest' profile in your cucumber.yml file. I added information > about profi

Re: [rspec-users] could one scenario depend on another in cucumber?

2008-11-27 Thread Pau Cor
Matt Wynne wrote: > I think I might be right in saying that technique is likely to be > deprecated in the future. I don't think it's recommended anymore. See > my earlier response. Thanks Matt. That is good to know. Paul -- Posted via http://www.ruby-forum.com/. _

Re: [rspec-users] class << self considered harmful... really?

2008-11-27 Thread Mark Wilden
On Thu, Nov 27, 2008 at 5:57 PM, Brian Takita <[EMAIL PROTECTED]>wrote: > > I'm wondering if this is a discussion about taste. I think you're right. I've been using the 'def self.foo' style in various languages for almost 20 years, so of course it feels more natural to me. These languages (excep

Re: [rspec-users] class << self considered harmful... really?

2008-11-27 Thread Brian Takita
On Thu, Nov 27, 2008 at 8:27 PM, Mark Wilden <[EMAIL PROTECTED]> wrote: > On Thu, Nov 27, 2008 at 5:12 PM, Brian Takita <[EMAIL PROTECTED]> > wrote: > >> >> I suppose that we can write our entire program with one LOC. I suppose >> thats following YAGNI. Hell, why use do end? Its two extra lines of

Re: [rspec-users] class << self considered harmful... really?

2008-11-27 Thread Mark Wilden
On Thu, Nov 27, 2008 at 5:12 PM, Brian Takita <[EMAIL PROTECTED]>wrote: > I suppose that we can write our entire program with one LOC. I suppose > thats following YAGNI. Hell, why use do end? Its two extra lines of > code all over the place. That's not YAGNI. :) We need clarity now - there's no

Re: [rspec-users] class << self considered harmful... really?

2008-11-27 Thread Brian Takita
On Thu, Nov 27, 2008 at 7:58 PM, Mark Wilden <[EMAIL PROTECTED]> wrote: > On Thu, Nov 27, 2008 at 4:40 PM, Brian Takita <[EMAIL PROTECTED]> > wrote: > >> >> When maintaining code, I often wish I could travel back in time and >> tell the writer "Don't do that". :) > > I don't see how we can solve th

Re: [rspec-users] class << self considered harmful... really?

2008-11-27 Thread Mark Wilden
On Thu, Nov 27, 2008 at 4:40 PM, Brian Takita <[EMAIL PROTECTED]>wrote: > When maintaining code, I often wish I could travel back in time and > tell the writer "Don't do that". :) > I don't see how we can solve the problem of people not following style guidelines by giving them another style gui

Re: [rspec-users] class << self considered harmful... really?

2008-11-27 Thread Brian Takita
On Thu, Nov 27, 2008 at 6:43 PM, Mark Wilden <[EMAIL PROTECTED]> wrote: > On Thu, Nov 27, 2008 at 1:59 PM, Brian Takita <[EMAIL PROTECTED]> > wrote: >> >> Its funny because I consider def self.foo harmful for a few reasons. >> >> def self.method_name is often mixed with instance methods. This makes

Re: [rspec-users] class << self considered harmful... really?

2008-11-27 Thread Mark Wilden
On Thu, Nov 27, 2008 at 1:59 PM, Brian Takita <[EMAIL PROTECTED]>wrote: > Its funny because I consider def self.foo harmful for a few reasons. > > def self.method_name is often mixed with instance methods. This makes > reading the code confusing because there are two contexts that you > need to de

Re: [rspec-users] Restful Authentication and Cucumber

2008-11-27 Thread Michael Guterl
On Thu, Nov 27, 2008 at 12:58 AM, Andrei Erdoss <[EMAIL PROTECTED]> wrote: > Hello, > > I am using Restful Authentication and I would like to login in Cucumber. I > am having trouble keeping the user logged in. I tried finding a solution for > this everywhere. Only source is this article: > http://

Re: [rspec-users] class << self considered harmful... really?

2008-11-27 Thread Brian Takita
On Tue, Nov 25, 2008 at 8:41 AM, Matt Wynne <[EMAIL PROTECTED]> wrote: > Sorry, I know this is off-topic, but I'd really like to know what the > revered ruby-hackers who read this list think. > > See > http://ozmm.org/posts/class__self_is_harmful.html > > I have adopted class << self, partly from r

Re: [rspec-users] cucumber and autotest - running all features?

2008-11-27 Thread James Byrne
James Byrne wrote: > > I understood that the purpose of autotest was that it ONLY ran a test > for the changed file. However, with this setup, if I touch any file > anywhere in the project then the full suite of feature tests apparently > gets run. for UnitTest autotest only run the tests assoc

Re: [rspec-users] attributes method not working?

2008-11-27 Thread Rick DeNatale
On Thu, Nov 27, 2008 at 11:03 AM, David Chelimsky <[EMAIL PROTECTED]>wrote: > On Thu, Nov 27, 2008 at 9:06 AM, <[EMAIL PROTECTED]> > wrote: > > > it "should be invalid without an approved size" do > > @adtag.attributes = valid_adtag_attributes.except(:size) # ONE > > attributes= does NOT

[rspec-users] cucumber and autotest - running all features?

2008-11-27 Thread James Byrne
Given I have cucumber (0.1.10) And I have ZenTest (3.11.0) And I have features in sub-directories under a directory called features And Each feature sub-directory has a sub-directory called step_definitions And I have .feature files in the features sub-directories And I have .rb files in

Re: [rspec-users] Spec'ing via features

2008-11-27 Thread James Byrne
Tim Walker wrote: > FWIW - I just did it and it seemed OK... > > /features/steps/holiday_steps.rb > ... > Then /^there should be 2 nodes in the control group$/ do > Fixtures.create_fixtures("/../../test/fixtures", "holiday_schedules") > end > ... > > /test/fixtures/holiday_schedules.yml > one:

Re: [rspec-users] class << self considered harmful... really?

2008-11-27 Thread Pat Maddox
Student <[EMAIL PROTECTED]> writes: > therein. If I'm looking at a group of methods in a file, I NEVER know > which class I'm in until I search backwards for the "class" token. You do if you use a good editor, like emacs :) Pat ___ rspec-users mailin

Re: [rspec-users] class << self considered harmful... really?

2008-11-27 Thread Zach Dennis
On Thu, Nov 27, 2008 at 12:52 PM, Nathan Zook <[EMAIL PROTECTED]> wrote: > That's not a surprise, that's a feature. Know the difference between class > variables and class instance variables. Said the preacher to the choir. But even features can cause surprises. It's a surprise when you're the co

Re: [rspec-users] class << self considered harmful... really?

2008-11-27 Thread Student
Everyone seems to agree on the basic issues, but are coming at it from different viewpoints. 1) If you have a bunch of class methods, you have a problem. (class#File: I mean you!) 2) Maintainability is paramount. The question, then, should be: which of these patterns (class << self or self.metho

Re: [rspec-users] Variance in behaviour: rake features vs. autotest

2008-11-27 Thread James Byrne
James Byrne wrote: > > The error is that there exists no entity with id=1. Ideas? I have resolved all of the test result differences between running cucumber features -r features, rake features, and autotest. These were dependent on whether testunit tests and their associated fixtures were

Re: [rspec-users] Spec'ing via features

2008-11-27 Thread Tim Walker
No arguments there! Just curious why it didn't work... FWIW - I just did it and it seemed OK... /features/steps/holiday_steps.rb ... Then /^there should be 2 nodes in the control group$/ do Fixtures.create_fixtures("/../../test/fixtures", "holiday_schedules") end ... /test/fixtures/holiday_sch

Re: [rspec-users] Variance in behaviour: rake features vs. autotest

2008-11-27 Thread Ben Mabey
Ben Mabey wrote: James Byrne wrote: Ben Mabey wrote: As the cucumber wiki page says about autotest (http://github.com/aslakhellesoy/cucumber/wikis/autotest-integration) if you want to override the arguments used by autotest you need to define an 'autotest' profile in your cucumber.yml file

Re: [rspec-users] class << self considered harmful... really?

2008-11-27 Thread Zach Dennis
On Wed, Nov 26, 2008 at 8:46 PM, Ben Mabey <[EMAIL PROTECTED]> wrote: > Avdi Grimm wrote: >> >> On Wed, Nov 26, 2008 at 12:17 PM, Matt Wynne <[EMAIL PROTECTED]> wrote: >> And class variables are problematic in Rails in development mode because of class reloading. >>> >>> And mor

Re: [rspec-users] Variance in behaviour: rake features vs. autotest

2008-11-27 Thread Ben Mabey
James Byrne wrote: Ben Mabey wrote: As the cucumber wiki page says about autotest (http://github.com/aslakhellesoy/cucumber/wikis/autotest-integration) if you want to override the arguments used by autotest you need to define an 'autotest' profile in your cucumber.yml file. I added informat

Re: [rspec-users] attributes method not working?

2008-11-27 Thread David Chelimsky
On Thu, Nov 27, 2008 at 9:06 AM, <[EMAIL PROTECTED]> wrote: > This is probably basic but I'm not seeing it. I'm using rspec & rspec-rails > 1.1.11 on Ubuntu, & rails 2.1.0. Here's (the relevant parts of) my class I'm > testing: > > class Adtag < ActiveRecord::Base > > # snip > > validates_inc

Re: [rspec-users] Variance in behaviour: rake features vs. autotest

2008-11-27 Thread James Byrne
James Byrne wrote: > So, depending upon the way cucumber is invoked, either all the tests > pass, all the tests are skipped, or some of the tests pass and some fail > one way and others pass and fail when invoked another way. This seems > problematic for testing and it is far beyond my modest

Re: [rspec-users] Variance in behaviour: rake features vs. autotest

2008-11-27 Thread James Byrne
Ben Mabey wrote: > As the cucumber wiki page says about autotest > (http://github.com/aslakhellesoy/cucumber/wikis/autotest-integration) if > you want to override the arguments used by autotest you need to define > an 'autotest' profile in your cucumber.yml file. I added information > about profi

[rspec-users] attributes method not working?

2008-11-27 Thread rspec-users
 This is probably basic but I'm not seeing it. I'm using rspec & rspec-rails 1.1.11 on Ubuntu, & rails 2.1.0. Here's (the relevant parts of) my class I'm testing: class Adtag < ActiveRecord::Base   # snip   validates_inclusion_of :size, :in => IAB_SIZES   validates_presence_of :code   validates_pre

Re: [rspec-users] Restful Authentication and Cucumber

2008-11-27 Thread Andrei Erdoss
David, Thank you for your great insight. You're assumptions were correct and the user wasn't getting logged in, because I didn't add all the necessary paramenters for the user to be able to log in. I am checking if the user is being created and also if after login, there is a message posted, such

Re: [rspec-users] exactly(N).times incorrectly passing for N < actual

2008-11-27 Thread David Chelimsky
On Thu, Nov 27, 2008 at 4:45 AM, Ashley Moran <[EMAIL PROTECTED]> wrote: > Hi > > This spec: > >it "should cache the HTML" do > @uri.should_receive(:read).exactly(N).times > 5.times { @low_graphics_page.story_body } >end > > passes incorrectly for all N <= 4, and o

Re: [rspec-users] Restful Authentication and Cucumber

2008-11-27 Thread David Chelimsky
On Wed, Nov 26, 2008 at 11:58 PM, Andrei Erdoss <[EMAIL PROTECTED]> wrote: > Hello, > > I am using Restful Authentication and I would like to login in Cucumber. I > am having trouble keeping the user logged in. I tried finding a solution for > this everywhere. Only source is this article: > http://

[rspec-users] exactly(N).times incorrectly passing for N < actual

2008-11-27 Thread Ashley Moran
Hi This spec: it "should cache the HTML" do @uri.should_receive(:read).exactly(N).times 5.times { @low_graphics_page.story_body } end passes incorrectly for all N <= 4, and only fails for N > 6. "once" and "twice" are similarly broken. Is this a known issue