From noreply at rubyforge.org Sun Apr 1 08:12:29 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Sun, 1 Apr 2007 08:12:29 -0400 (EDT) Subject: [rspec-devel] [ rspec-Patches-9282 ] Change to allow running specs from textmate with rspec installed as a rails plugin (and no rspec gem installed) Message-ID: <20070401121229.CBCFF5240AFA@rubyforge.org> Patches item #9282, was opened at 2007-03-14 10:51 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3151&aid=9282&group_id=797 Category: None Group: None >Status: Closed >Resolution: Accepted Priority: 3 Submitted By: Jonathan Tron (jonathant) >Assigned to: Aslak Helles?y (aslak_hellesoy) Summary: Change to allow running specs from textmate with rspec installed as a rails plugin (and no rspec gem installed) Initial Comment: I changed all require call to use a full path based on File.dirname(__FILE__). I modified the spec_mate.rb of RSpec.tmbundle to look for rspec as a rails plugins (check if ENV['TM_PROJECT_DIRECTORY'] and ENV['TM_PROJECT_DIRECTORY']/vendor/plugins/rspec/lib/rspec.rb are present) and fallback to a simple require 'spec'. ---------------------------------------------------------------------- >Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-04-01 08:12 Message: Fixed in branches/0.9-dev#1671 (with a simpler fix - see attached patch) ---------------------------------------------------------------------- Comment By: Jonathan Tron (jonathant) Date: 2007-03-14 11:58 Message: I tried to use "$:.unshift" method first, but I had some trouble with files not loading correctly (I confess not having searched to far to identified the problem). So I choosed to go the way it is done in rspec_on_rails plugin. If you prefer I think I could have a second look for the "clean" solution by tomorrow. ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-03-14 11:17 Message: I like the idea, but your patch modifies a bunch of require statements in RSpec core. Is that really necessary? Wouldn't it be better to use LOAD_PATH and avoid all of these ugly absolute paths everywhere? ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3151&aid=9282&group_id=797 From noreply at rubyforge.org Sun Apr 1 10:04:52 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Sun, 1 Apr 2007 10:04:52 -0400 (EDT) Subject: [rspec-devel] [ rspec-Feature Requests-9375 ] play nice w/ mocha and/or flexmock and/or any other mocking framework Message-ID: <20070401140453.06F805240942@rubyforge.org> Feature Requests item #9375, was opened at 2007-03-19 12:37 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3152&aid=9375&group_id=797 Category: mock module Group: None >Status: Closed Priority: 3 Submitted By: David Chelimsky (dchelimsky) Assigned to: David Chelimsky (dchelimsky) Summary: play nice w/ mocha and/or flexmock and/or any other mocking framework Initial Comment: Right now you can use rspec w/ other frameworks but you have to go through some hoops. You should be able to do something as simple as require 'mocha' or require 'flexmock' to invoke either. ---------------------------------------------------------------------- >Comment By: David Chelimsky (dchelimsky) Date: 2007-04-01 14:04 Message: Added support for using mocha in branches/0.9-dev. Will be released w/ 0.9. To use this feature, you'll do this: Spec::Runner.configure do |config| config.mock_with :mocha end Opening a separate RFE to add support for flexmock ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3152&aid=9375&group_id=797 From noreply at rubyforge.org Sun Apr 1 10:06:18 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Sun, 1 Apr 2007 10:06:18 -0400 (EDT) Subject: [rspec-devel] [ rspec-Feature Requests-9735 ] support flexmock Message-ID: <20070401140619.0417A52409AD@rubyforge.org> Feature Requests item #9735, was opened at 2007-04-01 14:06 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3152&aid=9735&group_id=797 Category: runner module Group: None Status: Open Priority: 3 Submitted By: David Chelimsky (dchelimsky) Assigned to: David Chelimsky (dchelimsky) Summary: support flexmock Initial Comment: RSpec-0.9 will support using mocha instead of Spec::Mocks (for those who choose) by doing the following: Spec::Runner.configure do |config| config.mock_with :mocha end We should add the same support for flexmock. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3152&aid=9735&group_id=797 From noreply at rubyforge.org Sun Apr 1 10:08:07 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Sun, 1 Apr 2007 10:08:07 -0400 (EDT) Subject: [rspec-devel] [ rspec-Feature Requests-6523 ] Run rspec on rails without a db Message-ID: <20070401140807.2689552409AD@rubyforge.org> Feature Requests item #6523, was opened at 2006-11-06 21:07 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3152&aid=6523&group_id=797 Category: None Group: None Status: Open Priority: 3 Submitted By: Paul Pagel (paulwpagel) Assigned to: Nobody (None) Summary: Run rspec on rails without a db Initial Comment: We need to be able to run the specs without the database. We have no model objects in some of our projects, therefore, no use for the db. ---------------------------------------------------------------------- >Comment By: David Chelimsky (dchelimsky) Date: 2007-04-01 14:08 Message: Now that we have a cleaner configuration model, we should add a configuration option to do this: Spec::Runner.configure do |config| config.use_database = false end (or something like that) ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2006-11-07 01:28 Message: How do I reproduce this missing feature? How would you like it to work exactly? Code please. http://rspec.rubyforge.org/contribute.html ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3152&aid=6523&group_id=797 From noreply at rubyforge.org Sun Apr 1 10:12:39 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Sun, 1 Apr 2007 10:12:39 -0400 (EDT) Subject: [rspec-devel] [ rspec-Feature Requests-6550 ] Mix in several modules and do it in one place only Message-ID: <20070401141239.7FA4C52409AD@rubyforge.org> Feature Requests item #6550, was opened at 2006-11-08 02:01 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3152&aid=6550&group_id=797 >Category: runner module Group: None >Status: Closed Priority: 3 Submitted By: Aslak Helles?y (aslak_hellesoy) >Assigned to: David Chelimsky (dchelimsky) Summary: Mix in several modules and do it in one place only Initial Comment: We need a way to mixin several modules and do it in one place only. Like in the spec_helper.rb file used by spec/rails ---------------------------------------------------------------------- >Comment By: David Chelimsky (dchelimsky) Date: 2007-04-01 14:12 Message: Added to branches/0.9-dev (r1637) ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-03-21 15:02 Message: Actually, how about a rails-style initializer/configurator: Spec.configure do |config| config.mock_with :my_favorite_mock_framework config.include MyHelperMethods config.include MyCustomMatchers #for rails config.use_transactional_fixtures = true end This keeps the interface simple, exposes less structure, and let's rspec delegate these configuration options to different parts of the system as necessary. ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-03-15 19:05 Message: We have a need to add this soon. Here's what I'm thinking: #in spec_helper.rb module Spec module Config mock_with :my_favorite_mock_framework include MyHelperMethods include MyCustomMatchers end end Everything defined or declared here would impact all specs. We'd make it work the same for Spec::Rails. Sound reasonable? ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3152&aid=6550&group_id=797 From noreply at rubyforge.org Sun Apr 1 10:18:38 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Sun, 1 Apr 2007 10:18:38 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-8241 ] "no id given" if controller method does not exist Message-ID: <20070401141838.5108B5240AFA@rubyforge.org> Bugs item #8241, was opened at 2007-01-29 03:37 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=8241&group_id=797 Category: rails plugin Group: None >Status: Closed >Resolution: Accepted Priority: 1 Submitted By: Fran?ois Beausoleil (fbos) Assigned to: David Chelimsky (dchelimsky) >Summary: "no id given" if controller method does not exist Initial Comment: Given this controller: class RolesController < ApplicationController end And this specification: context "A project owner" do controller_name :roles specify "can assign roles to other users" do post :create, :project_id => 27, :role => {:name => "user"}, :user => {:email => "jim at teksol.info"} response.should_redirect_to dashboard_url end end The spec fails like this: 1) ArgumentError in 'A project owner can assign roles to other users' no id given /usr/lib/ruby/gems/1.8/gems/rspec-0.7.5.1/lib/spec/expectations/sugar.rb:13:in `method_missing' /usr/lib/ruby/gems/1.8/gems/rspec-0.7.5.1/lib/spec/expectations/sugar.rb:13:in `_method_missing' /usr/lib/ruby/gems/1.8/gems/rspec-0.7.5.1/lib/spec/expectations/sugar.rb:9:in `method_missing' /home/francois/src/smrty2/config/../vendor/rails/actionpack/lib/action_controller/base.rb:1098:in `perform_action_without_filters' /home/francois/src/smrty2/config/../vendor/rails/actionpack/lib/action_controller/filters.rb:632:in `call_filter' /home/francois/src/smrty2/config/../vendor/rails/actionpack/lib/action_controller/filters.rb:638:in `call_filter' /home/francois/src/smrty2/config/../vendor/rails/actionpack/lib/action_controller/filters.rb:438:in `call' /home/francois/src/smrty2/config/../vendor/rails/actionpack/lib/action_controller/filters.rb:637:in `call_filter' /home/francois/src/smrty2/config/../vendor/rails/actionpack/lib/action_controller/filters.rb:638:in `call_filter' /home/francois/src/smrty2/config/../vendor/rails/actionpack/lib/action_controller/filters.rb:438:in `call' /home/francois/src/smrty2/config/../vendor/rails/actionpack/lib/action_controller/filters.rb:637:in `call_filter' /home/francois/src/smrty2/config/../vendor/rails/actionpack/lib/action_controller/filters.rb:619:in `perform_action_without_benchmark' /home/francois/src/smrty2/config/../vendor/rails/actionpack/lib/action_controller/benchmarking.rb:66:in `perform_action_without_rescue' /usr/lib/ruby/1.8/benchmark.rb:293:in `measure' /home/francois/src/smrty2/config/../vendor/rails/actionpack/lib/action_controller/benchmarking.rb:66:in `perform_action_without_rescue' /home/francois/src/smrty2/config/../vendor/rails/actionpack/lib/action_controller/rescue.rb:83:in `perform_action' /home/francois/src/smrty2/config/../vendor/rails/actionpack/lib/action_controller/base.rb:430:in `process_without_filters' /home/francois/src/smrty2/config/../vendor/rails/actionpack/lib/action_controller/filters.rb:624:in `process_without_session_management_support' /home/francois/src/smrty2/config/../vendor/rails/actionpack/lib/action_controller/session_management.rb:114:in `process_without_test' /home/francois/src/smrty2/config/../vendor/rails/actionpack/lib/action_controller/test_process.rb:15:in `process' /home/francois/src/smrty2/config/../vendor/rails/actionpack/lib/action_controller/test_process.rb:382:in `process' /home/francois/src/smrty2/config/../vendor/rails/actionpack/lib/action_controller/test_process.rb:353:in `post' ./spec/controllers/roles_spec.rb:26: /usr/lib/ruby/gems/1.8/gems/rspec-0.7.5.1/lib/spec/runner/specification.rb:55:in `execute_spec' /usr/lib/ruby/gems/1.8/gems/rspec-0.7.5.1/lib/spec/runner/specification.rb:30:in `run' /usr/lib/ruby/gems/1.8/gems/rspec-0.7.5.1/lib/spec/runner/context.rb:57:in `run' /usr/lib/ruby/gems/1.8/gems/rspec-0.7.5.1/lib/spec/runner/context.rb:54:in `run' /usr/lib/ruby/gems/1.8/gems/rspec-0.7.5.1/lib/spec/runner/context_runner.rb:23:in `run' /usr/lib/ruby/gems/1.8/gems/rspec-0.7.5.1/lib/spec/runner/context_runner.rb:22:in `run' /usr/lib/ruby/gems/1.8/gems/rspec-0.7.5.1/lib/spec/runner/command_line.rb:26:in `run' /usr/lib/ruby/gems/1.8/gems/rspec-0.7.5.1/bin/spec:4: /usr/bin/spec:16: I resolved my issue by creating the method. I would have expected rspec to complain that "the action does not exist". Thanks ! Fran?ois Beausoleil ---------------------------------------------------------------------- >Comment By: David Chelimsky (dchelimsky) Date: 2007-04-01 14:18 Message: This was fixed when we removed sugar from branches/0.9-dev ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-02-02 12:03 Message: This is a conflict between RSpec's use of method_missing and Rails' use of the same. This will go away in 0.9 when we remove the syntax sugar, at which point you'll get the message you'll expect: No action responded to create I'll leave this open for tracking, but setting it to postponed. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=8241&group_id=797 From noreply at rubyforge.org Sun Apr 1 10:22:15 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Sun, 1 Apr 2007 10:22:15 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-9737 ] --colour doesn't work with --drb if defined in spec.opts Message-ID: <20070401142215.399BD5240AFA@rubyforge.org> Bugs item #9737, was opened at 2007-04-01 14:22 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=9737&group_id=797 Category: runner module Group: None Status: Open Resolution: None Priority: 3 Submitted By: David Chelimsky (dchelimsky) Assigned to: Nobody (None) Summary: --colour doesn't work with --drb if defined in spec.opts Initial Comment: You can do this: ./script/spec spec --drb --colour but if you do this: ./script/spec spec -O spec/spec.opts w/ this in spec.opts --drb --colour no dice, amigo. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=9737&group_id=797 From noreply at rubyforge.org Sun Apr 1 10:25:30 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Sun, 1 Apr 2007 10:25:30 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-9649 ] Parital mocks don't work if object loaded from fixture, and referenced via association Message-ID: <20070401142530.A190D5240AFA@rubyforge.org> Bugs item #9649, was opened at 2007-03-28 19:44 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=9649&group_id=797 Category: mock module Group: None Status: Open Resolution: None Priority: 3 Submitted By: Chris Hoffman (hoffman_c) Assigned to: Nobody (None) Summary: Parital mocks don't work if object loaded from fixture, and referenced via association Initial Comment: Hello, The following code will not function properly: spec/fixtures/pages.yml ---------- first: id: 1 type: LockedPage name: the first default page spec/fixtures/questions.yml ---------- first: id: 1 type: LockedQuestion name: the first default question container_id: 1 container_type: LockedPage spec/models/locked_question_spec.rb ---------- context "LockedQuestion#document_session, being linked to a Page that has a Document Session" do fixtures :questions, :pages setup do @question = questions(:first) @page = pages(:first) @page.stub!(:document_session).and_return("the document session") @question.page.should == @page #=> true end specify "should return the Page's Document Session" do @question.document_session.should == "the document session" #=> fails with 'undefined method' end end I would kludge something together by just assigning an unlocked page to the question, but the "Locked" that prefaces these models is a subclass that denies any modifications. Thanks for your help. -Chris ---------------------------------------------------------------------- >Comment By: David Chelimsky (dchelimsky) Date: 2007-04-01 14:25 Message: What's 'undefined method' getting called on? Question or Page? Can you post the backtrace? ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=9649&group_id=797 From noreply at rubyforge.org Sun Apr 1 10:27:41 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Sun, 1 Apr 2007 10:27:41 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-9311 ] Controller Specs do not play nicely with Markaby and Rxml Message-ID: <20070401142741.0E9FC52409AD@rubyforge.org> Bugs item #9311, was opened at 2007-03-15 21:48 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=9311&group_id=797 Category: None Group: None Status: Open Resolution: None Priority: 3 Submitted By: Brian Takita (btakita) Assigned to: Nobody (None) Summary: Controller Specs do not play nicely with Markaby and Rxml Initial Comment: Look in rails/runner/context/controller.rb line 18. If render is called without a block and views are not integrated, ActionView::Base#find_template_extension_for is stubbed to return 'rhtml'. Unfortunately, rails caches this result. When I run a view spec, e.g. render 'foo/bar' and bar is a markaby file (bar.mab), rails uses the cached extension (rhtml) when @@cache_template_extensions is set to true, which it is by default. See ActionView::Base#pick_template_extension ---------------------------------------------------------------------- >Comment By: David Chelimsky (dchelimsky) Date: 2007-04-01 14:27 Message: Brian - we made a change a while back so that cache_template_extensions is turned off by default (when running rspec examples). This can be found in branches/0.9-dev. I *think* that should have solved this problem, yes? If so, please close this. Thanks ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=9311&group_id=797 From noreply at rubyforge.org Sun Apr 1 10:41:47 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Sun, 1 Apr 2007 10:41:47 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-9737 ] --colour doesn't work with --drb if defined in spec.opts Message-ID: <20070401144147.3C6445240948@rubyforge.org> Bugs item #9737, was opened at 2007-04-01 14:22 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=9737&group_id=797 Category: runner module Group: None >Status: Closed >Resolution: Rejected Priority: 3 Submitted By: David Chelimsky (dchelimsky) Assigned to: Nobody (None) Summary: --colour doesn't work with --drb if defined in spec.opts Initial Comment: You can do this: ./script/spec spec --drb --colour but if you do this: ./script/spec spec -O spec/spec.opts w/ this in spec.opts --drb --colour no dice, amigo. ---------------------------------------------------------------------- >Comment By: David Chelimsky (dchelimsky) Date: 2007-04-01 14:41 Message: Actually - this is only a problem when running w/ rspec_autotest, so nevermind. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=9737&group_id=797 From noreply at rubyforge.org Sun Apr 1 11:24:12 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Sun, 1 Apr 2007 11:24:12 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-9649 ] Parital mocks don't work if object loaded from fixture, and referenced via association Message-ID: <20070401152413.01A0B5240956@rubyforge.org> Bugs item #9649, was opened at 2007-03-28 15:44 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=9649&group_id=797 Category: mock module Group: None Status: Open Resolution: None Priority: 3 Submitted By: Chris Hoffman (hoffman_c) Assigned to: Nobody (None) Summary: Parital mocks don't work if object loaded from fixture, and referenced via association Initial Comment: Hello, The following code will not function properly: spec/fixtures/pages.yml ---------- first: id: 1 type: LockedPage name: the first default page spec/fixtures/questions.yml ---------- first: id: 1 type: LockedQuestion name: the first default question container_id: 1 container_type: LockedPage spec/models/locked_question_spec.rb ---------- context "LockedQuestion#document_session, being linked to a Page that has a Document Session" do fixtures :questions, :pages setup do @question = questions(:first) @page = pages(:first) @page.stub!(:document_session).and_return("the document session") @question.page.should == @page #=> true end specify "should return the Page's Document Session" do @question.document_session.should == "the document session" #=> fails with 'undefined method' end end I would kludge something together by just assigning an unlocked page to the question, but the "Locked" that prefaces these models is a subclass that denies any modifications. Thanks for your help. -Chris ---------------------------------------------------------------------- >Comment By: Chris Hoffman (hoffman_c) Date: 2007-04-01 11:24 Message: Hello, I have created a rails project with the models and spec that reveal the problem. Please let me know if you need additional information. Also, you were indeed correct that the above example would fail for a different reason (if not taking into account the Question model's delegation). I apologize for the confusion. ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-04-01 10:25 Message: What's 'undefined method' getting called on? Question or Page? Can you post the backtrace? ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=9649&group_id=797 From noreply at rubyforge.org Sun Apr 1 15:24:49 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Sun, 1 Apr 2007 15:24:49 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-8103 ] RSpec not installing spec script correctly Message-ID: <20070401192449.256AD5240B1B@rubyforge.org> Bugs item #8103, was opened at 2007-01-24 02:22 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=8103&group_id=797 Category: runner module Group: v1.0 (example) >Status: Closed >Resolution: Accepted Priority: 3 Submitted By: Aslak Helles?y (aslak_hellesoy) Assigned to: Aslak Helles?y (aslak_hellesoy) Summary: RSpec not installing spec script correctly Initial Comment: >From Charles Oliver Nutter: Hey, I just noticed this today...installed RSpec with JRuby, and at the top of the spec script: #!/usr/bin/env ruby That dog won't hunt, Monsignor. Rails and rake install scripts that correctly run with JRuby, so that's probably good examples to follow. Unfortunately I have no clue how they do it. - Charlie ---------------------------------------------------------------------- >Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-04-01 15:24 Message: Fixed in branches/0.9-dev ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-03-20 04:57 Message: The reason why I'm asking is that rubygems generates files with #!/usr/bin/env ruby in the header - it's not RSpec. I need to know what Rubygems version you are using, and what the path of the said file is (so I can determine whether this is a file made by the RSpec team or the Rubygems program. ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-03-20 03:19 Message: Are you talking about the rubygems-generated wrapper script? What's the path of the script you're talking abouth (after installation and in our sources). ---------------------------------------------------------------------- Comment By: Scott Taylor (smtlaissezfaire) Date: 2007-03-20 02:36 Message: What is the best way to get around this? I have a little script which searches the $PATH environment variable for a given name, hence: euclid% find_file_in_path ruby /opt/local/bin /usr/local/bin /usr/bin euclid% find_file_in_path spec /opt/local/bin Would something like this be useful to use? How about for the windows folks? ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=8103&group_id=797 From noreply at rubyforge.org Sun Apr 1 17:07:02 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Sun, 1 Apr 2007 17:07:02 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-9421 ] --line doesn't work with behaviours that use class names Message-ID: <20070401210702.9C1155240B5B@rubyforge.org> Bugs item #9421, was opened at 2007-03-21 06:11 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=9421&group_id=797 Category: runner module Group: None Status: Open Resolution: None Priority: 4 Submitted By: Aslak Helles?y (aslak_hellesoy) Assigned to: David Chelimsky (dchelimsky) Summary: --line doesn't work with behaviours that use class names Initial Comment: To reproduce, do: ruby bin/spec spec/spec/dsl/behaviour_spec.rb -l 22 Finished in 1.4e-05 seconds 0 examples, 0 failures This is because SpecParser always looks for quotes - it has to be smarter ---------------------------------------------------------------------- >Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-04-01 17:07 Message: Didn't you just fix this? ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=9421&group_id=797 From noreply at rubyforge.org Mon Apr 2 03:31:37 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Mon, 2 Apr 2007 03:31:37 -0400 (EDT) Subject: [rspec-devel] [ rspec-Patches-9282 ] Change to allow running specs from textmate with rspec installed as a rails plugin (and no rspec gem installed) Message-ID: <20070402073137.5D8D2A970002@rubyforge.org> Patches item #9282, was opened at 14/03/2007 15:51 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3151&aid=9282&group_id=797 Category: None Group: None Status: Closed Resolution: Accepted Priority: 3 Submitted By: Jonathan Tron (jonathant) Assigned to: Aslak Helles?y (aslak_hellesoy) Summary: Change to allow running specs from textmate with rspec installed as a rails plugin (and no rspec gem installed) Initial Comment: I changed all require call to use a full path based on File.dirname(__FILE__). I modified the spec_mate.rb of RSpec.tmbundle to look for rspec as a rails plugins (check if ENV['TM_PROJECT_DIRECTORY'] and ENV['TM_PROJECT_DIRECTORY']/vendor/plugins/rspec/lib/rspec.rb are present) and fallback to a simple require 'spec'. ---------------------------------------------------------------------- Comment By: Jonathan Tron (jonathant) Date: 02/04/2007 09:31 Message: Wohh great... thanks for taking the time to do it. ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 01/04/2007 14:12 Message: Fixed in branches/0.9-dev#1671 (with a simpler fix - see attached patch) ---------------------------------------------------------------------- Comment By: Jonathan Tron (jonathant) Date: 14/03/2007 16:58 Message: I tried to use "$:.unshift" method first, but I had some trouble with files not loading correctly (I confess not having searched to far to identified the problem). So I choosed to go the way it is done in rspec_on_rails plugin. If you prefer I think I could have a second look for the "clean" solution by tomorrow. ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 14/03/2007 16:17 Message: I like the idea, but your patch modifies a bunch of require statements in RSpec core. Is that really necessary? Wouldn't it be better to use LOAD_PATH and avoid all of these ugly absolute paths everywhere? ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3151&aid=9282&group_id=797 From noreply at rubyforge.org Mon Apr 2 06:46:03 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Mon, 2 Apr 2007 06:46:03 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-9265 ] [Documentation] These are NOT deprecated. See Spec::Matchers should not be red Message-ID: <20070402104603.58A4B5240BD0@rubyforge.org> Bugs item #9265, was opened at 2007-03-13 19:37 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=9265&group_id=797 Category: expectation module Group: None >Status: Closed >Resolution: Rejected Priority: 3 Submitted By: Brian Takita (btakita) Assigned to: Nobody (None) Summary: [Documentation] These are NOT deprecated. See Spec::Matchers should not be red Initial Comment: It is confusing to see "These are NOT deprecated. See Spec::Matchers" in red text because it looks like it is being deprecated. Perhaps it should be green? ---------------------------------------------------------------------- >Comment By: David Chelimsky (dchelimsky) Date: 2007-04-02 10:46 Message: I'm going to close this - this will not be an issue for long. ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-03-21 14:44 Message: I tried changing it to green, but then it gets lost. In a page full of red messages, I want people to see this one so they don't think that the non-deprecated messages are deprecated - and the NOT brings it out for me. Any other suggestions? I'm all for doing something that will make this as clear as possible. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=9265&group_id=797 From noreply at rubyforge.org Mon Apr 2 07:19:56 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Mon, 2 Apr 2007 07:19:56 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-9649 ] Parital mocks don't work if object loaded from fixture, and referenced via association Message-ID: <20070402111956.B8C9B5240BD0@rubyforge.org> Bugs item #9649, was opened at 2007-03-28 15:44 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=9649&group_id=797 Category: mock module Group: None Status: Open Resolution: None Priority: 3 Submitted By: Chris Hoffman (hoffman_c) Assigned to: Nobody (None) Summary: Parital mocks don't work if object loaded from fixture, and referenced via association Initial Comment: Hello, The following code will not function properly: spec/fixtures/pages.yml ---------- first: id: 1 type: LockedPage name: the first default page spec/fixtures/questions.yml ---------- first: id: 1 type: LockedQuestion name: the first default question container_id: 1 container_type: LockedPage spec/models/locked_question_spec.rb ---------- context "LockedQuestion#document_session, being linked to a Page that has a Document Session" do fixtures :questions, :pages setup do @question = questions(:first) @page = pages(:first) @page.stub!(:document_session).and_return("the document session") @question.page.should == @page #=> true end specify "should return the Page's Document Session" do @question.document_session.should == "the document session" #=> fails with 'undefined method' end end I would kludge something together by just assigning an unlocked page to the question, but the "Locked" that prefaces these models is a subclass that denies any modifications. Thanks for your help. -Chris ---------------------------------------------------------------------- >Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-04-02 07:19 Message: Can you confirm that you're not getting the same problem when you use Test::Unit? What are your versions of everything? ---------------------------------------------------------------------- Comment By: Chris Hoffman (hoffman_c) Date: 2007-04-01 11:24 Message: Hello, I have created a rails project with the models and spec that reveal the problem. Please let me know if you need additional information. Also, you were indeed correct that the above example would fail for a different reason (if not taking into account the Question model's delegation). I apologize for the confusion. ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-04-01 10:25 Message: What's 'undefined method' getting called on? Question or Page? Can you post the backtrace? ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=9649&group_id=797 From noreply at rubyforge.org Mon Apr 2 07:44:17 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Mon, 2 Apr 2007 07:44:17 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-9649 ] Parital mocks don't work if object loaded from fixture, and referenced via association Message-ID: <20070402114417.C2F2B5240BE9@rubyforge.org> Bugs item #9649, was opened at 2007-03-28 15:44 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=9649&group_id=797 Category: mock module Group: None Status: Open Resolution: None Priority: 3 Submitted By: Chris Hoffman (hoffman_c) Assigned to: Nobody (None) Summary: Parital mocks don't work if object loaded from fixture, and referenced via association Initial Comment: Hello, The following code will not function properly: spec/fixtures/pages.yml ---------- first: id: 1 type: LockedPage name: the first default page spec/fixtures/questions.yml ---------- first: id: 1 type: LockedQuestion name: the first default question container_id: 1 container_type: LockedPage spec/models/locked_question_spec.rb ---------- context "LockedQuestion#document_session, being linked to a Page that has a Document Session" do fixtures :questions, :pages setup do @question = questions(:first) @page = pages(:first) @page.stub!(:document_session).and_return("the document session") @question.page.should == @page #=> true end specify "should return the Page's Document Session" do @question.document_session.should == "the document session" #=> fails with 'undefined method' end end I would kludge something together by just assigning an unlocked page to the question, but the "Locked" that prefaces these models is a subclass that denies any modifications. Thanks for your help. -Chris ---------------------------------------------------------------------- >Comment By: Chris Hoffman (hoffman_c) Date: 2007-04-02 07:44 Message: I am not sure how to do partial mocks with Test::Unit. As far as versions, I have the following: rspec 0.8.2 rails 1.1.2 Is the attached rails application not giving you an error when you run rake spec:models? ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-04-02 07:19 Message: Can you confirm that you're not getting the same problem when you use Test::Unit? What are your versions of everything? ---------------------------------------------------------------------- Comment By: Chris Hoffman (hoffman_c) Date: 2007-04-01 11:24 Message: Hello, I have created a rails project with the models and spec that reveal the problem. Please let me know if you need additional information. Also, you were indeed correct that the above example would fail for a different reason (if not taking into account the Question model's delegation). I apologize for the confusion. ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-04-01 10:25 Message: What's 'undefined method' getting called on? Question or Page? Can you post the backtrace? ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=9649&group_id=797 From noreply at rubyforge.org Mon Apr 2 10:11:50 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Mon, 2 Apr 2007 10:11:50 -0400 (EDT) Subject: [rspec-devel] [ rspec-Patches-9605 ] Patch for ER 9472, shared behaviour Message-ID: <20070402141150.B9E1E5240C9F@rubyforge.org> Patches item #9605, was opened at 2007-03-26 22:08 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3151&aid=9605&group_id=797 Category: None Group: None Status: Open Resolution: None Priority: 3 Submitted By: Bob Cotton (bcotton) Assigned to: Nobody (None) Summary: Patch for ER 9472, shared behaviour Initial Comment: I chose behaves_as, as the inclusion method. I don't like the use of the global, behavior_runner, in Behavior to find shared behaviors. Putting the collection on Spec::Runner seemed just as bad. Had to move some methods on module Spec::DSL::BehaviourEval::ModuleMethods from private to protected to faciliate copying things from one EvalModule to another. There are many combinations of include, setup/teardown, context_setup/context_teardown and inherit that are not covered in the shared_behavior spec. Let me know if you want more. Might be a good place for shared behaviors! -Bob ---------------------------------------------------------------------- >Comment By: Bob Cotton (bcotton) Date: 2007-04-02 08:11 Message: Newest version of the patch attached. ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-03-28 05:11 Message: I haven't had time to look into this in detail, but it looks interesting. Right now we're trying to get 0.9 out the door, and we're reluctant to add new features before 0.9 is released. Let's revisit this post 0.9 ---------------------------------------------------------------------- Comment By: Bob Cotton (bcotton) Date: 2007-03-27 06:12 Message: Missed the checkbox. Sorry. ---------------------------------------------------------------------- Comment By: Bob Cotton (bcotton) Date: 2007-03-27 06:11 Message: One more thing, rcov is at 100%, but I can't get pre_commit to run. It either runs out of memory, or the stack is too deep. ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-03-26 22:16 Message: File please. ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-03-26 22:15 Message: Hi Bob - I'll take a look at this tomorrow. Thanks. FYI - the problem you had running pre_commit was due to something we were trying to fix w/ 1.8.6. I reverted the spectask and you can run pre_commit now. ---------------------------------------------------------------------- Comment By: Bob Cotton (bcotton) Date: 2007-03-26 22:10 Message: One more thing, rcov is at 100%, but I can't get pre_commit to run. It either runs out of memory, or the stack is too deep. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3151&aid=9605&group_id=797 From noreply at rubyforge.org Mon Apr 2 10:23:54 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Mon, 2 Apr 2007 10:23:54 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-9649 ] Parital mocks don't work if object loaded from fixture, and referenced via association Message-ID: <20070402142354.50F215240BE9@rubyforge.org> Bugs item #9649, was opened at 2007-03-28 15:44 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=9649&group_id=797 Category: mock module Group: None >Status: Closed >Resolution: Rejected Priority: 3 Submitted By: Chris Hoffman (hoffman_c) >Assigned to: Aslak Helles?y (aslak_hellesoy) Summary: Parital mocks don't work if object loaded from fixture, and referenced via association Initial Comment: Hello, The following code will not function properly: spec/fixtures/pages.yml ---------- first: id: 1 type: LockedPage name: the first default page spec/fixtures/questions.yml ---------- first: id: 1 type: LockedQuestion name: the first default question container_id: 1 container_type: LockedPage spec/models/locked_question_spec.rb ---------- context "LockedQuestion#document_session, being linked to a Page that has a Document Session" do fixtures :questions, :pages setup do @question = questions(:first) @page = pages(:first) @page.stub!(:document_session).and_return("the document session") @question.page.should == @page #=> true end specify "should return the Page's Document Session" do @question.document_session.should == "the document session" #=> fails with 'undefined method' end end I would kludge something together by just assigning an unlocked page to the question, but the "Locked" that prefaces these models is a subclass that denies any modifications. Thanks for your help. -Chris ---------------------------------------------------------------------- >Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-04-02 10:23 Message: Your Rails version is one year old, and the oldest Rails version RSpec is tested against is 1.1.6 (8 months old). It's too much work for us to ensure things work against old Railses, so I'm closing this bug. Feel free to reopen this bug if it still applies to Rails 1.1.6 or 1.2.x. (In the near future we will probably drop support for 1.1.6 though). ---------------------------------------------------------------------- Comment By: Chris Hoffman (hoffman_c) Date: 2007-04-02 07:44 Message: I am not sure how to do partial mocks with Test::Unit. As far as versions, I have the following: rspec 0.8.2 rails 1.1.2 Is the attached rails application not giving you an error when you run rake spec:models? ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-04-02 07:19 Message: Can you confirm that you're not getting the same problem when you use Test::Unit? What are your versions of everything? ---------------------------------------------------------------------- Comment By: Chris Hoffman (hoffman_c) Date: 2007-04-01 11:24 Message: Hello, I have created a rails project with the models and spec that reveal the problem. Please let me know if you need additional information. Also, you were indeed correct that the above example would fail for a different reason (if not taking into account the Question model's delegation). I apologize for the confusion. ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-04-01 10:25 Message: What's 'undefined method' getting called on? Question or Page? Can you post the backtrace? ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=9649&group_id=797 From noreply at rubyforge.org Mon Apr 2 10:24:32 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Mon, 2 Apr 2007 10:24:32 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-7636 ] drbspec not managing db connections appropriately Message-ID: <20070402142432.9F0B35240BE9@rubyforge.org> Bugs item #7636, was opened at 2007-01-06 19:17 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=7636&group_id=797 Category: runner module Group: None >Status: Closed >Resolution: Out of Date Priority: 3 Submitted By: Chris Anderson (jchris) >Assigned to: Aslak Helles?y (aslak_hellesoy) Summary: drbspec not managing db connections appropriately Initial Comment: I'm using the rails_spec_server and drbspec spec/ - the lastest versions (gem 0.7.6) - just generated from trunk yesterday. Running drbspec spec/ works as expected for about 30 runs, and then I start getting too many client errors from Postgres (gem 0.7.1). The same thing happens with the spec:autotest plugin - but it is just running drbspec repeatedly, as well. PGError in 'Given a generated source_report_spec.rb with fixtures loaded fixtures should load two SourceReports' FATAL: sorry, too many clients already script/rails_spec_server:16:in `run' script/rails_spec_server:37: I don't know if this is a specific to Postgres, but I do know I've never seen Postgres raise a too many clients error before in all my Rails work. Let me know if I can help with more information. jchris :: mfdz : com ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-02-08 10:23 Message: Chris - is this still giving you grief w/ the current trunk and using --drb? ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-01-19 04:35 Message: I haven't looked into this yet, but from now on you should use spec --drb instead of drbspec. I doubt it will solve the problem though. It sounds like Rails (launched by rails_spec_server) is re-opening a new connection every time spec --drb connects to it. It could be a Rails problem. rails_spec_server essentially resets Rails in the same way as script/server in development mode. Do you get the same problem if you run your app in development mode and hit an AR-accessing controller as well? If that's the case, it's a Rails problem. Please try with Rails 1.2.1 and see if the problem still persists. ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-01-06 20:05 Message: Have you had a similar experience just running 'rake spec'? ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=7636&group_id=797 From noreply at rubyforge.org Mon Apr 2 10:27:03 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Mon, 2 Apr 2007 10:27:03 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-8155 ] rspec clashing with rubyclr Message-ID: <20070402142703.83A6A5240CA6@rubyforge.org> Bugs item #8155, was opened at 2007-01-25 17:39 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=8155&group_id=797 Category: expectation module Group: None Status: Open Resolution: None Priority: 3 Submitted By: Kevin Williams (kevwil) Assigned to: Nobody (None) Summary: rspec clashing with rubyclr Initial Comment: I'm running Ruby 1.8.5 on Windows XP SP2. I have RubyGems 0.9.1, rspec 0.7.5.1, and rubyclr 0.5.2. I have both .NET 1.1 and 2.0 installed on this box. I don't know if this is due to rspec behavior or rubyclr behavior, so this may not be an rspec issue. I'm trying to use rspec with .NET code. I've toyed with rubyclr before and it works. For example, the following prints out "count = 0": require 'rubyclr' include System::Collections list = ArrayList.new puts "count = #{list.Count}" Now, when I try to do something similar using rspec, I get errors. __Code__: require 'rubyclr' include System::Collections context "An array list" do setup do @list = ArrayList.new end specify "starts empty" do @list.Count.should == 0 end end __Error__: C:\>spec arraylist_spec.rb -f s An array list - starts empty (ERROR - 1) 1) NoMethodError in 'An array list starts empty' undefined method `ldc_i4' for # ./arraylist_spec.rb:5:in `new' ./arraylist_spec.rb:5: Finished in 0.141 seconds 1 specification, 1 failure It appears to by trying to call a method (an overloaded constructor, I think) on a Generator object. It shouldn't be a Generator object as far as I know, so I thought perhaps this comes from rspec. ---------------------------------------------------------------------- >Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-04-02 10:27 Message: Does this still apply against the branches/0.9-dev/rspec code? ---------------------------------------------------------------------- Comment By: Kevin Williams (kevwil) Date: 2007-01-26 15:02 Message: Well, it doesn't help _me_ see the problem. :) I'll probably have to post this to the rubyclr team as well, but I know with John Lam moving to Seattle and starting that new brainwashing^H^H^H^H^H^H^H^H^H^H^H^H^Hjob, the rubyclr project is a bit dark these days. :( (Just kidding, John.) Here's the output: C:\>spec arraylist_spec.rb -f s -b An array list - starts empty (ERROR - 1) 1) NoMethodError in 'An array list starts empty' undefined method `ldc_i4' for # c:/ruby/lib/ruby/gems/1.8/gems/rspec- 0.7.5.1/lib/spec/expectations/sugar.rb:13:in `call' c:/ruby/lib/ruby/gems/1.8/gems/rspec- 0.7.5.1/lib/spec/expectations/sugar.rb:13:in `_method_missing' c:/ruby/lib/ruby/gems/1.8/gems/rspec- 0.7.5.1/lib/spec/expectations/sugar.rb:9:in `method_missing' c:/ruby/lib/ruby/gems/1.8/gems/rubyclr-0.5.2- mswin32/Src/Ruby/generate.rb:31:in `match_sig' c:/ruby/lib/ruby/gems/1.8/gems/rubyclr-0.5.2- mswin32/Src/Ruby/generate.rb:156:in `ctor_shim' c:/ruby/lib/ruby/gems/1.8/gems/rubyclr-0.5.2- mswin32/Src/Ruby/dynamicmethod.rb:63:in `instance_eval' c:/ruby/lib/ruby/gems/1.8/gems/rubyclr-0.5.2- mswin32/Src/Ruby/dynamicmethod.rb:63:in `core_create_sa fe_ruby_method' c:/ruby/lib/ruby/gems/1.8/gems/rubyclr-0.5.2- mswin32/Src/Ruby/dynamicmethod.rb:48:in `core_create_ru by_method' c:/ruby/lib/ruby/gems/1.8/gems/rubyclr-0.5.2- mswin32/Src/Ruby/dynamicmethod.rb:61:in `core_create_sa fe_ruby_method' c:/ruby/lib/ruby/gems/1.8/gems/rubyclr-0.5.2- mswin32/Src/Ruby/dynamicmethod.rb:89:in `create_safe_ru by_instance_method' c:/ruby/lib/ruby/gems/1.8/gems/rubyclr-0.5.2- mswin32/Src/Ruby/generate.rb:153:in `ctor_shim' c:/ruby/lib/ruby/gems/1.8/gems/rubyclr-0.5.2- mswin32/Src/Ruby/core.rb:21:in `initialize' ./arraylist_spec.rb:7:in `new' ./arraylist_spec.rb:7: c:/ruby/lib/ruby/gems/1.8/gems/rspec- 0.7.5.1/lib/spec/runner/context_eval.rb:129:in `instance_eval' c:/ruby/lib/ruby/gems/1.8/gems/rspec- 0.7.5.1/lib/spec/runner/context_eval.rb:129:in `create_block_fr om_parts' c:/ruby/lib/ruby/gems/1.8/gems/rspec- 0.7.5.1/lib/spec/runner/context_eval.rb:125:in `each' c:/ruby/lib/ruby/gems/1.8/gems/rspec- 0.7.5.1/lib/spec/runner/context_eval.rb:125:in `create_block_fr om_parts' c:/ruby/lib/ruby/gems/1.8/gems/rspec- 0.7.5.1/lib/spec/runner/specification.rb:47:in `instance_eval' c:/ruby/lib/ruby/gems/1.8/gems/rspec- 0.7.5.1/lib/spec/runner/specification.rb:47:in `setup_spec' c:/ruby/lib/ruby/gems/1.8/gems/rspec- 0.7.5.1/lib/spec/runner/specification.rb:29:in `run' c:/ruby/lib/ruby/gems/1.8/gems/rspec- 0.7.5.1/lib/spec/runner/context.rb:57:in `run' c:/ruby/lib/ruby/gems/1.8/gems/rspec- 0.7.5.1/lib/spec/runner/context.rb:54:in `each' c:/ruby/lib/ruby/gems/1.8/gems/rspec- 0.7.5.1/lib/spec/runner/context.rb:54:in `run' c:/ruby/lib/ruby/gems/1.8/gems/rspec- 0.7.5.1/lib/spec/runner/context_runner.rb:23:in `run' c:/ruby/lib/ruby/gems/1.8/gems/rspec- 0.7.5.1/lib/spec/runner/context_runner.rb:22:in `each' c:/ruby/lib/ruby/gems/1.8/gems/rspec- 0.7.5.1/lib/spec/runner/context_runner.rb:22:in `run' c:/ruby/lib/ruby/gems/1.8/gems/rspec- 0.7.5.1/lib/spec/runner/command_line.rb:26:in `run' c:/ruby/lib/ruby/gems/1.8/gems/rspec-0.7.5.1/bin/spec:4 c:/ruby/bin/spec:16:in `load' c:/ruby/bin/spec:16 Finished in 0.157 seconds 1 specification, 1 failure ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-01-25 18:22 Message: I'm pretty sure this is not RSpec. We don't have any class named Generator. The stack trace you are seeing is trimmed down by RSpec. You can see the full trace doing this: spec arraylist_spec.rb -fs -b Does that help you see better where the problem might be? ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=8155&group_id=797 From noreply at rubyforge.org Mon Apr 2 10:59:20 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Mon, 2 Apr 2007 10:59:20 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-9760 ] rspec generators incompatible with changes to edge rails Message-ID: <20070402145920.95F6F5240CA3@rubyforge.org> Bugs item #9760, was opened at 2007-04-02 14:59 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=9760&group_id=797 Category: rails plugin Group: None Status: Open Resolution: None Priority: 3 Submitted By: David Chelimsky (dchelimsky) Assigned to: Nobody (None) Summary: rspec generators incompatible with changes to edge rails Initial Comment: rails rev 6499 rspec rev 1672 (branches/0.9-dev) Stand in example_rails_app and run: RSPEC_RAILS_VERSION=edge rake rspec:pre_commit and you'll get the following errors: ==================================== controller specs ==================================== 'PurchasesController#route_for should map { :controller => 'purchases', :action => 'edit', :id => 1 } to /purchases/1;edit' FAILED expected "/purchases/1;edit", got "/purchases/1/edit" (using ==) ./spec/controllers/purchases_controller_spec.rb:19: ==================================== (that is because the mapping nown goes to /purchases/1/edit, as it probably should have all along) ==================================== ==================================== view specs ==================================== 1) '/purchases/edit.rhtml should render edit form' FAILED Expected at least 1 elements, found 0. is not true. ./spec/views/purchases/edit_rhtml_spec.rb:20: 2) '/purchases/index.rhtml should render list of purchases' FAILED 2. is not true. ./spec/views/purchases/index_rhtml_spec.rb:29: 3) '/purchases/new.rhtml should render new form' FAILED Expected at least 1 elements, found 0. is not true. ./spec/views/purchases/new_rhtml_spec.rb:20: 4) '/purchases/show.rhtml should render attributes in

