Re: [rspec-users] Testing routes with a prefix

2011-03-23 Thread David Chelimsky
On Wed, Mar 23, 2011 at 12:16 PM, Radhesh Kamath wrote: > Justin Ko wrote in post #988825: >> On Tue, Mar 22, 2011 at 6:50 PM, Radhesh Kamath >> wrote: >> >>>  end >>> >>> rspec-users@rubyforge.org >>> http://rubyforge.org/mailman/listinfo/rspec-users >>> >> >> You're mapping absolute strings (URL

Re: [rspec-users] Post call verification

2011-03-23 Thread David Chelimsky
[moved your post to the bottom for consistency with this thread] On Mar 23, 2011, at 1:41 PM, Srushti wrote: > On 22 March 2011 17:22, wrote: > > Date: Tue, 22 Mar 2011 06:52:02 -0500 > From: David Chelimsky > To: rspec-users > Subject: Re: [rspec-users] Post call verific

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

2011-03-27 Thread David Chelimsky
On Mar 26, 2011, at 9:43 PM, Rodrigo Rosenfeld Rosas wrote: > Hi David and fellows, > > I know this subject has already been discussed here and there are already > some attempts to support the given-when-then-and syntax in Rspec, like the > links below: > > https://gist.github.com/206969 > ht

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

2011-03-27 Thread David Chelimsky
On Mar 27, 2011, at 5:12 PM, Rodrigo Rosenfeld Rosas wrote: > Em 27-03-2011 06:55, David Chelimsky escreveu: >> On Mar 26, 2011, at 9:43 PM, Rodrigo Rosenfeld Rosas wrote: >> >>> Hi David and fellows, >>> >>> I know this subject has already been disc

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

2011-03-28 Thread David Chelimsky
On Mar 28, 2011, at 9:29 PM, Mike Tsao wrote: > Any ideas? All I'd like to do is have two specs in different files use > the same shared example group. I saw a similar thread about autotest, > but I am not using that. [Sorry for the double post on Google Groups; > didn't realize at the time it was

Re: [rspec-users] stubbing directly vs using stub method

