[rspec-users] Autotest style autotest/rails_rspec doesn't seem to exist. Aborting.

2008-11-13 Thread Ramon Tayag
Just upgraded my rspec because I wanted to start using cucumber. Autotest stopped working though. I got the error shown in the subject: "Autotest style autotest/rails_rspec doesn't seem to exist. Aborting." What should I do? ZenTest = Ramon Tayag ___

[rspec-users] Autotest style autotest/rails_rspec doesn't seem to exist. Aborting.

2008-11-13 Thread Ramon Tayag
Just upgraded rspec because I want to use cucumber. I downloaded the gems listed in the github wiki, and I submoduled the rspec and rspec-rails plugins. Autotest started to fail on me though. "Autotest style autotest/rails_rspec doesn't seem to exist. Aborting." What should I do to fix it? Zen

Re: [rspec-users] testing an action which requires picture

2008-11-13 Thread Ramon Tayag
I suggest doing those tests in the model, not in the controller. Just do that fixture thing for the controller spec to pass. But pass the same thing in the model. Here's a sample of how I do it require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') describe ProductImage do befo

[rspec-users] .with(:anything) issue

2008-11-13 Thread Emmanuel Pirsch
Hi, I'm using a expectation like this : repository.should_receive(:add_gem).with("test.txt", :anything) When I run my spec, it fails with the following message : Spec::Mocks::MockExpectationError in 'MiniGemServer should add a new gem to the repository after it has been uploaded' # expected :add_

Re: [rspec-users] .with(:anything) issue

2008-11-13 Thread David Chelimsky
On Thu, Nov 13, 2008 at 7:38 AM, Emmanuel Pirsch <[EMAIL PROTECTED]> wrote: > Hi, > > I'm using a expectation like this : > repository.should_receive(:add_gem).with("test.txt", :anything) Try the anything() method. Support for symbols as argument matchers was deprecated and removed. Are you still

Re: [rspec-users] .with(:anything) issue

2008-11-13 Thread Luis Lavena
On Thu, Nov 13, 2008 at 10:38 AM, Emmanuel Pirsch <[EMAIL PROTECTED]> wrote: > Hi, > > I'm using a expectation like this : > repository.should_receive(:add_gem).with("test.txt", :anything) > > When I run my spec, it fails with the following message : > Spec::Mocks::MockExpectationError in 'MiniGemS

Re: [rspec-users] .with(:anything) issue

2008-11-13 Thread Matt Wynne
On 13 Nov 2008, at 13:42, David Chelimsky wrote: On Thu, Nov 13, 2008 at 7:38 AM, Emmanuel Pirsch <[EMAIL PROTECTED]> wrote: Hi, I'm using a expectation like this : repository.should_receive(:add_gem).with("test.txt", :anything) Try the anything() method. Support for symbols as argument matc

Re: [rspec-users] Autotest style autotest/rails_rspec doesn't seem to exist. Aborting.

2008-11-13 Thread David Chelimsky
On Thu, Nov 13, 2008 at 5:20 AM, Ramon Tayag <[EMAIL PROTECTED]> wrote: > Just upgraded rspec because I want to use cucumber. I downloaded the > gems listed in the github wiki, and I submoduled the rspec and > rspec-rails plugins. Autotest started to fail on me though. > > "Autotest style autotes

Re: [rspec-users] .with(:anything) issue

2008-11-13 Thread David Chelimsky
On Thu, Nov 13, 2008 at 7:44 AM, Matt Wynne <[EMAIL PROTECTED]> wrote: > On 13 Nov 2008, at 13:42, David Chelimsky wrote: >> >> On Thu, Nov 13, 2008 at 7:38 AM, Emmanuel Pirsch <[EMAIL PROTECTED]> >> wrote: >>> >>> Hi, >>> >>> I'm using a expectation like this : >>> repository.should_receive(:add_g

Re: [rspec-users] .with(:anything) issue

2008-11-13 Thread Emmanuel Pirsch
Great, it worked! Here is where I found the doc which talk about using symbols : http://rspec.info/documentation/mocks/message_expectations.html Thanks! On Thu, Nov 13, 2008 at 8:42 AM, David Chelimsky <[EMAIL PROTECTED]>wrote: > On Thu, Nov 13, 2008 at 7:38 AM, Emmanuel Pirsch <[EMAIL PROTECTE