' FAILED expected /9\.99/, got "" ./spec/views/purchases/show_rhtml_spec.rb:22: ==================================== It turns out the generated .rhtml files are all empty - probably related to rails switching from .rhtml to .erb ==================================== And we're also getting this deprecation warning: DEPRECATION WARNING: template_root is deprecated and will be removed from Rails 2.0 (use view_paths instead) See http://www.rubyonrails.org/deprecation for details. (called from template_root= at ./vendor/rails/edge/actionpack/lib/action_controller/base.rb:360) ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=9760&group_id=797 From noreply at rubyforge.org Mon Apr 2 10:59:43 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Mon, 2 Apr 2007 10:59:43 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-9760 ] rspec generators incompatible with changes to edge rails Message-ID: <20070402145943.510BE5240CA3@rubyforge.org> Bugs item #9760, was opened at 2007-04-02 14:59 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=9760&group_id=797 Category: rails plugin Group: None Status: Open Resolution: None Priority: 3 Submitted By: David Chelimsky (dchelimsky) Assigned to: Nobody (None) Summary: rspec generators incompatible with changes to edge rails Initial Comment: rails rev 6499 rspec rev 1672 (branches/0.9-dev) Stand in example_rails_app and run: RSPEC_RAILS_VERSION=edge rake rspec:pre_commit and you'll get the following errors: ==================================== controller specs ==================================== 'PurchasesController#route_for should map { :controller => 'purchases', :action => 'edit', :id => 1 } to /purchases/1;edit' FAILED expected "/purchases/1;edit", got "/purchases/1/edit" (using ==) ./spec/controllers/purchases_controller_spec.rb:19: ==================================== (that is because the mapping nown goes to /purchases/1/edit, as it probably should have all along) ==================================== ==================================== view specs ==================================== 1) '/purchases/edit.rhtml should render edit form' FAILED Expected at least 1 elements, found 0. is not true. ./spec/views/purchases/edit_rhtml_spec.rb:20: 2) '/purchases/index.rhtml should render list of purchases' FAILED 2. is not true. ./spec/views/purchases/index_rhtml_spec.rb:29: 3) '/purchases/new.rhtml should render new form' FAILED Expected at least 1 elements, found 0. is not true. ./spec/views/purchases/new_rhtml_spec.rb:20: 4) '/purchases/show.rhtml should render attributes in