2011-04-02 Thread David Chelimsky
On Apr 2, 2011, at 8:20 AM, Kai Schlamp wrote: > I use RSpec mock and stub like this: > > hit = mock("hit", :stored => 5) > > This works fine, but when using this instead: > > hit = mock("hit").stub(:stored) { 5 } > > then I get > > undefined method `stored' for # 0xb688bb78> > > I always th

Re: [rspec-users] Autotest Parallel Support

2011-04-02 Thread David Chelimsky
On Mar 28, 2011, at 3:53 PM, snelson wrote: > I have a commit to add support for the -p (parallel) option to > autotest, which is a feature provided by @grosser's autotest fork. > > The discussion is here: https://github.com/grosser/autotest/issues/#issue/13 > The commit is here: > https://githu

Re: [rspec-users] Bundler and Setting up RSpec

2011-04-03 Thread David Chelimsky
On Mar 28, 2011, at 9:59 AM, Stuart Corbishley wrote: > Hi there, > > Does RSpec acknowledge bundler, and use the groups? RSpec doesn't really know anything about Bundler's internals, but the rake task does look for a Gemfile and shells out to 'bundler exec rspec' if it sees one unless you con

Re: [rspec-users] Error running rspec on Debian

2011-04-03 Thread David Chelimsky
On Mar 28, 2011, at 8:04 PM, Carlos Torres wrote: > I'm new to Rails and I was planning on trying out RSpec. When I try to > execute the rspec command on Debian v6.0.1, I get the output below: > > k4ru050@DebianBox:~/Desktop/rails_projects/sample_app/spec$ bundle exec rspec > spec/controllers

Re: [rspec-users] Overriding Kernel#inspect just for tests

2011-04-08 Thread David Chelimsky
On Fri, Apr 8, 2011 at 1:52 AM, Stefan Kanev wrote: > Hi all. > Occasionally, I write specs that verify the order in which some ActiveRecord > objects are returned. For example, in a toy project I do: > > Reply.stub :per_page => 2 > topic.replies_on_page(1).should == [second, first] > > The spec o

[rspec-users] rspec-1.3.2 is released!

2011-04-11 Thread David Chelimsky
rspec-1.3.2 is released! This is primarily a bug-fix release of the rspec-1.x series, and is recommended for all users who have not yet upgraded to rspec-2. === Version 1.3.2 / 2011-04-11 * Enhancements * Raise a meaningful error when an argument-scoped stub is called with the wrong args

[rspec-users] rspec-rails-1.3.4 is released!

2011-04-11 Thread David Chelimsky
rspec-rails-1.3.4 is released! === Version 1.3.4 / 2011-04-11 * No new code * Depends on rspec ~> 1.3.2 * rspec-rails 1.3.3 depended on rspec-1.3.1 explicitly, so this release allows you to upgrade to rspec-1.3.2 with rspec-rails. ___ rspec-users

Re: [rspec-users] RSpec 2.5 not seeing MiniTests?

2011-04-12 Thread David Chelimsky
On Apr 12, 2011, at 1:59 PM, josh wall wrote: > I originally tried using the upgrade instructions on relish/core/upgrade > but eventually stripped it down to a couple files and still cannot get > RSpec to pick up my minitest tests. I don't actually use > describe/should syntax, I am basically us

Re: [rspec-users] rspec _and_ Rails test::unit tests

2011-04-15 Thread David Chelimsky
On Apr 10, 2011, at 6:45 PM, ybakos wrote: > There's so much different chatter about this issue and I was wondering > if any of you could spare the time to assist. > > Start a new Rails3 project. Initialize rspec for the project. Now run > autotest. Ok, great, "loading autotest/rails_rspec2" > >

Re: [rspec-users] warning: toplevel constant XYZ referenced Admin:XYZ

2011-04-15 Thread David Chelimsky
On Apr 15, 2011, at 11:02 AM, dblock wrote: > I have an odd problem. I got controllers in a namespace and > controllers outside of the namespace. For example, I have a > PagesController and a Admin::PagesController. > > When I run rspec from the top, tests pass and I get the following > warning:

Re: [rspec-users] rspec execution speed footprint

2011-04-16 Thread David Chelimsky
On Apr 16, 2011, at 9:05 AM, Rodrigo Rosenfeld Rosas wrote: > Hi, I would like to figure out if it is possible for me to run my specs > faster than it currently is. > > Before start optimizing my specs for speed, I tried to figure out what was > the speed footprint of Rspec boot process itself

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

2011-04-17 Thread David Chelimsky
On Apr 16, 2011, at 4:56 PM, Jarmo Pertman wrote: > Hello! > > I've just added a new cool matcher #in into my framework WatirSplash > and thought that this could be integrated into RSpec directly actually > if there's any interest. > > WatirSplash uses Watir (or Watir-like) frameworks for testin

[rspec-users] rspec-2.6.0.rc2 is released!

2011-04-17 Thread David Chelimsky
We're releasing rspec-2.6.0.rc2 as a release candidate as there are some internal changes that we'd like to see put through their paces before doing a final release. Note that the changes I speak of are internal. There are no new deprecations in this release, nor any backward-incompatible change

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

2011-04-18 Thread David Chelimsky
On Apr 18, 2011, at 7:49 AM, Jarmo Pertman wrote: > On Apr 17, 6:58 pm, Justin Ko wrote: >> On Sun, Apr 17, 2011 at 10:01 AM, David Chelimsky >> wrote: >>> On Apr 16, 2011, at 4:56 PM, Jarmo Pertman wrote: >> >>>> Hello! >> >>>&

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

2011-04-18 Thread David Chelimsky
On Apr 18, 2011, at 9:39 AM, Jarmo Pertman wrote: > On Apr 18, 4:21 pm, David Chelimsky wrote: >>> but it doesn't >>> conflict with matcher's #in anyway. >> >> It conflicts with the name :) It's a problem when we have one name that >> m

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

2011-04-19 Thread David Chelimsky
On Apr 19, 2011, at 3:00 AM, Jarmo Pertman wrote: > On Apr 18, 5:59 pm, David Chelimsky wrote: >> What do you think of within(n).seconds { ... }? > > I'm not sure i understand it fully taking into account the examples > above. Let me try to write them below: > expec

Re: [rspec-users] how to pass command-line parameter to Rspec script?

2011-04-19 Thread David Chelimsky
On Apr 18, 2011, at 10:58 PM, Zhong wrote: > Dear all, > > Anyone know how to pass command-line parameter to Rspec script? > > For example: > I want to run the test.rb script. Suppose there is a parameter that is > set in test.rb script is sleep. For the convenience,I want to set the > parameter

Re: [rspec-users] Trying to fix NullDB for Rails3/RSpec2.5.1

2011-04-23 Thread David Chelimsky
On Apr 23, 2011, at 10:26 AM, Matthew Van Horn wrote: > On Apr 23, 2011, at 10:40 AM, Matthew Van Horn wrote: > >> def self.nullify_contextually?(other) >> rspec_root = defined?(RSpec) ? RSpec : Spec >> if defined? rspec_root::Rails::RailsExampleGroup >> other.ancestors.include?(r

Re: [rspec-users] Stubbing corner case

2011-04-23 Thread David Chelimsky
On Apr 22, 2011, at 4:58 PM, Doug McInnes wrote: > Hi! > > I was just talking to @dchelimsky over Twitter about a weird corner case > we've run into on 1.3.1 (I've also been able to reproduce it in 1.3.2) > > So we're using this gem called ClassyStruct that's a higher performing > OpenStruct:

Re: [rspec-users] stubbing Model.find(id) issues

2011-04-24 Thread David Chelimsky
On Apr 24, 2011, at 9:29 AM, Rodrigo Rosenfeld Rosas wrote: > I've started a fresh rails app with Employee belongs_to Company. > > Here is the spec: > > describe Employee do > example "stub should work with find(id)" do >company = mock_model Company >Company.stub!(:find).with(company.id

Re: [rspec-users] Slow test suite with Ruby 1.9.2 and Rspec 2.5

2011-04-24 Thread David Chelimsky
On Apr 24, 2011, at 3:24 PM, Alisson Sales wrote: > Hi, I've started a Rails 3 project using Ruby 1.9.2 and Rspec 2 and my > test suite is now growing and I'm not happy with the amount of time it > is tooking to run. I did a benchmark of it with Ruby Enterprise > Edition 1.8.7 2011.03 and it ran m

Re: [rspec-users] stubbing Model.find(id) issues

2011-04-24 Thread David Chelimsky
On Apr 24, 2011, at 6:25 PM, Rodrigo Rosenfeld Rosas wrote: > Em 24-04-2011 12:09, David Chelimsky escreveu: >> On Apr 24, 2011, at 9:29 AM, Rodrigo Rosenfeld Rosas wrote: >> >>> I've started a fresh rails app with Employee belongs_to Company. >>> &

Re: [rspec-users] Slow test suite with Ruby 1.9.2 and Rspec 2.5

2011-04-25 Thread David Chelimsky
Great work! Thanks for following up. Cheers, David On Apr 25, 2011, at 8:19 AM, Alisson Sales wrote: > I've found the problem. The gem meta_where > (https://github.com/ernie/meta_where) is doing something wrong in ruby > 1.9.2, just removing it from my Gemfile and my suite is running fast > agai

Re: [rspec-users] Mocking/Stubbing behavior question

2011-04-27 Thread David Chelimsky
On Apr 26, 2011, at 5:39 PM, Matthew Van Horn wrote: > > On Apr 26, 2011, at 4:02 PM, Rodrigo Rosenfeld Rosas wrote: > >> Ok, now I understand what is your issue. >> > class Foo > end > > class Bar > def self.my_foo > @my_foo ||= Foo.new > end > def s

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

2011-04-27 Thread David Chelimsky
On Apr 27, 2011, at 3:55 PM, Sergio Ruiz wrote: > i am setting up a few objects that are interrelated for use in an rspec > test.. > > something like: > > describe Dimension do > > before(:each) do > text = "string here" > end > > it "should puts string" do > puts text > end > > end > > when

Re: [rspec-users] new goodness, Capybara::RSpecMatchers in helper specs

2011-04-27 Thread David Chelimsky
On Apr 26, 2011, at 8:54 AM, juwalter wrote: > This > https://github.com/rspec/rspec-rails/commit/59793dcc349b64f4ebcf742606371001256c774d > is exciting news!! ("this adds capybara matchers to view and helper > specs") > > Now, if I just knew how to take advantage of it? Do I have to require > s

[rspec-users] rspec-2.6.0.rc3 is released

2011-04-30 Thread David Chelimsky
This release addresses issues that were raised in the rspec-core-2.6.0.rc2 release. ### rspec-core-2.6.0.rc3 full changelog: http://github.com/rspec/rspec-core/compare/v2.6.0.rc2...v2.6.0.rc3 Enhancements * Clean up messages for filters/tags. ### rspec-mocks-2.6.0.rc3 full changelog: http:

[rspec-users] rspec-2.6.0.rc4 is released! [was rspec-2.6.0.rc3 is released]

2011-05-01 Thread David Chelimsky
There was a problem with the way the rc3 release was built that made it uninstallable, so I released rc4 this morning and all seems to work correctly. This release addresses issues that were raised in the rspec-core-2.6.0.rc2 release. ### rspec-core-2.6.0.rc4 full changelog: http://github.com

Re: [rspec-users] rspec contribution at railsconf?

2011-05-02 Thread David Chelimsky
On Apr 28, 2011, at 8:41 PM, Jed Schneider wrote: > Hi, > > I was curious if there was any interest in organizing a 'bugmash', if you > will, of any outstanding rspec features or issues during railsconf. (maybe > there is something planned that i missed?) > > I'm not sure how much there is to

Re: [rspec-users] rspec-rails not making routes accessible since I *think* 2.2.1 (Currently using 2.5)

2011-05-02 Thread David Chelimsky
On May 1, 2011, at 8:29 PM, JDeville wrote: > I'm trying to use: > get path_to_route What kind of spec? Controller? Request? View? > which had been working previously. Was this an intentional change? Nope. > Can I get this behavior back, Assuming it's actually missing, yes, but we've got nam

Re: [rspec-users] How can I execute rspec directly from ruby code?

2011-05-02 Thread David Chelimsky
On Apr 28, 2011, at 1:33 PM, Pablo Cantero wrote: > Hi > > Can I execute rspec directly from ruby code? I would like to do it > similar I can do using Test::Unit > > Test::Unit::UI::Console::TestRunner.run(MySuite.new(MyTestCase)) > > I was looking on internet how to execute it, but I wasn't f

Re: [rspec-users] Cucumber in Spanish?

2011-05-04 Thread David Chelimsky
On May 3, 2011, at 9:40 PM, Carmen Díaz Echauri wrote: > Hi All > > I'm trying to write test scenarios in Spanish with cucumber. But all my test > are passing :( I haven't really used cucumber that much. > Is there any setting that I'm missing. Where do I need to set that it is "es" > I cannot

[rspec-users] rspec-2.6.0.rc6 is released!

2011-05-06 Thread David Chelimsky
We're doing one more release candidate to update rspec-rails to work with rails-3.1.0.beta1. This will hopefully be the last release candidate, with a final release coming in just a few days. ### rspec-rails-2.6.0.rc6 full changelog: http://github.com/rspec/rspec-rails/compare/v2.6.0.rc4...v2.

Re: [rspec-users] Am I speccing it wrong?

2011-05-07 Thread David Chelimsky
On May 4, 2011, at 5:25 PM, nbenes wrote: > I consider myself an intermediate-to-advanced rubyist and rails > programmer. I've embraced TDD but sometimes wonder if I'm just doing > it wrong. I feel like it can take me longer to get the specs done > then should be necessary. > > I'll give a very

Re: [rspec-users] Best way to test validates_acceptance_of

2011-05-07 Thread David Chelimsky
On May 4, 2011, at 1:24 PM, Erik Lindblom wrote: > Hello, > > I am trying to write a test to make sure that the property > validates_acceptance_of is present on a model. In my exploration, I can't > seem to make a test that fails when this property is absent, then passes when > added. > > Any

Re: [rspec-users] Re-executing rspec tests in existing JRuby container

2011-05-07 Thread David Chelimsky
On May 4, 2011, at 2:29 PM, Nathan Voxland wrote: > I have a JRuby Servlet environment very much like the "Parse Once, > Eval Many Times on Servlet" example at > http://kenai.com/projects/jruby/pages/RedBridgeServletExamples. > > What I am trying to do is execute an rspec test by hitting a URL >

Re: [rspec-users] when mocking, does it scan the method being tested for outside calls?

2011-05-07 Thread David Chelimsky
On May 3, 2011, at 2:27 PM, S Ahmed wrote: > Say I want to test this method: > > > def modify_user_status(user_id) >.. >.. > >user = User.find(user_id) >.. >.. > end > > > Now could I mock the call to User.find()? > > I'm just trying to understand, when I run the test, an

Re: [rspec-users] Re-executing rspec tests in existing JRuby container

2011-05-07 Thread David Chelimsky
On May 7, 2011, at 9:38 AM, David Chelimsky wrote: > On May 4, 2011, at 2:29 PM, Nathan Voxland wrote: > >> I have a JRuby Servlet environment very much like the "Parse Once, >> Eval Many Times on Servlet" example at >> http://kenai.com/projects/jr

Re: [rspec-users] Rails3: setting session[:session_id] for requests testing

2011-05-09 Thread David Chelimsky
On May 9, 2011, at 6:40 PM, Fearless Fool wrote: > My app has some logic that permits some actions before the user logs in, > and I depend upon session[:session_id] as a handle for some state. > > My requests testing fails because session[:session_id] is null. I > attempted a somewhat brute forc

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

2011-05-10 Thread David Chelimsky
On May 10, 2011, at 11:50 AM, aslak hellesoy wrote: > > > On Mon, May 9, 2011 at 3:00 PM, S Ahmed wrote: > I'm a bit confused as to how cucumber and rspec integrate (if they d at all?). > > > RSpec is two things: > a) A runner (command line program) > b) An assertion library (should, should_n

Re: [rspec-users] Re-executing rspec tests in existing JRuby container

2011-05-11 Thread David Chelimsky
There was a similar issue reported to rspec-core that has some more info: https://github.com/rspec/rspec-core/issues/359 Cheers, David On May 11, 2011, at 2:45 PM, Nathan Voxland wrote: > I'll take a look at that. > > Nathan > > On May 7, 9:56 am, David Chelimsky wrote: &

Re: [rspec-users] rspec2 - have_rjs

2011-05-16 Thread David Chelimsky
On May 16, 2011, at 1:04 PM, Andy Koch wrote: > Hi, > > Updating a rails app to Rails3/rspec2 and have a spec using "have_rjs" > or "has_rjs?" - is there an rspec2 version or alternative? No there isn't in rspec-rails-2, but you can use the rails assert_select_rjs: http://api.rubyonrails.org/cl

Re: [rspec-users] rails3 session issue i think

2011-05-17 Thread David Chelimsky
On May 11, 2011, at 4:10 PM, Chris Habgood wrote: > I just started using rspec. I have controllers that inherit from an admin > controller. If I modify them to inherit from applicationcontroller the rspec > test works. If I inherit from admincontroller i get "" back for a new > template. Is

Re: [rspec-users] Reusing Spec's

2011-05-18 Thread David Chelimsky
On May 18, 2011, at 11:23 AM, Ken Egervari wrote: > Hello, > > Is there any way to reuse spec definitions, perhaps through some kind of > inheritance? > > For example, in rails, every time it generates a Spec I must tell it to > > 1) Include Devise::TestHelpers > 2) Log the user in, so there i

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

2011-05-19 Thread David Chelimsky
rspec-core-2.6.1 is released! This is a bug fix release, restoring integration with with rcov. full changelog: http://github.com/rspec/rspec-core/compare/v2.6.0...v2.6.1 * Bug fixes * Don't extend nil when filters are nil * `require 'rspec/autorun'` when running rcov. ___

Re: [rspec-users] Get detailed info about error

2011-05-22 Thread David Chelimsky
On May 22, 2011, at 5:19 PM, Mickael Faivre-Macon wrote: > Hello ! > > I just got this RSpec message: > > Failures: > > 1) Position just created should unmake correctly > Failure/Error: lambda { @p.unmake }.should_not raise_error > expected no Exception, got # for false:FalseClass> >

Re: [rspec-users] How to spec Rails view partials in shared folders

2011-05-23 Thread David Chelimsky
On May 23, 2011, at 5:54 PM, itsterry wrote: > Still can't find an answer on this one by Googling or tweaking > > Any thoughts appreciated... The following works for me: # # spec/shared/thing.html.erb_spec.rb require 'spec_helper' describe 'shared/_thing.h

Re: [rspec-users] Problems installing rspec 2.6

2011-05-24 Thread David Chelimsky
On May 24, 2011, at 12:27 PM, Andrew Premdas wrote: > On 24 May 2011 08:31, Bernd Blume wrote: > Hi, > > I've tried to install rspec on Mac OS X. > > I'm on Ruby 1.9.2p180. > > After > > gem install rspec > > > > and then > > rspec --help > > I get the following messages: >

Re: [rspec-users] autorun?

2011-05-24 Thread David Chelimsky
On May 24, 2011, at 2:28 PM, rogerdpack wrote: > Hello all. > I believe I was under the impression that with rspec 2, one didn't > need to require 'autorun' to have specs autorun. > Can anybody tell me if this is the case or not? > Thanks! > -roger- If you run using rspec, rake (e.g. RSpec::Core:

Re: [rspec-users] [rails] expecting <"edit"> but rendering with <"">.

2011-05-24 Thread David Chelimsky
On May 24, 2011, at 7:05 PM, Justin Ko wrote: > On Tue, May 24, 2011 at 2:25 PM, Chris Habgood wrote: > I keep getting "" returned when looking for a template: > > describe "edit action" do >it "edit action should render edit template" do > Food.stub(:find_by_id).and_return(food

Re: [rspec-users] fluent chaining drying

2011-05-25 Thread David Chelimsky
On May 25, 2011, at 10:07 AM, Gustavo Delfino wrote: > Hello all. Thanks to subjects, custom matchers and fluent chaining I was able > to greatly simplify my spec. But now I want to DRY my custom matchers. > > I have two custom matchers: 'have_text' and 'have_number' and both contain > exactly

Re: [rspec-users] How do you factor out common "before(:each)" calls so that multiple specs can use them?

2011-05-25 Thread David Chelimsky
On May 25, 2011, at 3:50 PM, Ken Egervari wrote: > I'd like to factor this bunch of code so that all of my controller tests > (well, almost all of them) use this before(:each) block: > > before(:each) do > @user = User.new > controller.stub(:authenticate_user!) > controller.stub(:c

Re: [rspec-users] For those using Rails with RSpec... what do you guys use for creating Factories?

2011-05-25 Thread David Chelimsky
On May 25, 2011, at 2:00 PM, Ken Egervari wrote: > I am using factory_girl, and I have discovered that it is chiefly responsible > for making my tests run slow. > > I have posted a question about this on Stack Overflow: > > http://stackoverflow.com/questions/6128476/how-can-i-get-factory-girl-

[rspec-users] rspec-rails-2.6.1 is released!

2011-05-25 Thread David Chelimsky
rspec-rails-2.6.1 is released! This is a bug fix release that is compatible with the rails-3.0.0 to 3.0.7, 3.0.8.rc1, and 3.1.0.rc1 (it is mostly, but not fully compatible with but not rails-3.1.0.beta1). ### rspec-rails-2.6.1 / 2011-05-25 full changelog: http://github.com/rspec/rspec-rails/co

Re: [rspec-users] Newb struggling to get/keep RSpec stable

2011-05-25 Thread David Chelimsky
On May 25, 2011, at 5:56 PM, Meltemi wrote: > group :development, :test do > gem 'rspec-rails' > gem 'webrat' > gem 'haml-rails' > gem 'sass' I'd move haml and sass out of these groups - you need them in production. > gem 'spork', '~> 0.9.0.rc' > end > > group :test do > gem 'rspec' > end

Re: [rspec-users] Simple routing spec issue - syntax error

2011-05-26 Thread David Chelimsky
On May 26, 2011, at 11:51 AM, Peter Bell wrote: > Hi All, > > New to rspec. Done some Rails, done TDD in other languages, trying to get the > two to meet. Getting a syntax error on my first routing spec: > > context "public routing" do > it "routes / to public#landing" do >{ :get => "/" }.

Re: [rspec-users] RSpec and Rake

2011-05-28 Thread David Chelimsky
On May 28, 2011, at 7:12 AM, Jason Nah wrote: > Guys, > > Just upgraded to rspec / rspec-rails 2.6 today and noticed that it pulled in > rake 0.9.0 which was causing the rails 3.0.7 tasks to blowup. RSpec doesn't have a runtime dependency on rake, so it was not RSpec that caused this. It's mor

Re: [rspec-users] RSpec 2 not finding specs from subdirectories when trying to run specs from there

2011-06-01 Thread David Chelimsky
On Jun 1, 2011, at 9:14 AM, Jarmo Pertman wrote: > Hi! > > When having a file structure like this: > project > -spec >-subdir > -my_spec.rb > > and then being in directory "project" and running command `rspec spec` > everything works as expected. If running `rspec spec/subdir` to run >

Re: [rspec-users] how to include module into shared example group in RSpec 2

2011-06-01 Thread David Chelimsky
On Jun 1, 2011, at 9:10 AM, Jarmo Pertman wrote: > Hi! > > We tried to upgrade our RSpec from 1.3.1 to 2.6 and are having some > problems. It seems that shared example group includes modules > differently in RSpec 2. > > Consider the following code: > module MyModule > def testing > end > end

Re: [rspec-users] how to include module into shared example group in RSpec 2

2011-06-01 Thread David Chelimsky
On Jun 1, 2011, at 10:05 AM, Jarmo Pertman wrote: > Thank you :) > > Where can i see the differences between #it_should_behave_like, > #include_context and #include_examples? http://relishapp.com/rspec/rspec-core > > Jarmo > > On Jun 1, 5:42 pm, David Chelimsky wrot

Re: [rspec-users] RSpec 2 not finding specs from subdirectories when trying to run specs from there

2011-06-01 Thread David Chelimsky
gt; > C:\Users\jarmo\Desktop\minu\projects\Ruby\myproject>spec spec/subdir > . > > Finished in 0.040505 seconds > > 1 example, 0 failures > > It needs path to be specified with unix-slashes... Please do me a favor and report this to http://github.com/rspec/rspec-core/issues.

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

2011-06-03 Thread David Chelimsky
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 lives in support/spec/spec_helper.rb and I think its > purpose is to load the fixtures. > > modu

Re: [rspec-users] including a module with ActiveSupport::Concern works in console/site, but not in specs

2011-06-04 Thread David Chelimsky
On Jun 1, 2011, at 12:37 AM, JDeville wrote: > I have a simple module: > > module Buyer > extend ActiveSupport::Concern > > module ClassMethods > def delete_occasion(fb_id, recipient_fb_id, occasion_id) > # blah clah > end > end > end > > I include it like this: > class User

Re: [rspec-users] Not able to install rspec on Windows XP

2011-06-04 Thread David Chelimsky
On Wed, Jun 1, 2011 at 1:11 AM, Neha Thakur wrote: > Hi everyone, > > I have downloaded and saved the folder in C: > \Ruby192\rspec-1.2.9.rc1\rspec-1.2.9.rc1 > I am into the folder mentioned below and is trying to install rspec > but I am not able to do so...Can someone help me with this.. > > C:\

Re: [rspec-users] rspec1.3.2/rspec-rails1.3.4 and Rake 0.9.1 = lots of deprecation warnings

2011-06-04 Thread David Chelimsky
On Jun 3, 2011, at 12:20 PM, MattR wrote: > Hi folks, > > I've been searching google and I don't think this case has yet been > identified. I've got an older, Rails 2.3 app that is using rspec 1.3.x. We > upgraded Rake to 0.9.1, and now I get tons of deprecation warnings on > lib/tasks/rspec.

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

2011-06-05 Thread David Chelimsky
On Jun 4, 2011, at 2:55 PM, Tyson Tate wrote: > I created a gem a few weeks ago that I think the RSpec community might be > interested in: https://github.com/tysontate/scenario (and that I'd love to > get feedback on). It supports RSpec 1 and 2. > > It aims to solve a few of the problems we've

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

2011-06-06 Thread David Chelimsky
On Jun 6, 2011, at 4:26 PM, Patrick J. Collins wrote: > Hi everyone, > > I am using rvm, and when I try to do rake spec, I get: > > "You have already activated rake 0.9.0, but your Gemfile requires rake > 0.8.7. > Consider using bundle exec." > > ... Is there a way to get around t

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

2011-06-06 Thread David Chelimsky
On Jun 6, 2011, at 6:49 PM, Patrick J. Collins wrote: >> Here's how I deal with this: >> >> bundle install --binstubs # installs bin/rake, etc >> export PATH=./bin:$PATH > > Great! What about using debugger? > > rake spec gives me: > "* debugger statement ignored, use -d or --debug o

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

2011-06-06 Thread David Chelimsky
On Jun 6, 2011, at 7:53 PM, Patrick J. Collins wrote: >> rake doesn't take arguments like that. Try 'rspec spec --debugger'. > Hmm, that gives no output at all.. I just get a bash prompt immediately > after entering 'rake spec --debugger' rspec, not rake: rspec spec --debugger _

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

2011-06-07 Thread David Chelimsky
On Jun 7, 2011, at 4:21 AM, Patrick J. Collins wrote: >> Rake is a tool for running tasks of any nature, which you can invoke with >> the command `rake`. If you run `rake -T` in your project, you'll see that >> `rake spec` is just one of many other tasks you can run that do all kinds of >> thin

Re: [rspec-users] Is "it_should_behave_like" a code smell?

2011-06-07 Thread David Chelimsky
On Jun 7, 2011, at 10:31 AM, John Feminella wrote: > Consider the following simple Rails app: > > begin snippet > # lib/herpable.rb > module Herpable; ...; end > > # app/models/... > class ClassOne; include Herpable; end > class ClassTwo; include Herpable; end > # ... > end snipp

Re: [rspec-users] help with rspec

2011-06-12 Thread David Chelimsky
On Jun 12, 2011, at 2:25 AM, שלומי צדוק wrote: > Hi all, > My name is Shlomi Zadok - I am an old time PHP (mainly Drupal) developer and > I am doing my first application on Ruby on Rails ( I just love it!!) > I am trying to test my application with rspec and I am having problems. > > I have to

Re: [rspec-users] Stub an AR Model Instance Method

2011-06-12 Thread David Chelimsky
On Jun 9, 2011, at 12:33 PM, Karl wrote: > Obviously, I'm missing something very simple, can someone please > explain how to stub an instance of an AR model method. > > This does not work: > @widget = Widget.first # Widget has an instance method called > 'next_seriel_number' > @widget.stub(:next

Re: [rspec-users] subdomain based namespacing makes RSpec incorrectly state that the route doesn't exist

2011-06-12 Thread David Chelimsky
On Jun 9, 2011, at 11:03 AM, Daniel wrote: > Hello, > > I'm doing namespace routing based on subdomain, rather than path, so > that http://admin.example.com/pages leads to app/controllers/admin/ > pages_controller.rb. Cucumber is following this fine, but RSpec is > complaining that the requested

Re: [rspec-users] testing framework in 44 lines of ruby

2011-06-12 Thread David Chelimsky
On Jun 12, 2011, at 11:26 AM, Patrick J. Collins wrote: > Hi everyone, > > I just came across this post and was wondering if this is on target with how > RSpec works under the hood? > > http://www.skorks.com/2011/02/a-unit-testing-framework-in-44-lines-of-ruby/ What do you mean by "on target"?

Re: [rspec-users] testing framework in 44 lines of ruby

2011-06-12 Thread David Chelimsky
On Jun 12, 2011, at 12:52 PM, Patrick J. Collins wrote: >> What do you mean by "on target"? Are you asking if the implementations are >> the same, or similar? Or are you asking if attest meets the same goals as >> RSpec? > > More specifically, I meant the way he implements describe blocks and th

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

2011-06-13 Thread David Chelimsky
On Jun 13, 2011, at 8:29 PM, S Ahmed wrote: "How to mock when there seems to be a requirement for chained mocked calls?" There is no such requirement unless you are imposing it by your own design decisions. > I want to mock the following: > > MyModel.where(".").last Why do you want to do

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

2011-06-13 Thread David Chelimsky
On Jun 13, 2011, at 9:44 PM, S Ahmed wrote: > On Mon, Jun 13, 2011 at 9:37 PM, David Chelimsky wrote: > On Jun 13, 2011, at 8:29 PM, S Ahmed wrote: > > "How to mock when there seems to be a requirement for chained mocked calls?" > > There is no such requirement u

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

2011-06-15 Thread David Chelimsky
On Jun 15, 2011, at 7:29 AM, Matt Wynne wrote: > Hi, > > I have an idea for a tool I want to build. In a Cucumber Before() block, I > can say: > > Before do |scenario| > puts scenario.file_colon_line > end > > That then gives me the information I'd need to run that test case (and only > that

Re: [rspec-users] RSpec 2.6 + Capybara 1.0 incompatibility

2011-06-17 Thread David Chelimsky
On Jun 17, 2011, at 2:20 PM, Kai Schlamp wrote: > Here is also the spec helper I use for my integration tests: > > ENV["RAILS_ENV"] ||= 'test' > require File.expand_path("../../config/environment", __FILE__) > require 'rspec/rails' > require 'webrat' > require 'capybara/rspec' > require "database

Re: [rspec-users] Is there a way to run `let` once per context?

2011-06-24 Thread David Chelimsky
On Jun 24, 2011, at 7:17 AM, John Feminella wrote: > hello, > > I have a monolithic test that looks like this: > > == > describe Model do > describe "#method" do >let!(:expensive) { ... } > >it "should do a lot of things" do > expensive.should be_foo > expensive.should b

Re: [rspec-users] Is there a way to run `let` once per context?

2011-06-24 Thread David Chelimsky
this is becoming obnoxious suggests that something else > is probably bad (e.g. maybe the `expensive` model should be changed to > be less expensive to create). That's definitely worth investigating :) > I think I'll do that instead of trying > to go down this road further. Thanks

Re: [rspec-users] Model Validation fails (correctly) in rails console but not in rspec

2011-06-25 Thread David Chelimsky
On Jun 24, 2011, at 5:21 PM, ivanoats wrote: > Hi, I have been really stuck on this problem. My validation for my > model fails (like it should) when I'm testing it out in rails console, > but my rspec example fails because it validates anyway (which it > shouldn't). What am I missing here or whe

Re: [rspec-users] tags and spec_helper

2011-06-25 Thread David Chelimsky
On Jun 24, 2011, at 11:55 AM, Matt Wynne wrote: > I've been trying to separate out some fast specs in a Rails app in a Gary > Bernhardt style[1], and I experimented with using tags. > > The problem with using tags is that in order to scan the specs for examples > that match the tags, it loads e

Re: [rspec-users] how to mock/stub when there are multiple model objects?

2011-06-27 Thread David Chelimsky
On Jun 23, 2011, at 3:55 PM, S Ahmed wrote: > Thanks. > > I'm trying this now on a Model that is using Mongoid. > > I have tried: > > it "should ..." do > >User.stub(:some_call).and_return(User.new(:name => "blah")) > > end > > And when running spec on this file I get: > > NoMethodError

Re: [rspec-users] "user" received unexpected message :created_at with (no args)

2011-06-29 Thread David Chelimsky
On Jun 29, 2011, at 12:21 PM, S Ahmed wrote: > My method looks like: > > def self.can_do_this(user) > return false if user.nil? > ( (Time.now >= user.created_at) ? true : false ) > end > > my spec: > > it "should allow you to do this" do > user = stub("user") > user.stub(:nil?).and_re

Re: [rspec-users] Collection membership Error

2011-07-02 Thread David Chelimsky
On Thu, Jun 30, 2011 at 6:29 PM, Alex Katebi wrote: > > Using rspec version 2.6.4 I get an error with the Collection > membership. > > Example: [1,2].should include(1) The `include` method needs to be in an example for you to use it like this. It won't work in irb unless you first `include RSpec:

Re: [rspec-users] Caching in Rails by Default

2011-07-03 Thread David Chelimsky
On Jul 3, 2011, at 1:08 AM, John Hinnegan wrote: > So, maybe I need to go to the rails list with this, but I hit my error while > testing so I figured I'd ask here first. > > Basically, Rails.cache.fetch is being persisted by default in my rails > project between rspec runs. I've illustrated w

Re: [rspec-users] Trouble with RSpec mock "@macropost.should_receive(:save).and_return(true)" -- produces error expected :save with (any args) once, but received it 0 times

2011-07-10 Thread David Chelimsky
On Jul 8, 2011, at 5:37 PM, Dean wrote: > I'm getting the following RSpec failed test output when I run spec > spec/controllers/macroposts_controller_spec.rb: > > http://pastie.org/2184821 > > Here's the controller code for the "create" action for which the tests are > failing: > > http:/

Re: [rspec-users] Trouble with RSpec mock "@macropost.should_receive(:save).and_return(true)" -- produces error expected :save with (any args) once, but received it 0 times

2011-07-10 Thread David Chelimsky
On Jul 10, 2011, at 8:03 AM, Jatin kumar wrote: > On Sun, Jul 10, 2011 at 4:30 PM, David Chelimsky wrote: > > On Jul 8, 2011, at 5:37 PM, Dean wrote: > >> I'm getting the following RSpec failed test output when I run spec >> spec/controllers/macroposts_con