Re: [rspec-users] testing an action which requires picture

2008-11-13 Thread Mano ah
Ramon Tayag wrote: > You can put that barcode in the spec/fixtures directory. However, > you'll need to manually place it there. > > Ramon Tayag ok. Also please can i know how to test sending an image using rspec. -- Posted via http://www.ruby-forum.com/.

Re: [rspec-users] .with(:anything) issue

2008-11-13 Thread David Chelimsky
On Thu, Nov 13, 2008 at 7:45 AM, Emmanuel Pirsch <[EMAIL PROTECTED]> wrote: > Great, it worked! > > Here is where I found the doc which talk about using symbols : > http://rspec.info/documentation/mocks/message_expectations.html Fixed. Sorry for the misinformation and thanks for the heads up. Che

Re: [rspec-users] testing an action which requires picture

2008-11-13 Thread Ramon Tayag
You can put that barcode in the spec/fixtures directory. However, you'll need to manually place it there. Ramon Tayag On Thu, Nov 13, 2008 at 7:18 PM, Mano ah <[EMAIL PROTECTED]> wrote: > Actually i need to test sending a barcode image and also test a value > returned by it. > -- > Posted via h

Re: [rspec-users] testing an action which requires picture

2008-11-13 Thread Mano ah
Ramon Tayag wrote: > I suggest doing those tests in the model, not in the controller. Just > do that fixture thing for the controller spec to pass. But pass the > same thing in the model. Here's a sample of how I do it > > require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') >

Re: [rspec-users] testing an action which requires picture

2008-11-13 Thread Mano ah
Actually i need to test sending a barcode image and also test a value returned by it. -- 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] Cucumber: The Mysteries of Before(), After(), World() etc

2008-11-13 Thread Peter Jaros
On Wed, Nov 12, 2008 at 8:59 AM, David Chelimsky <[EMAIL PROTECTED]> wrote: > On Wed, Nov 12, 2008 at 7:30 AM, aslak hellesoy > <[EMAIL PROTECTED]> wrote: >> World do >> world = Object.new >> world.extend(Logging::Logger) >> world >> end > > World do > returning Cucumber::Rails::World do |world

Re: [rspec-users] Cucumber: The Mysteries of Before(), After(), World() etc