' FAILED expected /9\.99/, got "" ./spec/views/purchases/show_rhtml_spec.rb:22: ==================================== It turns out the generated .rhtml files are all empty - probably related to rails switching from .rhtml to .erb ==================================== And we're also getting this deprecation warning: DEPRECATION WARNING: template_root is deprecated and will be removed from Rails 2.0 (use view_paths instead) See http://www.rubyonrails.org/deprecation for details. (called from template_root= at ./vendor/rails/edge/actionpack/lib/action_controller/base.rb:360) ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=9760&group_id=797 From noreply at rubyforge.org Mon Apr 2 13:59:24 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Mon, 2 Apr 2007 13:59:24 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-9649 ] Parital mocks don't work if object loaded from fixture, and referenced via association Message-ID: <20070402175924.F09825240CBA@rubyforge.org> Bugs item #9649, was opened at 2007-03-28 15:44 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=9649&group_id=797 Category: mock module Group: None >Status: Open Resolution: Rejected Priority: 3 Submitted By: Chris Hoffman (hoffman_c) Assigned to: Aslak Helles?y (aslak_hellesoy) Summary: Parital mocks don't work if object loaded from fixture, and referenced via association Initial Comment: Hello, The following code will not function properly: spec/fixtures/pages.yml ---------- first: id: 1 type: LockedPage name: the first default page spec/fixtures/questions.yml ---------- first: id: 1 type: LockedQuestion name: the first default question container_id: 1 container_type: LockedPage spec/models/locked_question_spec.rb ---------- context "LockedQuestion#document_session, being linked to a Page that has a Document Session" do fixtures :questions, :pages setup do @question = questions(:first) @page = pages(:first) @page.stub!(:document_session).and_return("the document session") @question.page.should == @page #=> true end specify "should return the Page's Document Session" do @question.document_session.should == "the document session" #=> fails with 'undefined method' end end I would kludge something together by just assigning an unlocked page to the question, but the "Locked" that prefaces these models is a subclass that denies any modifications. Thanks for your help. -Chris ---------------------------------------------------------------------- >Comment By: Chris Hoffman (hoffman_c) Date: 2007-04-02 13:59 Message: Hello, I just ran the project I attached on rails 1.2, and it exhibited the same results. If you run into problems getting that project running, it may be due to an undefined method 'gem' in config/boot.rb; if you change this to 'require_gem', you should be up and running. Please let me know if you need additional information. Just as a recommendation, it would be superb to have rspec, rails, and even ruby version fields in this tracker, so that people like myself are forced to make this explicit. Thanks for your help. ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-04-02 10:23 Message: Your Rails version is one year old, and the oldest Rails version RSpec is tested against is 1.1.6 (8 months old). It's too much work for us to ensure things work against old Railses, so I'm closing this bug. Feel free to reopen this bug if it still applies to Rails 1.1.6 or 1.2.x. (In the near future we will probably drop support for 1.1.6 though). ---------------------------------------------------------------------- Comment By: Chris Hoffman (hoffman_c) Date: 2007-04-02 07:44 Message: I am not sure how to do partial mocks with Test::Unit. As far as versions, I have the following: rspec 0.8.2 rails 1.1.2 Is the attached rails application not giving you an error when you run rake spec:models? ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-04-02 07:19 Message: Can you confirm that you're not getting the same problem when you use Test::Unit? What are your versions of everything? ---------------------------------------------------------------------- Comment By: Chris Hoffman (hoffman_c) Date: 2007-04-01 11:24 Message: Hello, I have created a rails project with the models and spec that reveal the problem. Please let me know if you need additional information. Also, you were indeed correct that the above example would fail for a different reason (if not taking into account the Question model's delegation). I apologize for the confusion. ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-04-01 10:25 Message: What's 'undefined method' getting called on? Question or Page? Can you post the backtrace? ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=9649&group_id=797 From noreply at rubyforge.org Mon Apr 2 14:40:49 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Mon, 2 Apr 2007 14:40:49 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-9760 ] rspec generators incompatible with changes to edge rails Message-ID: <20070402184049.E615F5240CAA@rubyforge.org> Bugs item #9760, was opened at 2007-04-02 14:59 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=9760&group_id=797 Category: rails plugin Group: None >Status: Closed >Resolution: Accepted Priority: 3 Submitted By: David Chelimsky (dchelimsky) >Assigned to: David Chelimsky (dchelimsky) Summary: rspec generators incompatible with changes to edge rails Initial Comment: rails rev 6499 rspec rev 1672 (branches/0.9-dev) Stand in example_rails_app and run: RSPEC_RAILS_VERSION=edge rake rspec:pre_commit and you'll get the following errors: ==================================== controller specs ==================================== 'PurchasesController#route_for should map { :controller => 'purchases', :action => 'edit', :id => 1 } to /purchases/1;edit' FAILED expected "/purchases/1;edit", got "/purchases/1/edit" (using ==) ./spec/controllers/purchases_controller_spec.rb:19: ==================================== (that is because the mapping nown goes to /purchases/1/edit, as it probably should have all along) ==================================== ==================================== view specs ==================================== 1) '/purchases/edit.rhtml should render edit form' FAILED Expected at least 1 elements, found 0. is not true. ./spec/views/purchases/edit_rhtml_spec.rb:20: 2) '/purchases/index.rhtml should render list of purchases' FAILED 2. is not true. ./spec/views/purchases/index_rhtml_spec.rb:29: 3) '/purchases/new.rhtml should render new form' FAILED Expected at least 1 elements, found 0. is not true. ./spec/views/purchases/new_rhtml_spec.rb:20: 4) '/purchases/show.rhtml should render attributes in