Re: [rspec-users] How to write render expectation in Controller Spec?

2011-07-12 Thread David Chelimsky
On Jul 12, 2011, at 4:36 AM, Chandu80 wrote: > Hello All, > I am a rspec beginner Welcome! > and I am trying to find a way out to write > render expectation in controller spec. I used the following ways > render '/channels/createchannel.html.erb' > view.should_receive(:render).with(:action => "c

Re: [rspec-users] Render expectation in Controller spec

2011-07-14 Thread David Chelimsky
On Jul 14, 2011, at 6:34 AM, Chandrika Shenoy wrote: > Hello All, > > I am a rspec beginner and I am trying to find a way out to write render > expectation in controller spec.All methods that I used seem to give me a > No Method error. > > My controller code is as follows > http://pastie.org/221

Re: [rspec-users] Render expectation in Controller spec

2011-07-15 Thread David Chelimsky
I moved your post to the bottom - please post either at the bottom or inline so we can follow the conversation more easily. On Jul 15, 2011, at 6:06 AM, Chandu80 wrote: > On Jul 14, 5:30 pm, David Chelimsky wrote: >> On Jul 14, 2011, at 6:34 AM, Chandrika Shenoy wrote: >>

Re: [rspec-users] How do you deal with @meal.restaurant_id = ... in such a controller test?

2011-07-16 Thread David Chelimsky
On Jul 11, 2011, at 8:38 PM, David Zhang wrote: > I'm wondering how you tell RSpec to ignore null objects entirely. > For instance, I have this restaurant_id call below: > > def create > @meal = Meal.new(params[:meal]) > @meal.restaurant_id = current_user.restaurant_id # automatically

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

2011-07-16 Thread David Chelimsky
On Jul 16, 2011, at 8:35 AM, kevin peter wrote: > Hai > > I would like to know how to test block parameters send to method with > arguments... > > Problem: > > Here i would like to get weather report basing on city_name. > > here my method name is request and i am sending :get_cities_weathe

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