Re: [rspec-users] found some inconsistently behavior on its method.

2011-01-14 Thread David Chelimsky
support rails 2 and I'm using rails 2. > Sorry about the lack of the information in my report. No apology necessary. There are a couple of projects in the works to make rspec 2 work with rails 2, but I don't think any are ready for general consumption. > Cheers, > Nori > >

Re: [rspec-users] rspec 2.4 incorrect time reported

2011-01-14 Thread David Chelimsky
On Jan 14, 2011, at 9:56 AM, Michael Guterl wrote: > I keep seeing strange run times for our specs: > > Finished in -348317500.25314 seconds > > Any thoughts are much appreciated. Are you stubbing Time.now anywhere? ___ rspec-users mailing list rspec-

Re: [rspec-users] [rspec-rails] how to test module behavior once and then confirm that controllers implement it?

2011-01-15 Thread David Chelimsky
On Jan 15, 2011, at 9:45 AM, Lille wrote: > Thanks Nick, that was helpful. > > I'm wondering if it's possible to test module behavior and then test > that the module behavior of interest is invoked from the before/after > filter enclosing the controller action under test. > > To me, it seems tha

Re: [rspec-users] formatting of one-line specs - question

2011-01-16 Thread David Chelimsky
On Jan 16, 2011, at 1:35 PM, andyl wrote: > For easy editing, I love one-line specs, like this: > > specify { 1.should == 1 } > > But when using '--format documentation', one-line specs don't always > render useful documentation. > > A solution is to write one-line specs using do/end: > > it

Re: [rspec-users] Sudden rspec problem

2011-01-16 Thread David Chelimsky
On Jan 16, 2011, at 4:47 PM, Rich Price wrote: > I was using rspec 2.4.0 to test some code > and it was working fine then suddenly I get > > rich@richlaptop2:~/Documents/fakemap/rspec$ rspec block.rb > /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': > ../code/fmutil.rb

Re: [rspec-users] Aidmock - safe mocking

2011-01-16 Thread David Chelimsky
On Jan 16, 2011, at 5:52 PM, Wilker wrote: > Hi guys, > > I launched some days ago a new project that aims to make the use of mocks > safer. > This is the URL of project: https://github.com/wilkerlucio/aidmock > > The basic idea is to make user define interfaces of classes, when user > defines t

Re: [rspec-users] session variable not available in global before(:each, :type => :controller)

2011-01-17 Thread David Chelimsky
On Fri, Jan 14, 2011 at 4:07 AM, Rob Aldred wrote: > Hi, I'm refactoring some specs, in controller specs I have a before(:each) > which sets up things required in the session, wanted to avoid duplication and > put the initial setup global for each controller spec > > my before filter is... > > c

Re: [rspec-users] Using integrate_views for all controller specs

2011-01-17 Thread David Chelimsky
On Jan 17, 2011, at 12:40 PM, Joe Van Dyk wrote: > Is there a way to always use integrate_views for all controller specs? > I hate having to remember to insert that line into each one. # rspec-rails-1 Spec::Runner.configure do |c| c.integrate_views end # rspec-rails-2 # Doc'd on http://relish

Re: [rspec-users] Performance tests using Rspec

2011-01-17 Thread David Chelimsky
On Jan 16, 2011, at 8:29 PM, Evan wrote: > 1) Know of any guides to writing performance tests using Rspec? There's nothing built in as of yet, but you can do this pretty easily: require 'benchmark' RSpec::Matchers.define :take_less_than do |n| chain :seconds do; end match do |block|

Re: [rspec-users] Best Practice for Controllers

2011-01-17 Thread David Chelimsky
On Jan 17, 2011, at 10:16 AM, David Kahn wrote: > On Mon, Jan 17, 2011 at 9:48 AM, Ants Pants wrote: > Hello all, > > From what I've seen, this type of question doesn't really seem to get an > answer on this list as most of the replies relate to failures of RSpec. If > this is the case, where

Re: [rspec-users] Rspec Nested Resources: Can someone offer an 'update' example?

2011-01-17 Thread David Chelimsky
On Jan 13, 2011, at 3:53 PM, SpringChicken wrote: > Hi folks, > > I've just spent a day trying to write up a basic update spec for a > nested resource - all without avail. I'm quite new to RSpec & not sure > what I'm doing wrong. I can't seem to get a stub that recognises the > required associati

[rspec-users] major release required?

2011-01-18 Thread David Chelimsky
Hi all, Since the release of rspec-2.0, I've been following Rubygems' rational versioning [1] as closely as possible. Patch releases (2.4.x) have only had bug fixes, and minor releases (2.x.0) have had new features, but no (intentionally) backward incompatible changes, which should require a ma

Re: [rspec-users] major release required?

2011-01-18 Thread David Chelimsky
On Jan 18, 2011, at 11:08 AM, Rick DeNatale wrote: > On Tue, Jan 18, 2011 at 9:15 AM, David Chelimsky wrote: >> Hi all, >> >> Since the release of rspec-2.0, I've been following Rubygems' rational >> versioning [1] as closely as possible. Patch release