' FAILED expected /9\.99/, got "" ./spec/views/purchases/show_rhtml_spec.rb:22: ==================================== It turns out the generated .rhtml files are all empty - probably related to rails switching from .rhtml to .erb ==================================== And we're also getting this deprecation warning: DEPRECATION WARNING: template_root is deprecated and will be removed from Rails 2.0 (use view_paths instead) See http://www.rubyonrails.org/deprecation for details. (called from template_root= at ./vendor/rails/edge/actionpack/lib/action_controller/base.rb:360) ---------------------------------------------------------------------- >Comment By: David Chelimsky (dchelimsky) Date: 2007-04-02 18:40 Message: Fixed in branches/0.9-dev (rev 1674) ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=9760&group_id=797 From noreply at rubyforge.org Mon Apr 2 14:47:57 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Mon, 2 Apr 2007 14:47:57 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-9421 ] --line doesn't work with behaviours that use class names Message-ID: <20070402184757.188F55240AB0@rubyforge.org> Bugs item #9421, was opened at 2007-03-21 10:11 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=9421&group_id=797 Category: runner module Group: None Status: Open Resolution: None Priority: 4 Submitted By: Aslak Helles?y (aslak_hellesoy) Assigned to: David Chelimsky (dchelimsky) Summary: --line doesn't work with behaviours that use class names Initial Comment: To reproduce, do: ruby bin/spec spec/spec/dsl/behaviour_spec.rb -l 22 Finished in 1.4e-05 seconds 0 examples, 0 failures This is because SpecParser always looks for quotes - it has to be smarter ---------------------------------------------------------------------- >Comment By: David Chelimsky (dchelimsky) Date: 2007-04-02 18:47 Message: The problem is now with modules: module Spec module DSL describe Behaviour do this produces a behaviour description of "Spec::DSL::Behaviour" but the parser is only looking for "Behaviour" in progress.... ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-04-01 21:07 Message: Didn't you just fix this? ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=9421&group_id=797 From noreply at rubyforge.org Mon Apr 2 15:22:37 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Mon, 2 Apr 2007 15:22:37 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-9421 ] --line doesn't work with behaviours that use class names Message-ID: <20070402192237.6F6F15240CB4@rubyforge.org> Bugs item #9421, was opened at 2007-03-21 10:11 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=9421&group_id=797 Category: runner module Group: None >Status: Closed >Resolution: Accepted Priority: 4 Submitted By: Aslak Helles?y (aslak_hellesoy) Assigned to: David Chelimsky (dchelimsky) Summary: --line doesn't work with behaviours that use class names Initial Comment: To reproduce, do: ruby bin/spec spec/spec/dsl/behaviour_spec.rb -l 22 Finished in 1.4e-05 seconds 0 examples, 0 failures This is because SpecParser always looks for quotes - it has to be smarter ---------------------------------------------------------------------- >Comment By: David Chelimsky (dchelimsky) Date: 2007-04-02 19:22 Message: Fixed in branches/0.9-dev (rev 1675) ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-04-02 18:47 Message: The problem is now with modules: module Spec module DSL describe Behaviour do this produces a behaviour description of "Spec::DSL::Behaviour" but the parser is only looking for "Behaviour" in progress.... ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-04-01 21:07 Message: Didn't you just fix this? ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=9421&group_id=797 From noreply at rubyforge.org Mon Apr 2 16:52:40 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Mon, 2 Apr 2007 16:52:40 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-9649 ] Parital mocks don't work if object loaded from fixture, and referenced via association Message-ID: <20070402205240.A9FB95240B6E@rubyforge.org> Bugs item #9649, was opened at 2007-03-28 15:44 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=9649&group_id=797 Category: mock module Group: None Status: Open Resolution: Rejected Priority: 3 Submitted By: Chris Hoffman (hoffman_c) Assigned to: Aslak Helles?y (aslak_hellesoy) Summary: Parital mocks don't work if object loaded from fixture, and referenced via association Initial Comment: Hello, The following code will not function properly: spec/fixtures/pages.yml ---------- first: id: 1 type: LockedPage name: the first default page spec/fixtures/questions.yml ---------- first: id: 1 type: LockedQuestion name: the first default question container_id: 1 container_type: LockedPage spec/models/locked_question_spec.rb ---------- context "LockedQuestion#document_session, being linked to a Page that has a Document Session" do fixtures :questions, :pages setup do @question = questions(:first) @page = pages(:first) @page.stub!(:document_session).and_return("the document session") @question.page.should == @page #=> true end specify "should return the Page's Document Session" do @question.document_session.should == "the document session" #=> fails with 'undefined method' end end I would kludge something together by just assigning an unlocked page to the question, but the "Locked" that prefaces these models is a subclass that denies any modifications. Thanks for your help. -Chris ---------------------------------------------------------------------- >Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-04-02 16:52 Message: I was able to reproduce your error. Looking further, it look like @page and @document.page is not the same instance, which explains why the spec is failing: require File.dirname(__FILE__) + '/../spec_helper' context "LockedQuestion#document_session, being linked to a Page that has a Document Session" do fixtures :questions, :pages setup do @question = questions(:first) @page = pages(:first) @page.stub!(:document_session).and_return("the document session") # This will work #@question.page.stub!(:document_session).and_return("the document session") end specify "should return the Page's Document Session" do @question.page.should == @page #=> true @question.page.should equal(@page) #=> fails, which explains why the next one fails too - the stub! is on the wrong object @question.page.document_session.should == "the document session" #=> fails with 'undefined method' end end This seems to be related to Rails not giving you the *same* (equal) page instance - just a similar (==) one. ---------------------------------------------------------------------- Comment By: Chris Hoffman (hoffman_c) Date: 2007-04-02 13:59 Message: Hello, I just ran the project I attached on rails 1.2, and it exhibited the same results. If you run into problems getting that project running, it may be due to an undefined method 'gem' in config/boot.rb; if you change this to 'require_gem', you should be up and running. Please let me know if you need additional information. Just as a recommendation, it would be superb to have rspec, rails, and even ruby version fields in this tracker, so that people like myself are forced to make this explicit. Thanks for your help. ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-04-02 10:23 Message: Your Rails version is one year old, and the oldest Rails version RSpec is tested against is 1.1.6 (8 months old). It's too much work for us to ensure things work against old Railses, so I'm closing this bug. Feel free to reopen this bug if it still applies to Rails 1.1.6 or 1.2.x. (In the near future we will probably drop support for 1.1.6 though). ---------------------------------------------------------------------- Comment By: Chris Hoffman (hoffman_c) Date: 2007-04-02 07:44 Message: I am not sure how to do partial mocks with Test::Unit. As far as versions, I have the following: rspec 0.8.2 rails 1.1.2 Is the attached rails application not giving you an error when you run rake spec:models? ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-04-02 07:19 Message: Can you confirm that you're not getting the same problem when you use Test::Unit? What are your versions of everything? ---------------------------------------------------------------------- Comment By: Chris Hoffman (hoffman_c) Date: 2007-04-01 11:24 Message: Hello, I have created a rails project with the models and spec that reveal the problem. Please let me know if you need additional information. Also, you were indeed correct that the above example would fail for a different reason (if not taking into account the Question model's delegation). I apologize for the confusion. ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-04-01 10:25 Message: What's 'undefined method' getting called on? Question or Page? Can you post the backtrace? ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=9649&group_id=797 From noreply at rubyforge.org Mon Apr 2 16:59:07 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Mon, 2 Apr 2007 16:59:07 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-9767 ] rspec_on_rails hoses Message-ID: <20070402205907.6E9635240B6E@rubyforge.org> Bugs item #9767, was opened at 2007-04-02 20:59 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=9767&group_id=797 Category: rails plugin Group: None Status: Open Resolution: None Priority: 3 Submitted By: Jonathan Terhorst (terhorst) Assigned to: Nobody (None) Summary: rspec_on_rails hoses Initial Comment: This was already mentioned on rspec-users but I never saw any mention of it. The plugin currently overwrites the rescue_action method of a tested controller: lib/spec/rails/runner/context/controller.rb:183: @controller_class.send(:define_method, :rescue_action) { |e| raise e } This is bad for several reasons. First, it's not very OO. Second, many people are using this method to implement exception handling (there's even a nice plugin for this) and this behavior breaks that. I am happy to code up a test and patch but first I need a better understanding of what this line was intended to accomplish--it seems pointless, so I must be missing something. As it stands, I commented it out and everything appears to work fine ... ? ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=9767&group_id=797 From noreply at rubyforge.org Mon Apr 2 17:02:30 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Mon, 2 Apr 2007 17:02:30 -0400 (EDT) Subject: [rspec-devel] [ rspec-Feature Requests-6591 ] rails_dpec like functionality in RSpec.tmbundle Message-ID: <20070402210230.AA2315240AB0@rubyforge.org> Feature Requests item #6591, was opened at 2006-11-09 20:53 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3152&aid=6591&group_id=797 Category: None Group: None >Status: Closed Priority: 3 Submitted By: Aslak Helles?y (aslak_hellesoy) Assigned to: Aslak Helles?y (aslak_hellesoy) Summary: rails_dpec like functionality in RSpec.tmbundle Initial Comment: For Rails development, it would be great to be able to run specs via DRb, to connect to rails_spec_server. I think the rails_spec script ought to be made a first-class RSpec core bin script: drbspec. Then it could be reused from commandline, editors/ides and other clients. Also see: http://www.artima.com/forums/flat.jsp?forum=123&thread=144337 ---------------------------------------------------------------------- >Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-04-02 17:02 Message: Fixed long ago. Just use the --drb in the TM RSPEC_OPTS settings ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2006-11-09 21:09 Message: Let's not forget to update the spec/rails doco when we do this ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3152&aid=6591&group_id=797 From noreply at rubyforge.org Mon Apr 2 19:05:33 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Mon, 2 Apr 2007 19:05:33 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-9649 ] Parital mocks don't work if object loaded from fixture, and referenced via association Message-ID: <20070402230533.55C925240B7E@rubyforge.org> Bugs item #9649, was opened at 2007-03-28 15:44 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=9649&group_id=797 Category: mock module Group: None Status: Open Resolution: Rejected Priority: 3 Submitted By: Chris Hoffman (hoffman_c) Assigned to: Aslak Helles?y (aslak_hellesoy) Summary: Parital mocks don't work if object loaded from fixture, and referenced via association Initial Comment: Hello, The following code will not function properly: spec/fixtures/pages.yml ---------- first: id: 1 type: LockedPage name: the first default page spec/fixtures/questions.yml ---------- first: id: 1 type: LockedQuestion name: the first default question container_id: 1 container_type: LockedPage spec/models/locked_question_spec.rb ---------- context "LockedQuestion#document_session, being linked to a Page that has a Document Session" do fixtures :questions, :pages setup do @question = questions(:first) @page = pages(:first) @page.stub!(:document_session).and_return("the document session") @question.page.should == @page #=> true end specify "should return the Page's Document Session" do @question.document_session.should == "the document session" #=> fails with 'undefined method' end end I would kludge something together by just assigning an unlocked page to the question, but the "Locked" that prefaces these models is a subclass that denies any modifications. Thanks for your help. -Chris ---------------------------------------------------------------------- >Comment By: Chris Hoffman (hoffman_c) Date: 2007-04-02 19:05 Message: Oh, okay, that makes sense. Thanks for looking into this issue for me. ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-04-02 16:52 Message: I was able to reproduce your error. Looking further, it look like @page and @document.page is not the same instance, which explains why the spec is failing: require File.dirname(__FILE__) + '/../spec_helper' context "LockedQuestion#document_session, being linked to a Page that has a Document Session" do fixtures :questions, :pages setup do @question = questions(:first) @page = pages(:first) @page.stub!(:document_session).and_return("the document session") # This will work #@question.page.stub!(:document_session).and_return("the document session") end specify "should return the Page's Document Session" do @question.page.should == @page #=> true @question.page.should equal(@page) #=> fails, which explains why the next one fails too - the stub! is on the wrong object @question.page.document_session.should == "the document session" #=> fails with 'undefined method' end end This seems to be related to Rails not giving you the *same* (equal) page instance - just a similar (==) one. ---------------------------------------------------------------------- Comment By: Chris Hoffman (hoffman_c) Date: 2007-04-02 13:59 Message: Hello, I just ran the project I attached on rails 1.2, and it exhibited the same results. If you run into problems getting that project running, it may be due to an undefined method 'gem' in config/boot.rb; if you change this to 'require_gem', you should be up and running. Please let me know if you need additional information. Just as a recommendation, it would be superb to have rspec, rails, and even ruby version fields in this tracker, so that people like myself are forced to make this explicit. Thanks for your help. ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-04-02 10:23 Message: Your Rails version is one year old, and the oldest Rails version RSpec is tested against is 1.1.6 (8 months old). It's too much work for us to ensure things work against old Railses, so I'm closing this bug. Feel free to reopen this bug if it still applies to Rails 1.1.6 or 1.2.x. (In the near future we will probably drop support for 1.1.6 though). ---------------------------------------------------------------------- Comment By: Chris Hoffman (hoffman_c) Date: 2007-04-02 07:44 Message: I am not sure how to do partial mocks with Test::Unit. As far as versions, I have the following: rspec 0.8.2 rails 1.1.2 Is the attached rails application not giving you an error when you run rake spec:models? ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-04-02 07:19 Message: Can you confirm that you're not getting the same problem when you use Test::Unit? What are your versions of everything? ---------------------------------------------------------------------- Comment By: Chris Hoffman (hoffman_c) Date: 2007-04-01 11:24 Message: Hello, I have created a rails project with the models and spec that reveal the problem. Please let me know if you need additional information. Also, you were indeed correct that the above example would fail for a different reason (if not taking into account the Question model's delegation). I apologize for the confusion. ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-04-01 10:25 Message: What's 'undefined method' getting called on? Question or Page? Can you post the backtrace? ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=9649&group_id=797 From noreply at rubyforge.org Mon Apr 2 22:01:20 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Mon, 2 Apr 2007 22:01:20 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-9649 ] Parital mocks don't work if object loaded from fixture, and referenced via association Message-ID: <20070403020120.79DDD5240CC5@rubyforge.org> Bugs item #9649, was opened at 2007-03-28 19:44 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=9649&group_id=797 Category: mock module Group: None Status: Open Resolution: Rejected Priority: 3 Submitted By: Chris Hoffman (hoffman_c) Assigned to: Aslak Helles?y (aslak_hellesoy) Summary: Parital mocks don't work if object loaded from fixture, and referenced via association Initial Comment: Hello, The following code will not function properly: spec/fixtures/pages.yml ---------- first: id: 1 type: LockedPage name: the first default page spec/fixtures/questions.yml ---------- first: id: 1 type: LockedQuestion name: the first default question container_id: 1 container_type: LockedPage spec/models/locked_question_spec.rb ---------- context "LockedQuestion#document_session, being linked to a Page that has a Document Session" do fixtures :questions, :pages setup do @question = questions(:first) @page = pages(:first) @page.stub!(:document_session).and_return("the document session") @question.page.should == @page #=> true end specify "should return the Page's Document Session" do @question.document_session.should == "the document session" #=> fails with 'undefined method' end end I would kludge something together by just assigning an unlocked page to the question, but the "Locked" that prefaces these models is a subclass that denies any modifications. Thanks for your help. -Chris ---------------------------------------------------------------------- >Comment By: David Chelimsky (dchelimsky) Date: 2007-04-03 02:01 Message: Can we close this then? ---------------------------------------------------------------------- Comment By: Chris Hoffman (hoffman_c) Date: 2007-04-02 23:05 Message: Oh, okay, that makes sense. Thanks for looking into this issue for me. ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-04-02 20:52 Message: I was able to reproduce your error. Looking further, it look like @page and @document.page is not the same instance, which explains why the spec is failing: require File.dirname(__FILE__) + '/../spec_helper' context "LockedQuestion#document_session, being linked to a Page that has a Document Session" do fixtures :questions, :pages setup do @question = questions(:first) @page = pages(:first) @page.stub!(:document_session).and_return("the document session") # This will work #@question.page.stub!(:document_session).and_return("the document session") end specify "should return the Page's Document Session" do @question.page.should == @page #=> true @question.page.should equal(@page) #=> fails, which explains why the next one fails too - the stub! is on the wrong object @question.page.document_session.should == "the document session" #=> fails with 'undefined method' end end This seems to be related to Rails not giving you the *same* (equal) page instance - just a similar (==) one. ---------------------------------------------------------------------- Comment By: Chris Hoffman (hoffman_c) Date: 2007-04-02 17:59 Message: Hello, I just ran the project I attached on rails 1.2, and it exhibited the same results. If you run into problems getting that project running, it may be due to an undefined method 'gem' in config/boot.rb; if you change this to 'require_gem', you should be up and running. Please let me know if you need additional information. Just as a recommendation, it would be superb to have rspec, rails, and even ruby version fields in this tracker, so that people like myself are forced to make this explicit. Thanks for your help. ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-04-02 14:23 Message: Your Rails version is one year old, and the oldest Rails version RSpec is tested against is 1.1.6 (8 months old). It's too much work for us to ensure things work against old Railses, so I'm closing this bug. Feel free to reopen this bug if it still applies to Rails 1.1.6 or 1.2.x. (In the near future we will probably drop support for 1.1.6 though). ---------------------------------------------------------------------- Comment By: Chris Hoffman (hoffman_c) Date: 2007-04-02 11:44 Message: I am not sure how to do partial mocks with Test::Unit. As far as versions, I have the following: rspec 0.8.2 rails 1.1.2 Is the attached rails application not giving you an error when you run rake spec:models? ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-04-02 11:19 Message: Can you confirm that you're not getting the same problem when you use Test::Unit? What are your versions of everything? ---------------------------------------------------------------------- Comment By: Chris Hoffman (hoffman_c) Date: 2007-04-01 15:24 Message: Hello, I have created a rails project with the models and spec that reveal the problem. Please let me know if you need additional information. Also, you were indeed correct that the above example would fail for a different reason (if not taking into account the Question model's delegation). I apologize for the confusion. ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-04-01 14:25 Message: What's 'undefined method' getting called on? Question or Page? Can you post the backtrace? ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=9649&group_id=797 From noreply at rubyforge.org Mon Apr 2 22:16:03 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Mon, 2 Apr 2007 22:16:03 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-9767 ] rspec_on_rails hoses Message-ID: <20070403021603.2E1125240CC8@rubyforge.org> Bugs item #9767, was opened at 2007-04-02 20:59 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=9767&group_id=797 Category: rails plugin Group: None >Status: Closed >Resolution: Accepted Priority: 3 Submitted By: Jonathan Terhorst (terhorst) >Assigned to: David Chelimsky (dchelimsky) Summary: rspec_on_rails hoses Initial Comment: This was already mentioned on rspec-users but I never saw any mention of it. The plugin currently overwrites the rescue_action method of a tested controller: lib/spec/rails/runner/context/controller.rb:183: @controller_class.send(:define_method, :rescue_action) { |e| raise e } This is bad for several reasons. First, it's not very OO. Second, many people are using this method to implement exception handling (there's even a nice plugin for this) and this behavior breaks that. I am happy to code up a test and patch but first I need a better understanding of what this line was intended to accomplish--it seems pointless, so I must be missing something. As it stands, I commented it out and everything appears to work fine ... ? ---------------------------------------------------------------------- >Comment By: David Chelimsky (dchelimsky) Date: 2007-04-03 02:16 Message: Fixed in trunk and branches/0.9-dev (rev 1678), so it will be included in both 0.8.3 and 0.9 forward. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=9767&group_id=797 From noreply at rubyforge.org Mon Apr 2 22:20:19 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Mon, 2 Apr 2007 22:20:19 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-9260 ] IvarProxy does not act like a hash Message-ID: <20070403022019.973235240CCB@rubyforge.org> Bugs item #9260, was opened at 2007-03-13 17:08 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=9260&group_id=797 >Category: rails plugin Group: None Status: Open Resolution: None Priority: 3 Submitted By: Brian Takita (btakita) Assigned to: Nobody (None) Summary: IvarProxy does not act like a hash Initial Comment: undefined method `delete' for # This happened in a Helper Spec. Here is the code to reproduce this. mab = Markaby::Builder.new(assigns_hash, self) ---------------------------------------------------------------------- >Comment By: David Chelimsky (dchelimsky) Date: 2007-04-03 02:20 Message: Brian, can you please submit a failing example? ---------------------------------------------------------------------- Comment By: Brian Takita (btakita) Date: 2007-03-13 17:13 Message: Here is a fix I used without specs (my specs pass now): class Spec::Rails::Expectations::IvarProxy def delete(name) @object.send(:remove_instance_variable, "@#{name}") if @object.instance_variables.include?("@#{name}") end def each @object.instance_variables do |var| yield @object.instance_variable_get(var) end end end ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=9260&group_id=797 From noreply at rubyforge.org Tue Apr 3 00:02:39 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Tue, 3 Apr 2007 00:02:39 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-7795 ] form_tag renders action=" /view_spec" in view specs Message-ID: <20070403040239.E8B015240CD6@rubyforge.org> Bugs item #7795, was opened at 2007-01-13 13:37 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=7795&group_id=797 Category: rails plugin Group: None >Status: Closed >Resolution: Accepted Priority: 3 Submitted By: David Chelimsky (dchelimsky) >Assigned to: David Chelimsky (dchelimsky) >Summary: form_tag renders action="/view_spec" in view specs Initial Comment: Given the following view spec: context "login/login" do setup do render 'login/login' end specify "should display login form" do response.should_have_tag 'form', :attributes => {:action => '/login/login'} ... end end And the following code in /login/login.rhtml: <% form_tag do %> ... <% end %> The spec fails as follows: 'login/login should display login form' FAILED