2008-11-13 Thread David Chelimsky
On Thu, Nov 13, 2008 at 8:59 AM, Peter Jaros <[EMAIL PROTECTED]> wrote: > On Wed, Nov 12, 2008 at 8:59 AM, David Chelimsky <[EMAIL PROTECTED]> wrote: >> On Wed, Nov 12, 2008 at 7:30 AM, aslak hellesoy >> <[EMAIL PROTECTED]> wrote: >>> World do >>> world = Object.new >>> world.extend(Logging::Logg

Re: [rspec-users] Cucumber: The Mysteries of Before(), After(), World() etc

2008-11-13 Thread Matt Wynne
On 13 Nov 2008, at 15:01, David Chelimsky wrote: On Thu, Nov 13, 2008 at 8:59 AM, Peter Jaros <[EMAIL PROTECTED]> wrote: On Wed, Nov 12, 2008 at 8:59 AM, David Chelimsky <[EMAIL PROTECTED] > wrote: On Wed, Nov 12, 2008 at 7:30 AM, aslak hellesoy <[EMAIL PROTECTED]> wrote: World do world = Obj

Re: [rspec-users] testing an action which requires picture

2008-11-13 Thread Ramon Tayag
Hmm.. not sure what that error is. The veterans in here might be able to help you. The create action should work... btw, this is a model spec, not a controller spec, just in case you're a newbie. Ramon Tayag On Thu, Nov 13, 2008 at 8:48 PM, Mano ah <[EMAIL PROTECTED]> wrote: > Can I know what t

Re: [rspec-users] Cucumber: The Mysteries of Before(), After(), World() etc

2008-11-13 Thread aslak hellesoy
On Thu, Nov 13, 2008 at 3:59 PM, Peter Jaros <[EMAIL PROTECTED]> wrote: > On Wed, Nov 12, 2008 at 8:59 AM, David Chelimsky <[EMAIL PROTECTED]> wrote: >> On Wed, Nov 12, 2008 at 7:30 AM, aslak hellesoy >> <[EMAIL PROTECTED]> wrote: >>> World do >>> world = Object.new >>> world.extend(Logging::Logg

Re: [rspec-users] Cucumber: The Mysteries of Before(), After(), World() etc

2008-11-13 Thread Peter Jaros
On Thu, Nov 13, 2008 at 10:01 AM, David Chelimsky <[EMAIL PROTECTED]> wrote: > That's a cool idea - can you put a feature request in lighthouse? Done: http://rspec.lighthouseapp.com/projects/16211-cucumber/tickets/87-yield-existing-world-object-to-world-block Peter _

[rspec-users] Learning Cucumber

2008-11-13 Thread James B. Byrne
Here is the scenario: Scenario: Create a new entity row Given I am on the new entity page When I fill in a textbox labelled "Common Name" with "My New Entity" And I fill in a textbox labelled "Full Legal Name:" with "My New Enitity is a CORP" And I select from a listbox labelled

Re: [rspec-users] Learning Cucumber

2008-11-13 Thread James B. Byrne
On Thu, November 13, 2008 11:51, James B. Byrne wrote: > So, evidently I need some other specification to check the validity of the > action with respect to the web page displayed. Can some one give me a > hint as to what "I should see "X" should actually say? Should this be a > regex? In othe

[rspec-users] Skipped steps running stealthily

2008-11-13 Thread Peter Jaros
I've just noticed that my "skipped" steps are actually running, but their errors are being swallowed. They can print to the screen, however. Is that intentional? It's certainly not what I was expecting. I assumed skipped steps were...skipped. Peter _

Re: [rspec-users] Skipped steps running stealthily

2008-11-13 Thread David Chelimsky
On Thu, Nov 13, 2008 at 11:41 AM, Peter Jaros <[EMAIL PROTECTED]> wrote: > I've just noticed that my "skipped" steps are actually running, but > their errors are being swallowed. They can print to the screen, > however. Is that intentional? It's certainly not what I was > expecting. I assumed s

[rspec-users] Selecting a date with Webrat

2008-11-13 Thread Mike Sassak
Hi, I'm writing a scenario that needs to select date values from a form created with Rails' form_for() method, and I'm looking for a clean way to do that by specifying only the label (in this case "Date"), rather than by selecting from each select list one by one. What I'd like to be able to writ

Re: [rspec-users] Mixing in spec helper methods

2008-11-13 Thread Nick Hoffman
On 2008-11-12, at 16:38, Ben Mabey wrote: Nick Hoffman wrote: After digesting that post again, especially the contents of #self.included , I noticed that one could alternatively do this: module AssignMacro def self.extended(receiver) receiver.extend ExampleGroupMethods receiver.send :i

[rspec-users] webrat cannot find label?

2008-11-13 Thread James B. Byrne
Cucumber 0.1.9, Rails 2.2.0RC1, Ruby 1.8.6, Webrat... etc. Here is the scenario: Scenario: Attempt to ADD a VALID entity Given I am on the new entity page When I fill in "Common Name" with "My Common Name" And I to select "CORP" from the list labelled "Legal Form" And I fil

Re: [rspec-users] Selecting a date with Webrat

2008-11-13 Thread Ben Mabey
Mike Sassak wrote: Hi, I'm writing a scenario that needs to select date values from a form created with Rails' form_for() method, and I'm looking for a clean way to do that by specifying only the label (in this case "Date"), rather than by selecting from each select list one by one. What I'd li

Re: [rspec-users] Selecting a date with Webrat

2008-11-13 Thread David Chelimsky
On Thu, Nov 13, 2008 at 1:14 PM, Ben Mabey <[EMAIL PROTECTED]> wrote: > Mike Sassak wrote: >> >> Hi, >> >> I'm writing a scenario that needs to select date values from a form >> created with Rails' form_for() method, and I'm looking for a clean way >> to do that by specifying only the label (in thi

Re: [rspec-users] webrat cannot find label?

2008-11-13 Thread James B. Byrne
On Thu, November 13, 2008 14:02, James B. Byrne wrote: > > What is the correct syntax to test selecting from a range of values > present in an input box? ... The webrat API specifies this: selects(option_text, options = {}) Verifies that a an option element exists on the current page with t

Re: [rspec-users] Selecting a date with Webrat

2008-11-13 Thread Mike Sassak
It sure does. Thanks! On Thu, Nov 13, 2008 at 2:14 PM, Ben Mabey <[EMAIL PROTECTED]> wrote: > Mike Sassak wrote: >> >> Hi, >> >> I'm writing a scenario that needs to select date values from a form >> created with Rails' form_for() method, and I'm looking for a clean way >> to do that by specifying

Re: [rspec-users] webrat cannot find label?

2008-11-13 Thread David Chelimsky
On Thu, Nov 13, 2008 at 1:41 PM, James B. Byrne <[EMAIL PROTECTED]> wrote: > > On Thu, November 13, 2008 14:02, James B. Byrne wrote: > >> >> What is the correct syntax to test selecting from a range of values >> present in an input box? ... > > The webrat API specifies this: > > selects(option_t

Re: [rspec-users] webrat cannot find label?

2008-11-13 Thread James B. Byrne
On Thu, November 13, 2008 14:41, James B. Byrne wrote: > > So, as far as I can make out, given the webrat API specifies that a label > is an acceptable target, this should work. But it evidently does not. Is > this a webrat problem then? > Does anyone know why webrat does this for select:

Re: [rspec-users] webrat cannot find label?

2008-11-13 Thread Mike Sassak
That's odd. I use the same step in my own scenarios and it works fine. One problem I did run into is that the label alone isn't always enough for webrat to find the input field. The id on the label must match the id on the labeled field for selection by label to work. Sometimes they differ, for exa

Re: [rspec-users] Selecting a date with Webrat

2008-11-13 Thread aslak hellesoy
On Thu, Nov 13, 2008 at 8:20 PM, David Chelimsky <[EMAIL PROTECTED]> wrote: > On Thu, Nov 13, 2008 at 1:14 PM, Ben Mabey <[EMAIL PROTECTED]> wrote: >> Mike Sassak wrote: >>> >>> Hi, >>> >>> I'm writing a scenario that needs to select date values from a form >>> created with Rails' form_for() method

Re: [rspec-users] webrat cannot find label?

2008-11-13 Thread James B. Byrne
On Thu, November 13, 2008 14:59, James B. Byrne wrote: > > So, as far as I can make out, given the webrat API specifies that a > label is an acceptable target, this should work. But it evidently > does not. Is this a webrat problem then? It seems as if I have run into two separate webrat probl

Re: [rspec-users] Selecting a date with Webrat

2008-11-13 Thread Ben Mabey
aslak hellesoy wrote: On Thu, Nov 13, 2008 at 8:20 PM, David Chelimsky <[EMAIL PROTECTED]> wrote: On Thu, Nov 13, 2008 at 1:14 PM, Ben Mabey <[EMAIL PROTECTED]> wrote: Mike Sassak wrote: Hi, I'm writing a scenario that needs to select date values from a form created with Rails'

Re: [rspec-users] Autotest style autotest/rails_rspec doesn't seem to exist. Aborting.

2008-11-13 Thread Ramon Tayag
Yup, I submoduled them :) I suppose that's just like an external svn repo. I'll try reinstalling them... but in the mean time, got any ideas? Ramon Tayag On Thu, Nov 13, 2008 at 9:44 PM, David Chelimsky <[EMAIL PROTECTED]> wrote: > You need rspec-rails as well (plugin or gem, same version as rsp

Re: [rspec-users] webrat cannot find label?

2008-11-13 Thread Mike Sassak
Hi James, If you're using the generated common_webrat steps that cucumber generates for Rails projects, then "I select X from Y" should work just fine. The step itself calls Webrat's select method like so: selects(value, :from => field). You can see an example of sorts in the first comments here:

Re: [rspec-users] Learning Cucumber

2008-11-13 Thread Andrew Premdas
What you're doing here is writing imperative features. Writing declarative features might be a better alternative. Instead of Given I am on the new entity page When I fill in a textbox labelled "Common Name" with "My New Entity" And I fill in a textbox labelled "Full Legal Name:" with "My N