Re: [rspec-users] Aidmock - safe mocking

2011-01-18 Thread David Chelimsky
nterface, like: > > Aidmock.double(Interface) > > but I mean your is cooler, and user will be able to apply mocks/stubs directly > > I will work on it today :) > > Thanks > --- > Wilker Lúcio > http://about.me/wilkerlucio/bio > Kajabi Consultant > +55 81 8

Re: [rspec-users] Aidmock - safe mocking

2011-01-18 Thread David Chelimsky
you have been asking for some sort of auditing tool for mocks that tell you when you're mocking stuff that doesn't exist, and Wilker here is finally offering a workable solution. Feedback, please :) Cheers, David > On Tue, Jan 18, 2011 at 7:12 PM, David Chelimsky wrote: >

Re: [rspec-users] detecting status of a spec in after block

2011-01-20 Thread David Chelimsky
On Jan 20, 2011, at 8:17 AM, vishnu wrote: > Hi > inside an after :each block, whats the best way to find out if the > current spec has run? If you're in an after block, the current spec has run. No need to query anything. > Right now the only solution I have is > self.example.instance_variab

Re: [rspec-users] autotest giving error when having shared example in specs

2011-01-21 Thread David Chelimsky
On Jan 21, 2011, at 4:57 AM, Rob Westgeest wrote: > On Nov 22 2010, 9:42 pm, LesFreeman wrote: >> On Sep 28, 10:42 pm, Amiruddin Nagri wrote: >> >>> I am having asharedexample'allow authorized actions' for my Rails 3 RSpec >>> 2.beta.20 application. Thesharedexamplelooks like >> >>> share_exam

Re: [rspec-users] parse!: invalid option "--autotest"