....
Apparently, because 'spec/rails' uses a ViewSpecController to render views, form_tag is using that. Note that this ends up rendering the correct thing when running the app:
...
---------------------------------------------------------------------- >Comment By: David Chelimsky (dchelimsky) Date: 2007-04-03 04:02 Message: Fixed in branches/0.9-dev (rev 1679) ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=7795&group_id=797 From noreply at rubyforge.org Tue Apr 3 02:42:54 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Tue, 3 Apr 2007 02:42:54 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-9649 ] Parital mocks don't work if object loaded from fixture, and referenced via association Message-ID: <20070403064254.F0C875240CE4@rubyforge.org> Bugs item #9649, was opened at 2007-03-28 15:44 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=9649&group_id=797 Category: mock module Group: None >Status: Closed Resolution: Rejected Priority: 3 Submitted By: Chris Hoffman (hoffman_c) Assigned to: Aslak Helles?y (aslak_hellesoy) Summary: Parital mocks don't work if object loaded from fixture, and referenced via association Initial Comment: Hello, The following code will not function properly: spec/fixtures/pages.yml ---------- first: id: 1 type: LockedPage name: the first default page spec/fixtures/questions.yml ---------- first: id: 1 type: LockedQuestion name: the first default question container_id: 1 container_type: LockedPage spec/models/locked_question_spec.rb ---------- context "LockedQuestion#document_session, being linked to a Page that has a Document Session" do fixtures :questions, :pages setup do @question = questions(:first) @page = pages(:first) @page.stub!(:document_session).and_return("the document session") @question.page.should == @page #=> true end specify "should return the Page's Document Session" do @question.document_session.should == "the document session" #=> fails with 'undefined method' end end I would kludge something together by just assigning an unlocked page to the question, but the "Locked" that prefaces these models is a subclass that denies any modifications. Thanks for your help. -Chris ---------------------------------------------------------------------- >Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-04-03 02:42 Message: Not a bug ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-04-02 22:01 Message: Can we close this then? ---------------------------------------------------------------------- Comment By: Chris Hoffman (hoffman_c) Date: 2007-04-02 19:05 Message: Oh, okay, that makes sense. Thanks for looking into this issue for me. ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-04-02 16:52 Message: I was able to reproduce your error. Looking further, it look like @page and @document.page is not the same instance, which explains why the spec is failing: require File.dirname(__FILE__) + '/../spec_helper' context "LockedQuestion#document_session, being linked to a Page that has a Document Session" do fixtures :questions, :pages setup do @question = questions(:first) @page = pages(:first) @page.stub!(:document_session).and_return("the document session") # This will work #@question.page.stub!(:document_session).and_return("the document session") end specify "should return the Page's Document Session" do @question.page.should == @page #=> true @question.page.should equal(@page) #=> fails, which explains why the next one fails too - the stub! is on the wrong object @question.page.document_session.should == "the document session" #=> fails with 'undefined method' end end This seems to be related to Rails not giving you the *same* (equal) page instance - just a similar (==) one. ---------------------------------------------------------------------- Comment By: Chris Hoffman (hoffman_c) Date: 2007-04-02 13:59 Message: Hello, I just ran the project I attached on rails 1.2, and it exhibited the same results. If you run into problems getting that project running, it may be due to an undefined method 'gem' in config/boot.rb; if you change this to 'require_gem', you should be up and running. Please let me know if you need additional information. Just as a recommendation, it would be superb to have rspec, rails, and even ruby version fields in this tracker, so that people like myself are forced to make this explicit. Thanks for your help. ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-04-02 10:23 Message: Your Rails version is one year old, and the oldest Rails version RSpec is tested against is 1.1.6 (8 months old). It's too much work for us to ensure things work against old Railses, so I'm closing this bug. Feel free to reopen this bug if it still applies to Rails 1.1.6 or 1.2.x. (In the near future we will probably drop support for 1.1.6 though). ---------------------------------------------------------------------- Comment By: Chris Hoffman (hoffman_c) Date: 2007-04-02 07:44 Message: I am not sure how to do partial mocks with Test::Unit. As far as versions, I have the following: rspec 0.8.2 rails 1.1.2 Is the attached rails application not giving you an error when you run rake spec:models? ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-04-02 07:19 Message: Can you confirm that you're not getting the same problem when you use Test::Unit? What are your versions of everything? ---------------------------------------------------------------------- Comment By: Chris Hoffman (hoffman_c) Date: 2007-04-01 11:24 Message: Hello, I have created a rails project with the models and spec that reveal the problem. Please let me know if you need additional information. Also, you were indeed correct that the above example would fail for a different reason (if not taking into account the Question model's delegation). I apologize for the confusion. ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-04-01 10:25 Message: What's 'undefined method' getting called on? Question or Page? Can you post the backtrace? ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=9649&group_id=797 From noreply at rubyforge.org Tue Apr 3 07:40:06 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Tue, 3 Apr 2007 07:40:06 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-9649 ] Parital mocks don't work if object loaded from fixture, and referenced via association Message-ID: <20070403114006.BFDCF5240B52@rubyforge.org> Bugs item #9649, was opened at 2007-03-28 15:44 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=9649&group_id=797 Category: mock module Group: None Status: Closed Resolution: Rejected Priority: 3 Submitted By: Chris Hoffman (hoffman_c) Assigned to: Aslak Helles?y (aslak_hellesoy) Summary: Parital mocks don't work if object loaded from fixture, and referenced via association Initial Comment: Hello, The following code will not function properly: spec/fixtures/pages.yml ---------- first: id: 1 type: LockedPage name: the first default page spec/fixtures/questions.yml ---------- first: id: 1 type: LockedQuestion name: the first default question container_id: 1 container_type: LockedPage spec/models/locked_question_spec.rb ---------- context "LockedQuestion#document_session, being linked to a Page that has a Document Session" do fixtures :questions, :pages setup do @question = questions(:first) @page = pages(:first) @page.stub!(:document_session).and_return("the document session") @question.page.should == @page #=> true end specify "should return the Page's Document Session" do @question.document_session.should == "the document session" #=> fails with 'undefined method' end end I would kludge something together by just assigning an unlocked page to the question, but the "Locked" that prefaces these models is a subclass that denies any modifications. Thanks for your help. -Chris ---------------------------------------------------------------------- >Comment By: Chris Hoffman (hoffman_c) Date: 2007-04-03 07:40 Message: Oh yeah, sure, I should've done so. I thought the resolution was the state. ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-04-03 02:42 Message: Not a bug ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-04-02 22:01 Message: Can we close this then? ---------------------------------------------------------------------- Comment By: Chris Hoffman (hoffman_c) Date: 2007-04-02 19:05 Message: Oh, okay, that makes sense. Thanks for looking into this issue for me. ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-04-02 16:52 Message: I was able to reproduce your error. Looking further, it look like @page and @document.page is not the same instance, which explains why the spec is failing: require File.dirname(__FILE__) + '/../spec_helper' context "LockedQuestion#document_session, being linked to a Page that has a Document Session" do fixtures :questions, :pages setup do @question = questions(:first) @page = pages(:first) @page.stub!(:document_session).and_return("the document session") # This will work #@question.page.stub!(:document_session).and_return("the document session") end specify "should return the Page's Document Session" do @question.page.should == @page #=> true @question.page.should equal(@page) #=> fails, which explains why the next one fails too - the stub! is on the wrong object @question.page.document_session.should == "the document session" #=> fails with 'undefined method' end end This seems to be related to Rails not giving you the *same* (equal) page instance - just a similar (==) one. ---------------------------------------------------------------------- Comment By: Chris Hoffman (hoffman_c) Date: 2007-04-02 13:59 Message: Hello, I just ran the project I attached on rails 1.2, and it exhibited the same results. If you run into problems getting that project running, it may be due to an undefined method 'gem' in config/boot.rb; if you change this to 'require_gem', you should be up and running. Please let me know if you need additional information. Just as a recommendation, it would be superb to have rspec, rails, and even ruby version fields in this tracker, so that people like myself are forced to make this explicit. Thanks for your help. ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-04-02 10:23 Message: Your Rails version is one year old, and the oldest Rails version RSpec is tested against is 1.1.6 (8 months old). It's too much work for us to ensure things work against old Railses, so I'm closing this bug. Feel free to reopen this bug if it still applies to Rails 1.1.6 or 1.2.x. (In the near future we will probably drop support for 1.1.6 though). ---------------------------------------------------------------------- Comment By: Chris Hoffman (hoffman_c) Date: 2007-04-02 07:44 Message: I am not sure how to do partial mocks with Test::Unit. As far as versions, I have the following: rspec 0.8.2 rails 1.1.2 Is the attached rails application not giving you an error when you run rake spec:models? ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-04-02 07:19 Message: Can you confirm that you're not getting the same problem when you use Test::Unit? What are your versions of everything? ---------------------------------------------------------------------- Comment By: Chris Hoffman (hoffman_c) Date: 2007-04-01 11:24 Message: Hello, I have created a rails project with the models and spec that reveal the problem. Please let me know if you need additional information. Also, you were indeed correct that the above example would fail for a different reason (if not taking into account the Question model's delegation). I apologize for the confusion. ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-04-01 10:25 Message: What's 'undefined method' getting called on? Question or Page? Can you post the backtrace? ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=9649&group_id=797 From noreply at rubyforge.org Tue Apr 3 08:36:05 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Tue, 3 Apr 2007 08:36:05 -0400 (EDT) Subject: [rspec-devel] [ rspec-Feature Requests-9472 ] Provide way to extract specify/it into includable module Message-ID: <20070403123605.CEDC25240AE3@rubyforge.org> Feature Requests item #9472, was opened at 2007-03-22 16:12 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3152&aid=9472&group_id=797 Category: expectation module Group: None Status: Open Priority: 3 Submitted By: Bob Cotton (bcotton) Assigned to: Nobody (None) Summary: Provide way to extract specify/it into includable module Initial Comment: Based on the conversation here http://rubyforge.org/pipermail/rspec-users/2007-March/000993.html provide the ability to extract specify/it into a module that may be included into a context/describe For example: describe AllEditions, :shared => true do it "should" do end end describe LargeEdition do include AllEditions it "should also" do end end ---------------------------------------------------------------------- >Comment By: David Chelimsky (dchelimsky) Date: 2007-04-03 12:36 Message: So the concern that we've had about this sort of sharing is that it wouldn't lead to cleaner specs, but would, in fact, end up making things more complex. Let's take the stack example. describe "All Stacks", :shared => true do it "should return the top item when you send it #top" do OK - right away we've got a problem. Somehow, this example needs to reference a Stack instance and say something about it: describe "All Stacks", :shared => true do it "should return the top item when you send it #top" do @stack.top.should == ??????? What's it going to equal? Where's it going to come from? Perhaps this: describe "All Stacks", :shared => true do it "should return the top item when you send it #top" do @stack.top.should == @last_added end end describe "An non-empty, non-full Stack" do it_should_behave_as "All Stacks" def setup @stack = Stack.new @stack.push "1" @stack.push @last_added = "2" end end Now this would pass, but there's this unfortunate binding between the shared behavoiur and its user. As things grow more complex, these will end up in different files (or one really big file) and you'll have to go chasing around to understand what any one thing is doing. Now there is a case in which I see a real use for this that would minimize this binding and provide some benefit - and that is defining a duck type - sort of like a java interface without the interface class. So you could do this: describe "Enumerable", :shared => true do it "should respond to #each" do enumerable.should respond_to(:each) end end describe "A Stack" do it_should_behave_as "Enumerable" def setup @stack = Stack.new end def enumerable @stack end end So now we've defined an interface from the examples instead of from a class from which Stack must derive. This is what duck typing is all about! But we still have an odd binding here - the "A Stack" behaviour has to implement #enumerable. That makes me uncomfortable. So I was batting this around w/ Dan North and he suggested something that would end up looking like this: act_as_enumerable = act_as %w { each } describe Stack do it "should act as enumerable" do Stack.new.should act_as_enumerable end end Actually - his suggestion was quack_like :) quack_like_enumerable = quack_like %w { each } describe Stack do it "should quack like enumerable" do Stack.new.should quack_like_enumerable end end One way or another, I think that we'll want to add something like that because it is a very simple way to solve the behaves_as problem. So then my question is what other use cases are there for :shared => true? ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-03-27 01:24 Message: I need to think about how to word some things. Why don't you go ahead and give it your best shot and I'll tweak what I think needs tweaking. OK? Thanks Bob - a lot of people have been waiting for a feature like this. Cheers, David ---------------------------------------------------------------------- Comment By: Bob Cotton (bcotton) Date: 2007-03-27 01:01 Message: Thoughs on the wording for including shared behavior, before I write the doc and submit the patch? ---------------------------------------------------------------------- Comment By: Bob Cotton (bcotton) Date: 2007-03-25 13:36 Message: Yes, I'll be doing the work on 0.9. No BDD pie necessary, not being that familar with the code base, just wanted to make sure I wasn't missing anything. Before I can define behavior, I want to make sure I've got all the right classes. Don't worry, there will be specs! Thanks for the followup ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-03-24 23:33 Message: Following up - I guess there's nothing wrong w/ talking about design a LITTLE first. How about a collection on Spec::Runner with methods to interact with it right on the module. Something like: Spec::Runner.add_shared_behaviour(behaviour) Spec::Runner.find_shared_behaviour(:name) This way you don't have to expose anything and those methods can handle the management of the collection. Thoughts? Feel free to throw a BDD pie in my face instead of answering. Cheers, David ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-03-24 23:24 Message: Hi Bob - I assume you're working in the 0.9 branch, yes? If not, please do. As for your questions - this is BDD! Write some specs! If we have any issues w/ the design, we'll talk about it later. Cool? ---------------------------------------------------------------------- Comment By: Bob Cotton (bcotton) Date: 2007-03-24 22:29 Message: I'm about to start implementing this. A couple of questions: 1. I suppose the only way to locate a shared 'describe' would be through its description 2. I'll need to add an attr_reader for :examples to Spec::DSL::Behavior::ModuleMethods so I can grab all shared Examples and add them to the current Behavior just before running. 3. I'll need to add either an attr_reader for :behaviors or a find method to Spec::Runner::BehaviorRunner so I can lookup behaviors by descritpion. Thoughts? ---------------------------------------------------------------------- Comment By: Bob Cotton (bcotton) Date: 2007-03-22 18:45 Message: Very nice. it_should_behave_as Brainstorming with a co-worker: behaving_as behaves_like sharing acts_like an_example_of shares_behavior_with shares_behavior_of same_as same_behavior_as just_like equivalent_to it_doppelgangers ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-03-22 16:23 Message: I like this idea in general. I know we've been resistant to add any sort of example (spec) sharing, but perhaps now is the time. We can't really just say describe AllEditions because Ruby would treat that as a constant and not be able to find it. Also, include implies a module - this is a bit different. So I'm thinking something like this: describe "AllEditions", :shared => true do it "should do something" do end end describe LargeEdition do it_should_behave_as "AllEditions" it "should also do something else" do end end That reads kinda nice, ay? ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3152&aid=9472&group_id=797 From noreply at rubyforge.org Tue Apr 3 11:16:28 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Tue, 3 Apr 2007 11:16:28 -0400 (EDT) Subject: [rspec-devel] [ rspec-Feature Requests-9786 ] infer controller and helper names from the described type Message-ID: <20070403151628.670275240CFD@rubyforge.org> Feature Requests item #9786, was opened at 2007-04-03 15:16 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3152&aid=9786&group_id=797 Category: rails plugin Group: None Status: Open Priority: 3 Submitted By: David Chelimsky (dchelimsky) Assigned to: Nobody (None) Summary: infer controller and helper names from the described type Initial Comment: Now that we can do this: describe SomeThingController do it seems a shame to require this: controller_name :some_thing Controller Behavoiurs could be smart enough to see if a type is passed to #describe, and if it is a subclass of ActionController::Base, in which case it doesn't need to require controller_name Same goes for Helper Behaviours. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3152&aid=9786&group_id=797 From noreply at rubyforge.org Tue Apr 3 13:50:19 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Tue, 3 Apr 2007 13:50:19 -0400 (EDT) Subject: [rspec-devel] [ rspec-Feature Requests-9789 ] Make HtmlFormatter#extra_failure_content take the failure as a arg Message-ID: <20070403175020.797FE5240AE3@rubyforge.org> Feature Requests item #9789, was opened at 2007-04-03 13:50 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3152&aid=9789&group_id=797 Category: expectation module Group: None Status: Open Priority: 3 Submitted By: Mike Harris (gfunk911) Assigned to: Nobody (None) Summary: Make HtmlFormatter#extra_failure_content take the failure as a arg Initial Comment: It would be helpful if HtmlFormatter#extra_failure_content could take the failure as an arg, so it could produce content based on the failure. If the change was made to have rspec only pass the failure if the arity of failure is 1, it would also preserve existing behavior. I would be happy to code this and submit a patch if that would be helpful. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3152&aid=9789&group_id=797 From noreply at rubyforge.org Tue Apr 3 14:06:03 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Tue, 3 Apr 2007 14:06:03 -0400 (EDT) Subject: [rspec-devel] [ rspec-Feature Requests-9789 ] Make HtmlFormatter#extra_failure_content take the failure as a arg Message-ID: <20070403180604.08C3E5240BF0@rubyforge.org> Feature Requests item #9789, was opened at 2007-04-03 13:50 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3152&aid=9789&group_id=797 Category: expectation module Group: None Status: Open Priority: 3 Submitted By: Mike Harris (gfunk911) Assigned to: Nobody (None) Summary: Make HtmlFormatter#extra_failure_content take the failure as a arg Initial Comment: It would be helpful if HtmlFormatter#extra_failure_content could take the failure as an arg, so it could produce content based on the failure. If the change was made to have rspec only pass the failure if the arity of failure is 1, it would also preserve existing behavior. I would be happy to code this and submit a patch if that would be helpful. ---------------------------------------------------------------------- >Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-04-03 14:06 Message: Please make a patch (no need to ask permission first ;-) Out of curiosity - what kind of extension are you making that needs this feature? ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3152&aid=9789&group_id=797 From noreply at rubyforge.org Tue Apr 3 14:21:48 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Tue, 3 Apr 2007 14:21:48 -0400 (EDT) Subject: [rspec-devel] [ rspec-Feature Requests-9789 ] Make HtmlFormatter#extra_failure_content take the failure as a arg Message-ID: <20070403182148.9C6E05240CD3@rubyforge.org> Feature Requests item #9789, was opened at 2007-04-03 13:50 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3152&aid=9789&group_id=797 Category: expectation module Group: None Status: Open Priority: 3 Submitted By: Mike Harris (gfunk911) Assigned to: Nobody (None) Summary: Make HtmlFormatter#extra_failure_content take the failure as a arg Initial Comment: It would be helpful if HtmlFormatter#extra_failure_content could take the failure as an arg, so it could produce content based on the failure. If the change was made to have rspec only pass the failure if the arity of failure is 1, it would also preserve existing behavior. I would be happy to code this and submit a patch if that would be helpful. ---------------------------------------------------------------------- >Comment By: Mike Harris (gfunk911) Date: 2007-04-03 14:21 Message: I'm running my specs with two formatters attached (specdoc and html). I have html content for certain failures that I only want to display in the html format. I just monkeypatched in the changes that I wanted, but I thought it could be a feature that others would find useful. I'll get that patch ready and submit it. Thanks. ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-04-03 14:06 Message: Please make a patch (no need to ask permission first ;-) Out of curiosity - what kind of extension are you making that needs this feature? ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3152&aid=9789&group_id=797 From noreply at rubyforge.org Tue Apr 3 23:48:55 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Tue, 3 Apr 2007 23:48:55 -0400 (EDT) Subject: [rspec-devel] [ rspec-Feature Requests-9786 ] infer controller and helper names from the described type Message-ID: <20070404034855.407925240BE8@rubyforge.org> Feature Requests item #9786, was opened at 2007-04-03 15:16 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3152&aid=9786&group_id=797 Category: rails plugin Group: None >Status: Closed Priority: 3 Submitted By: David Chelimsky (dchelimsky) >Assigned to: David Chelimsky (dchelimsky) Summary: infer controller and helper names from the described type Initial Comment: Now that we can do this: describe SomeThingController do it seems a shame to require this: controller_name :some_thing Controller Behavoiurs could be smart enough to see if a type is passed to #describe, and if it is a subclass of ActionController::Base, in which case it doesn't need to require controller_name Same goes for Helper Behaviours. ---------------------------------------------------------------------- >Comment By: David Chelimsky (dchelimsky) Date: 2007-04-04 03:48 Message: Added in branches/0.9-dev (rev 1685) ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3152&aid=9786&group_id=797 From noreply at rubyforge.org Wed Apr 4 00:51:21 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Wed, 4 Apr 2007 00:51:21 -0400 (EDT) Subject: [rspec-devel] [ rspec-Feature Requests-9304 ] should_all < predicate> Message-ID: <20070404045121.6E2095240BE8@rubyforge.org> Feature Requests item #9304, was opened at 2007-03-15 14:58 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3152&aid=9304&group_id=797 Category: expectation module Group: None Status: Open >Priority: 2 Submitted By: Chris Hoffman (hoffman_c) Assigned to: Nobody (None) Summary: should_all <predicate> Initial Comment: Hello, In order to check the properties of each element in a collection, one must presently do the following (as far as I can tell): mycollection = [2,3,5,7] mycollection.each { |num| num.should_be_prime } I suggest an improvement that would significantly increase the readability of these statement types: mycollection.should_all be_prime Keep up the good work! This software has made me into a better programmer. ---------------------------------------------------------------------- >Comment By: David Chelimsky (dchelimsky) Date: 2007-04-04 04:51 Message: Actually, you're original idea would be more flexible, though I think #should_each would be more ruby-ish: (1..10).should_each be < 11 While it does look pretty sweet, I'm not 100% sold on the real value of this yet. We've just taken great pains to un-pollute Object so I'm hesitant to add anything else to it. There are also some questions that come up like whether to add #should_each_not, or whether to fail on the first iteration that fails or collect them all. This could get quite a bit more complicated. All of that said, you can add this to your spec_helper and get the functionality you're looking for in the mean time. class Object def should_each(*args) each {|item| item.should(*args)} end end Cheers, David ---------------------------------------------------------------------- Comment By: Chris Hoffman (hoffman_c) Date: 2007-03-15 15:14 Message: Sure, that will work; I'm not intimate with your code base, so whatever you think is best as far as implementation would be great. ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-03-15 15:11 Message: How about: mycollection.should all_be_prime Then we don't further pollute Object. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3152&aid=9304&group_id=797 From noreply at rubyforge.org Wed Apr 4 05:45:46 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Wed, 4 Apr 2007 05:45:46 -0400 (EDT) Subject: [rspec-devel] [ rspec-Feature Requests-9295 ] rake spec should run anything in the spec directory (not just rspec's standard dirs) Message-ID: <20070404094546.E05715240957@rubyforge.org> Feature Requests item #9295, was opened at 2007-03-14 22:20 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3152&aid=9295&group_id=797 Category: rails plugin Group: None >Status: Closed Priority: 3 Submitted By: David Chelimsky (dchelimsky) >Assigned to: Aslak Helles?y (aslak_hellesoy) Summary: rake spec should run anything in the spec directory (not just rspec's standard dirs) Initial Comment: >From email from Bob Martin: Recommend you add this to rspec.rake desc "Run all specs in spec directory" Spec::Rake::SpecTask.new(:all_specs => "db:test:prepare") do |t| t.spec_opts = ['--options', "\#{RAILS_ROOT}/spec/spec.opts\"] t.spec_files = FileList['spec/**/*_spec.rb'] end Perhaps this should BE the 'spec' task. ---------------------------------------------------------------------- >Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-04-04 05:45 Message: Fixed on branches/0.9-dev#1689 The convention for spec locations is not to put them under app as you suggest, but under the spec directory. spec/models, spec/controllers etc. As for wishing to add everything under app to the autoloader path, this sounds like a general Rails RFE. ---------------------------------------------------------------------- Comment By: Robert Martin (unclebob) Date: 2007-03-15 10:42 Message: I've only build one real rails app at this point. But before it got very large, I was creating subdirectories in the 'app/models' and 'app/specs' directory. I can't imaging that this isn't common practice. So my vote is for the default rake task to hunt out every subdirectory under spec, and execute any spec it finds. I also wish that every subdirectory under 'app' was automatically added to the rails autoloader path. ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-03-14 22:32 Message: I added the task (rev 1602), but I'm not sure about making it the default. As we add more types of specs for stories and browser tests, I think this will become problematic. I do see some benefit in a task that runs the model/view/controller/helper specs in a single batch (rather than 4 separate batches, each w/ their own reload time). Should we make the default do that? ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3152&aid=9295&group_id=797 From noreply at rubyforge.org Wed Apr 4 05:49:57 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Wed, 4 Apr 2007 05:49:57 -0400 (EDT) Subject: [rspec-devel] [ rspec-Feature Requests-6523 ] Run rspec on rails without a db Message-ID: <20070404094957.E43BE5240957@rubyforge.org> Feature Requests item #6523, was opened at 2006-11-06 16:07 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3152&aid=6523&group_id=797 Category: None Group: None >Status: Closed Priority: 3 Submitted By: Paul Pagel (paulwpagel) >Assigned to: Aslak Helles?y (aslak_hellesoy) Summary: Run rspec on rails without a db Initial Comment: We need to be able to run the specs without the database. We have no model objects in some of our projects