2011-01-21 Thread David Chelimsky
On Jan 19, 2011, at 3:53 PM, Sean McCleary wrote: > I keep getting the error every time I try to run my specs with "bundle > exec rake spec": > > /Users/sean/.rvm/gems/ruby-1.9.2-p0/gems/rspec-core-2.4.0/lib/rspec/ > core/option_parser.rb:18:in `parse!': invalid option: --autotest > (OptionParser

Re: [rspec-users] Rspec2 partial view gives nil:NilClass. Why?

2011-01-21 Thread David Chelimsky
On Jan 21, 2011, at 4:43 AM, poseid wrote: > On Jan 16, 10:46 am, poseid wrote: >> Hello, >> >> I am trying to get going with development of view components with >> Rspec2 and Rails3. >> However, I make the following observation, and I don't understand what >> is going on, and how to fix this. >>

Re: [rspec-users] major release required?

2011-01-21 Thread David Chelimsky
On Jan 19, 2011, at 6:48 AM, Rick DeNatale wrote: > On Tue, Jan 18, 2011 at 1:31 PM, David Chelimsky wrote: >> >> On Jan 18, 2011, at 11:08 AM, Rick DeNatale wrote: >> >>> On Tue, Jan 18, 2011 at 9:15 AM, David Chelimsky >>> wrote: >>>> Hi a

Re: [rspec-users] major release required?

2011-01-22 Thread David Chelimsky
On Fri, Jan 21, 2011 at 5:45 PM, Luis Lavena wrote: > On Tue, Jan 18, 2011 at 11:15 AM, David Chelimsky > wrote: >> >> [...] >> >> I think the right thing to do is to rely on the autotest plugin, but I also >> think that this would require a 3.0 release,

Re: [rspec-users] major release required?

2011-01-22 Thread David Chelimsky
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, Jan 18, 2011 at 1:31 PM, David Chelimsky >> > wrote: >> >> >

Re: [rspec-users] Arrange Act Assert (AAA) style syntax for rspec2

2011-01-22 Thread David Chelimsky
On Jan 21, 2011, at 10:32 AM, JDeville wrote: > I'd like to be able to test w/ this methodology, and i'm having > trouble figuring out where to hook in to rspec to do it. Near as I > can tell, the flow is this: > > run all of the before filters in the order of highest to lowest > context > > <<

Re: [rspec-users] major release required?

2011-01-22 Thread David Chelimsky
On Jan 22, 2011, at 6:50 PM, Andrew Premdas wrote: > ]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 DeNa

Re: [rspec-users] uninitialized constant ActionView::Helpers::TagHelper::ERB (NameError)

2011-01-23 Thread David Chelimsky
On Jan 22, 2011, at 5:30 PM, Andrew Dangerfield wrote: > I am a new to ruby and rails and am trying to refactor some code with > rspec and have run into a problem that has stumped me for a few days and > I have searched google and ruby/rails forums to no avail so I really > hope somebody can help

Re: [rspec-users] Ability to stub a method differently the second time its called

2011-01-26 Thread David Chelimsky
On Jan 26, 2011, at 7:34 AM, Rob Aldred wrote: > I'm having a bit of trouble stubbing out a method on a model which has some > quite specific behaviour. > Basically I want to check the method returns something different after ive > called update_attributes > > eg. > > @exam.draft? (returns tr

Re: [rspec-users] --tty vs. --color

2011-01-26 Thread David Chelimsky
On Jan 26, 2011, at 3:03 PM, John-Mason P. Shackelford wrote: > Greetings, > > What is the difference between rspec --tty and rspec --color. I just > noticed that under JRuby output for --color is not colored but for -- > tty it is. Seems like we only need one color option, why two? The --tty o

Re: [rspec-users] changes in rspec 2.4 break ci_reporter

2011-01-27 Thread David Chelimsky
On Jan 26, 2011, at 8:43 AM, vishnu wrote: > Hi > I use the ci_reporter gem for builds on my CI machine (hudson). > Prior to rspec 2.4, environment options would override commandline > options. So the gem used this to change the formatter and require its > files. > > In 2.4, that order has bee

Re: [rspec-users] feedback on matcher

2011-01-27 Thread David Chelimsky
On Jan 27, 2011, at 7:48 AM, Michael Guterl wrote: > We have moved from Rails 2 to 3 and the changing Mailer syntax has > caused us to rewrite some of our specs. > > In Rails 2: > > Implementation: > Mailer.deliver_job_application(job.id, user.id) > > Spec: > Mailer.should_receive(:deliver_j

Re: [rspec-users] Relish documentation for RSpec

2011-01-27 Thread David Chelimsky
On Jan 27, 2011, at 4:34 PM, James Almond wrote: > I was looking at the Relish documentation for RSpec today and noticed there > are a few missing bits. For example, the expectation raise_error can take a > block which the raised error gets passed to. This is not documented in the > Relish feat

Re: [rspec-users] Difference between :each and :all

2011-01-27 Thread David Chelimsky
On Jan 27, 2011, at 5:11 PM, John Feminella wrote: > That's not quite right. :each runs before _each_ spec, while :all runs > once, before _any_ spec. Perhaps :any is a better name? We could add it as an alternative for the same as :all. WDYT? > -- > John Feminella > Principal Consultant, BitsB

Re: [rspec-users] Difference between :each and :all

2011-01-27 Thread David Chelimsky
On Thu, Jan 27, 2011 at 8:53 PM, Rick DeNatale wrote: > On Thu, Jan 27, 2011 at 6:16 PM, David Chelimsky wrote: >> On Jan 27, 2011, at 5:11 PM, John Feminella wrote: >> >>> That's not quite right. :each runs before _each_ spec, while :all runs >>> once, befo

Re: [rspec-users] Performance tests using Rspec

2011-01-27 Thread David Chelimsky
On Jan 26, 2011, at 4:06 AM, Josep M. Bach wrote: > A while ago, I was looking at Minitest's benchmarking capabilities (contained > in a single file here) and I thought it would be great to have an equivalent > in RSpec. They have methods to assert type of performance (linear, > exponential...)

Re: [rspec-users] checking order of method calls on different mocks

2011-01-27 Thread David Chelimsky
On Jan 26, 2011, at 10:07 AM, Fregas wrote: > I have a spec where I need to check that the order of 2 method calls > to 2 different mocks is correct: > > mock_customer.should_receive(:save).ordered > mock_customer.should_recieve(:id).and_return(1).ordered Don't think it's related, but receive is

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

2011-01-27 Thread David Chelimsky
On Thu, Jan 27, 2011 at 2:05 PM, Doug Bryant wrote: > I'm currently running into the same issue and can find very little about it > on the interwebs - i.e. an individual test run with `script/spec` works fine > but the same test without any code changes fails when run as part of the > suite via `r

Re: [rspec-users] Named routes problem... more rails than rspec

2011-01-30 Thread David Chelimsky
On Jan 30, 2011, at 3:48 AM, Jason Nah wrote: > Howdy, > > I have emailed before about the inconsistencies I'm spotting when using named > routes/resource, but I think I've narrowed down the issue. It would seem this > has nothing to do with rspec per se, but more with how routing works with

Re: [rspec-users] Is there an easy way to inject each example text into test.log

2011-01-30 Thread David Chelimsky
On Jan 30, 2011, at 6:00 AM, Evgeniy Dolzhenko wrote: > On 1/30/2011 2:00 PM, Tom H. wrote: >> Evgeniy Dolzhenko wrote in post #978481: >>> Do you need the full source code of an example in the log output, or >>> just a description? >> Just the description would be good so I can match up the log e

Re: [rspec-users] Named routes problem... more rails than rspec

2011-01-30 Thread David Chelimsky
On Jan 30, 2011, at 9:34 AM, Rick DeNatale wrote: > On Sun, Jan 30, 2011 at 9:09 AM, David Chelimsky wrote: >> You can either use mock_model or mock_stub > > > David, > > Did you mean to say stub_model rather than mock_stub? Yes :) ___

Re: [rspec-users] Named routes problem... more rails than rspec

2011-01-30 Thread David Chelimsky
On Jan 30, 2011, at 5:53 PM, Jason Nah wrote: > On 31 January 2011 04:33, David Chelimsky wrote: > On Jan 30, 2011, at 9:34 AM, Rick DeNatale wrote: > > > On Sun, Jan 30, 2011 at 9:09 AM, David Chelimsky > > wrote: > >> You can either use mock_model or mock_stub

[rspec-users] feedback on feature request

2011-01-31 Thread David Chelimsky
Hey all, There is a feature request for rspec-core that I'd like to see some opinions about. The idea is to be able to reference subjects and methods defined with let() in parent groups from within the subject() and let() methods in a child group. Two approaches are to use super or a block argu

Re: [rspec-users] Difference between :each and :all

2011-01-31 Thread David Chelimsky
On Jan 31, 2011, at 3:38 AM, Evgeniy Dolzhenko wrote: > Btw. there is also before(:suite), and working from there wouldn't it make > sense to have > > 1. before(:suite) > 2. before(:group) > 3. before(:example) > > which would reflect the hierarchy of RSpec run (i.e. suite > group > example).

Re: [rspec-users] array order-agnostic matching?

2011-02-01 Thread David Chelimsky
On Feb 1, 2011, at 3:40 AM, James OBrien wrote: > hey, thanks for reading: > > I have a problem which can be reduced to this, > > from within an example of mine I call the helper 'expect_call' which is > defined thus: > > def expect_call(hash) > obj.should_receive(:some_ > method).with(hash

Re: [rspec-users] Notes on upgrading from RSpec 1 to RSpec 2

2011-02-01 Thread David Chelimsky
On Feb 1, 2011, at 4:23 PM, Kurt wrote: > I've started a chart of differences between RSpec 1 and 2 here: > http://snyderscribbles.blogspot.com/2011/01/rspec-2-changes-from-rspec-1.html > > I'll gladly post any new discoveries anyone want to contribute. It would be great if you would contribute

Re: [rspec-users] Notes on upgrading from RSpec 1 to RSpec 2

2011-02-01 Thread David Chelimsky
, and a lot of the Rails framework changed as well. And don't forget bundler. There are a lot of moving parts here, so if you can isolate the slow down to RSpec, please let us know what you find so we can address any specific issues. Thanks! David > On Jan 13, 11:11 am, David Chelimsk

Re: [rspec-users] Is there a way to tell rspec not to fail the test while in debugger?

2011-02-03 Thread David Chelimsky
On Feb 3, 2011, at 9:28 AM, David Kahn wrote: > On Thu, Feb 3, 2011 at 8:48 AM, Scott Taylor wrote: > > Probably manually rescuing your debugger call would work: > > begin > debugger > rescue Exception > end > > Thanks, I just tried this but no go, the rspec still trips and fails me out. > M

Re: [rspec-users] Is there a way to tell rspec not to fail the test while in debugger?

2011-02-03 Thread David Chelimsky
On Feb 3, 2011, at 11:04 AM, David Kahn wrote: > > > On Thu, Feb 3, 2011 at 10:32 AM, David Chelimsky wrote: > On Feb 3, 2011, at 9:28 AM, David Kahn wrote: > >> On Thu, Feb 3, 2011 at 8:48 AM, Scott Taylor wrote: >> >> Probably manually rescuing your debug

[rspec-users] rspec-core-2.5.1 is released!

2011-02-06 Thread David Chelimsky
rspec-core-2.5.1 is released! [full changelog](http://github.com/rspec/rspec-core/compare/v2.5.0...v2.5.1) This release breaks compatibility with rspec/autotest/bundler integration, but does so in order to greatly simplify it. With the release of rspec-core-2.5.1, if you want the generated

[rspec-users] rspec-2.5.0 is released!

2011-02-06 Thread David Chelimsky
RSpec-2.5.0 is released! This is a minor upgrade, and is fully backward compatible with rspec-2.4. It includes several bug fixes, enhancements, and one deprecation. See the changelog below for details. We had a little glitch publishing the docs to [http://relishapp.com/rspec](http://relishapp.

Re: [rspec-users] Autotest Errors

2011-02-07 Thread David Chelimsky
On Wed, Feb 2, 2011 at 6:24 PM, Trenton Scott wrote: > >From my Rails project directory in Terminal, I'm able to run 'bundle > exec rspec spec/' and it works successfully. When I try and run > 'autotest', however, I get the error(s) below. Note: my .autotest file > has require 'autotest/growl' and

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

2011-02-08 Thread David Chelimsky
On Feb 8, 2011, at 4:14 AM, Matt Wynne wrote: > > On 4 Feb 2011, at 09:30, Alan B wrote: > >> Hi all, I'm trying to create a custom matcher that will visit a given >> path and check it's authenticated. >> Here's what I have so far (using rspec-rails and capybara): >> >> matcher :require_authen

[rspec-users] Opinions sought on feature/pull request

2011-02-10 Thread David Chelimsky
Hey all, Looking for thoughts on a feature/pull request: https://github.com/rspec/rspec-core/pull/306. Cheers, David ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] hash form of stub_chain returning nil for chains with shared first message

2011-02-10 Thread David Chelimsky
On Feb 10, 2011, at 12:40 PM, Frederick Cheung wrote: > I'm new using rspec, so please forgive me if I'm barking up the wrong tree, > but... > > I'd expect this to pass (using rspec 2.5.1) > > describe 'stub_chain' do > it "returns expected value from two chains with hash" do >subject = O

Re: [rspec-users] Pull requests via Github - To Fork or Not? That is the Question.

2011-02-10 Thread David Chelimsky
On Feb 10, 2011, at 6:29 PM, James Martin wrote: > Hi, > > I've been coming up with some documentation examples, which I'd like > to contribute as Cucumber features to go into the relishapp. > > I started following the contribute instructions on the rspec-dev > README[1] but have a question abou

Re: [rspec-users] mocking an AR: ActiveRecord::AssociationTypeMismatch error

2011-02-11 Thread David Chelimsky
On Feb 12, 2011, at 1:10 AM, Fearless Fool wrote: > I have a Premise model with lots of validations and somewhat complex > callbacks. I've already written tests for those (and they pass). > > I also have a MeteredService model for which premise :has_many > metered_services and (of course) meter

Re: [rspec-users] hash form of stub_chain returning nil for chains with shared first message

2011-02-12 Thread David Chelimsky
On Feb 11, 2011, at 7:51 AM, Frederick Cheung wrote: > On Feb 10, 7:30 pm, David Chelimsky wrote: >> On Feb 10, 2011, at 12:40 PM, Frederick Cheung wrote: >> >>> I'm new using rspec, so please forgive me if I'm barking up the wrong tree, >>> but... &

Re: [rspec-users] hash form of stub_chain returning nil for chains with shared first message

2011-02-12 Thread David Chelimsky
On Feb 12, 2011, at 5:55 PM, David Chelimsky wrote: > > On Feb 11, 2011, at 7:51 AM, Frederick Cheung wrote: > >> On Feb 10, 7:30 pm, David Chelimsky wrote: >>> On Feb 10, 2011, at 12:40 PM, Frederick Cheung wrote: >>> >>>> I'm new using

Re: [rspec-users] using before(:all) for cheap benchmark?

2011-02-12 Thread David Chelimsky
On Feb 9, 2011, at 9:36 PM, Robert Poor wrote: > I'm a new (and complete) convert to RSpec, especially when coupled with > autotest. > > I notice when automate processes my entire spec directory it takes about > eight minutes. I have many more tests to add before I'm done, so eventually > I'l

[rspec-users] feedback on feature request requested

2011-02-13 Thread David Chelimsky
Hey all, There is a feature request that would break compatibility for some rspec suites using older conventions. I'm in favor of adding the feature in 3.0 release when we get there, but would appreciate hearing from those that would be inconvenienced by this change. Please comment in the issue

Re: [rspec-users] (Bad) Memory Leak in RSpec 2

2011-02-14 Thread David Chelimsky
On Feb 14, 2011, at 7:08 PM, Kane Baccigalupi wrote: > We have had a really great integrated javascripting testing in our very > large, very javascripty Sinatra application. Our testing setup uses a > custom version of harmony (http://github.com/baccigalupi/harmony), that > reduces the out of cont

Re: [rspec-users] (Bad) Memory Leak in RSpec 2

2011-02-14 Thread David Chelimsky
On Feb 14, 2011, at 20:20, Kane Baccigalupi wrote: > David Chelimsky wrote in post #981651: > > I am happy to get back to you about the documentation a little later. I > want to take the time to fully describe the problems we had. Much appreciated. > >> Please let me

Re: [rspec-users] (Bad) Memory Leak in RSpec 2

2011-02-14 Thread David Chelimsky
On Feb 14, 2011, at 21:53, Kane Baccigalupi wrote: > Kane Baccigalupi wrote in post #981670: > >> We can try a global, but it isn't an ideal situation. > > So, we did replace @dom with $dom. That meant we could go back to doing > no manual garbage collection, and in fact we didn't even have to

Re: [rspec-users] Not loading RSpec::Rails::MailerExampleGroup

2011-02-15 Thread David Chelimsky
On Feb 15, 2011, at 9:11 AM, Andrei Maxim wrote: > Hi all, > > I'm working on Rails 3 application with ActiveRecord and ActionMailer > stripped out (I've commented out the respective lines in > config/application.rb), but I'm running into some problems when I'm running > the specs either via t

Re: [rspec-users] RSpec Error - "Invalid Option"

2011-02-16 Thread David Chelimsky
On Feb 15, 2011, at 11:43 PM, Trenton Scott wrote: > I keep getting an issue when running RSpec with Autotest. My > ~/.autotest file looks like this: > Any thoughts on what I'm doing wrong? > ==ERROR BEGINS== > bundle exec /Users/TTS/.rvm/rubies/ruby-1.9.2-p136/bin/ruby -S / > Users/ > TTS/.rvm

Re: [rspec-users] rspec not loading rails files- uninitialized constant error

2011-02-20 Thread David Chelimsky
On Feb 20, 2011, at 8:12 PM, Samantha John wrote: > I am new to rspec. Welcome! > I followed a few tutorials and set it up to test my > existing rails project. I ran the rspec generators and created > spec/user_spec.rb to test my user.rb model. > > The user.rb file starts with: > > class User

Re: [rspec-users] Rake generate - not generating spec files

2011-02-22 Thread David Chelimsky
On Feb 22, 2011, at 8:35 PM, Jason Nah wrote: > Howdy, > > I'm running the following stack: > rails 3.0.4 > rake (0.8.7) > rspec 2.5.0 > rspec-rails 2.5.0 > I created the rails app, and I didn't tell rails to exclude the default Test > mechanisms. > > I installed it using > > rails generate rs

Re: [rspec-users] Validations aren't being performed when running 'rspec spec'

2011-02-24 Thread David Chelimsky
On Feb 23, 2011, at 9:29 AM, Tom Milewski wrote: > Hello, > > When I run 'rspec spec/models' everything runs beautifully. > When I run 'rspec spec/controllers' everything also runs beautifully. > When I run 'rspec spec' the models seem to forget that the records > need to pass the validations bef

Re: [rspec-users] ordering dependency in tests?

2011-02-24 Thread David Chelimsky
On Feb 24, 2011, at 11:55 AM, Fearless Fool wrote: > I'm baffled. If I do: > > $ bundle exec ruby -S rspec --tty A_spec.rb > $ bundle exec ruby -S rspec --tty B_spec.rb > > I get no errors. But then if I do: > > $ bundle exec ruby -S rspec --tty A_spec.rb B_spec.rb > > I get an error o

Re: [rspec-users] ordering dependency in tests?

2011-02-24 Thread David Chelimsky
On Feb 24, 2011, at 12:36 PM, Fearless Fool wrote: > A little additional information: every time I run the tests, it creates > a new PremiseGroup model. Shouldn't the db get rolled back between > tests? > > Here is PremiseGroup, listed here in its entirety: > > class PremiseGroup < ActiveRec

Re: [rspec-users] ordering dependency in tests?

2011-02-24 Thread David Chelimsky
On Feb 24, 2011, at 12:58 PM, Fearless Fool wrote: > David Chelimsky wrote in post #983690: >>> RESIDENTIAL = self.create(:name => "residential") >> ^^ this is probably the problem ^^ >> ... > > Ah! got it. FWIW, I wrote a query to the Rails gr

Re: [rspec-users] Support for rspec-2 and rails 2.3.x

2011-02-24 Thread David Chelimsky
On Feb 24, 2011, at 8:09 PM, Wilson Bilkovich wrote: > On Thu, Feb 24, 2011 at 8:39 AM, Ross Kaffenberger wrote: >> Anyone have rspec-2 working with rails 2.3.x? We're looking at this route as >> an incremental step towards upgrading to rails 3. >> I saw David C mention in the rpec-2 release note

Re: [rspec-users] Rspec2 for rails 2.3.8?

2011-02-27 Thread David Chelimsky
On Feb 25, 2011, at 4:19 PM, Radhesh Kamath wrote: > Craig Demyanovich wrote in post #983991: >> On Fri, Feb 25, 2011 at 4:30 PM, Radhesh Kamath >> wrote: >> >>> Which version of rspec-rails should I use for Rails 2.3.8? >> >> >> rspec-rails 1.3.3 is currently the latest release for Rails 2.3.x

Re: [rspec-users] Writing Rspec for signup using facebook

2011-03-01 Thread David Chelimsky
On Mar 1, 2011, at 4:27 AM, Amit Kulkarni wrote: > Hi, > We are using omniauth for signup through Facebook and twitter. > Is there any way i can check this by rspec controllers since it contains > callbacks n all..so i think we may have to use mock models. > If there is any link or documentation p

[rspec-users] [ANN] Welcome Chad, Pat, Justin, and Myron!

2011-03-01 Thread David Chelimsky
I'm very pleased to announce the reformation of a core RSpec development team: Chad Humphries, a.k.a. spicycode, has been involved with RSpec since the 1.0 release, which he helped to usher out the door at RailsConf 2007. He subsequently authored Micronaut [1], a lightweight, RSpec compatible sp

Re: [rspec-users] calbacks on models

2011-03-03 Thread David Chelimsky
On Mar 2, 2011, at 11:49 AM, Andrea Reginato wrote: > Hi, I'm having some strange behavior on callbacks when testing with > RSpec2. On my test, when I create a resource using the #create method > the callbacks related to #before_create are not called. If I go to the > console and I try to type the

Re: [rspec-users] How to do controller.stub(:some_method) at request test when using rspec2

2011-03-03 Thread David Chelimsky
On Mar 3, 2011, at 1:36 AM, Jiang Guimin wrote: > Hi, > I hava a controller > > class DynamicFlowsController < ApplicationController > > def create > @workflow = Workflow.find_by_id(params[:workflow_id]) > table = @workflow.flex_table > save_u_and_node(table, @workflow.node_de

Re: [rspec-users] Ruby Debugger - not working in rspec?

2011-03-04 Thread David Chelimsky
On Mar 3, 2011, at 11:44 PM, Jason Nah wrote: > Howdy, > > I'm trying to get the ruby debugger to breakpoint at a specific line in > source. > > Here's what I did: > Added require "ruby-debug" in spec_helper.rb You don't need this ^^. > Added gem dependency to Gemfile (gem "ruby-debug" > In the

Re: [rspec-users] installing RSpec requires changing generators in config/applicaton.rb?

2011-03-05 Thread David Chelimsky
On Mar 1, 2011, at 2:59 PM, Daniel Kehoe wrote: > All the RSpec installation instructions I've seen (except the RSpec > Book) say something like: > > Set up the RSpec generator by adding the following to config/ > applicaton.rb: > config.generators do |g| > g.test_framework :rspec > end > > Or

Re: [rspec-users] Rails 3 Upgrade

2011-03-05 Thread David Chelimsky
On Mar 1, 2011, at 7:33 PM, Lakshmanan wrote: > Hi, > > I am upgrading a rails 2.1.0 app to Rails 3. Before I started my migration, I > wrote all the tests cases for my app in Rspec 1.x version. > > I am doubting whether rspec test cases written in 1.x version will work when > my app starts ru

Re: [rspec-users] db:test:prepare interfering with rake spec pattern

2011-03-05 Thread David Chelimsky
On Mar 4, 2011, at 9:53 PM, Mario Aquino wrote: > I have a tricky problem with running rake spec in a Rails 3.0.3 > project (using rspec-2.5.0, rspec-rails and rake 0.8.7). It may be > that this mailing list is not the correct one to ask for help, but I > am hoping that it is. When I run 'rake s

Re: [rspec-users] problem running rspec test with Webrat

2011-03-08 Thread David Chelimsky
On Mar 8, 2011, at 8:10 AM, Amit Kulkarni wrote: > Hi, > I am trying to run rspec testcase using webrat but it is showing me an > error as "undefined method `last_response' for #" > > Following are my configurations: > Gemfile: > > roup :development, :test do > gem 'sqlite3-ruby', :require => 's

Re: [rspec-users] How to use rspec_scaffold generator with latest rspec gem.

2011-03-10 Thread David Chelimsky
On Mar 10, 2011, at 7:49 AM, Mohnish J. wrote: > Hi, > > I am a newbie to Rails 3 and Rspec. Kindly excuse my being a novice. > > I am trying to use RSpec with Rails 3. I am using rails 3.0.3 and ruby > 1.9.2 on ubuntu 10.04 os. > > I am currently referring to the tutorial on :- > http://www.r

Re: [rspec-users] undefined method 'get'

2011-03-13 Thread David Chelimsky
On Mar 7, 2011, at 1:30 AM, DBA wrote: > Hello guys, > > I was just starting a rails 3.0.5 application with rspec-rails 2.5.0 > and ruby 1.9.2-p180 and when I went to describe my controller I ran > into this undefined method 'get' error. > > Here's the spec that is causing the problem (which li

Re: [rspec-users] Are there any ways to detect spec faults during a run?

2011-03-13 Thread David Chelimsky
On Mar 9, 2011, at 6:00 AM, Magnus Erickson wrote: > Hi, > Is there a way to detect if an example has failed? Something like a: > "example_failed?" method. > In my case I need to dump some information, i.e trace and error log, to be > used when analyzing what > went wrong in the example. I'm thi

Re: [rspec-users] render_views and render_to_string

2011-03-13 Thread David Chelimsky
I tried something similar and worked fine with or without render_views, so I really have no idea why you're experiencing that. Please file a bug report to https://github.com/rspec/rspec-rails/issues and be sure to include version numbers of Ruby, Rails and RSpec. On Wed, Mar 9, 2011 at 9:39 PM, N

Re: [rspec-users] Faking FS in specs

2011-03-13 Thread David Chelimsky
I think the problem is a missing API in FakeFS: http://rubydoc.info/gems/fakefs/0.3.1/FakeFS/File http://www.ruby-doc.org/core/classes/File.html#M24 On Mar 13, 2011, at 2:37 PM, Nicholas Wieland wrote: > hi Scott, thanks for the answer. > > https://gist.github.com/868356 > > I'm not even c

Re: [rspec-users] unless filter

2011-03-15 Thread David Chelimsky
On Mar 15, 2011, at 4:49 AM, Shamaoke wrote: > On 14 мар, 03:16, Myron Marston wrote: >> On Mar 11, 1:17 pm, Justin Ko wrote: >> >> >> >>> On Thu, Mar 10, 2011 at 2:32 AM, Shamaoke wrote: Hi. >> Why doesn't the following filter work? >> ~~~ # encoding: utf-8 # ./ex

Re: [rspec-users] Are there any ways to detect spec faults during a run?

2011-03-15 Thread David Chelimsky
On Mar 15, 2011, at 5:25 AM, Magnus Erickson wrote: > > 2011/3/13 David Chelimsky > On Mar 9, 2011, at 6:00 AM, Magnus Erickson wrote: > > > Hi, > > Is there a way to detect if an example has failed? Something like a: > > "example_failed?" method. > &

Re: [rspec-users] How do I use expect{}.to change().from().to() on Array?

2011-03-15 Thread David Chelimsky
On Mar 15, 2011, at 10:57 AM, niku -E:) wrote: > Hi. > > I'm using ruby1.9.2 and rspec2.5.1 > I want to use "expect{}.to change().from().to()" like this > > https://gist.github.com/870897 > > When Int class, it passed. > When Ary class, it failed. > > Why was Ary test failed and How do I pass

Re: [rspec-users] Counter.should_not_receive(:message) not working?

2011-03-17 Thread David Chelimsky
On Mar 17, 2011, at 8:24 PM, Pete Campbell wrote: > Justin Ko wrote in post #988060: > >> I would say "count_me" is not returning what you think it is. Try adding >> "raise count_me.inspect" in the controller action to see if this is the >> case. > > Thanks for the feedback. The code snippet isn

Re: [rspec-users] custom matcher and yielding too block

2011-03-19 Thread David Chelimsky
On Mar 15, 2011, at 10:27 AM, Jonathan Rochkind wrote: > Using the 'new' way of defining custom matchers explained here: > https://github.com/dchelimsky/rspec/wiki/Custom-Matchers > > I'm having trouble figuring out how to write a custom matcher that yields an > object to a block where more mat

Re: [rspec-users] Post call verification

2011-03-19 Thread David Chelimsky
On Mar 18, 2011, at 10:37 AM, Srushti Ambekallu wrote: > Hey all, > > I would like to be able to be able to have mocks where I can make all the > calls and assert that it was called afterwards. This would be especially > useful when asserting on a doing-method whose return value is not being >

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

2011-03-21 Thread David Chelimsky
On Mar 21, 2011, at 5:41 AM, Kai Schlamp wrote: > My ApplicationController exposes a method (e.g. sort_direction) to the > view templates by using > helper_method :sort_direction. > I then use this method in another method (e.g. sort_link) in a view > helper (application_helper.rb). > > When test

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

2011-03-21 Thread David Chelimsky
On Mar 21, 2011, at 8:40 AM, Kai Schlamp wrote: >> This error ^^ suggests that sort_direction is being called on the example >> itself rather than the helper object. Please post the spec so we can see >> what's going on. > > Sure ... > > describe ApplicationHelper do > describe "order link"

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

2011-03-21 Thread David Chelimsky
On Mar 21, 2011, at 11:19 AM, Kai Schlamp wrote: >> Change this ^^ to this: >> >> helper.fetch_param(:order) > > I was wrong the test fails also with the same error message: > > Failure/Error: order_link(:name) > NoMethodError: > undefined method `fetch_param' for #<#: > 0xb63be118>

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

2011-03-21 Thread David Chelimsky
On Mar 21, 2011, at 11:15 AM, Kai Schlamp wrote: >>> module ApplicationHelper >>> def order_link(column, title = nil) >>>fetch_param(:order) >> >> Change this ^^ to this: >> >> helper.fetch_param(:order) > Ok, the tests now runs fine, but unfortunately the site itself doesn't > work anym

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

2011-03-21 Thread David Chelimsky
On Mar 21, 2011, at 12:52 PM, Kai Schlamp wrote: >>> Failure/Error: order_link(:name) >>> NoMethodError: >>> undefined method `fetch_param' for #<#: >>> 0xb63be118> >> >> That's not the same error message you posted earlier: >> >> NoMethodError: >> undefined method `sort_directio

Re: [rspec-users] Post call verification

2011-03-22 Thread David Chelimsky
On Mar 22, 2011, at 4:13 AM, Tom Stuart wrote: > On 19 Mar 2011, at 13:35, David Chelimsky wrote: > >> On Mar 18, 2011, at 10:37 AM, Srushti Ambekallu wrote: >> >>> Hey all, >>> >>> I would like to be able to be able to have mocks where I can m

Re: [rspec-users] How to test a Rails 3 metal controller?

2011-03-22 Thread David Chelimsky
On Mar 22, 2011, at 7:50 AM, Thibaut Barrère wrote: > Hi! > > I could not find an easy solution to this question: how can I properly > test an Rails controller action? > > We were trying to run the following test: > >get :show, :id => 'hello' >response.should redirect_to("http://www.go

Re: [rspec-users] Stubs and Object Constructor

2011-03-23 Thread David Chelimsky
On Mar 20, 2011, at 11:38 PM, andyl wrote: > OK - I got this working using mocha and the 'any_instance' method. > > A gist with working examples is here: https://gist.github.com/879029 > > It looks like rspec mocks had an 'any_instance' method, but it was removed > because it promoted 'bad pr

Re: [rspec-users] current example

2011-03-23 Thread David Chelimsky
On Mar 23, 2011, at 8:03 AM, Michael Guterl wrote: > Is it possible to retrieve the example that is currently running? describe "an example" do it "knows itself as example" do example.description.should eq("knows itself as example") end end __

<    6   7   8   9   10   11   12   13   14   15   >