From noreply at rubyforge.org Fri Jun 1 00:44:58 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Fri, 1 Jun 2007 00:44:58 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11259 ] windows?: autotest suppresses output Message-ID: <20070601044458.6B64B5240C00@rubyforge.org> Bugs item #11259, was opened at 2007-05-31 12:15 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11259&group_id=797 Category: None Group: None Status: Open Resolution: None Priority: 3 Submitted By: Erik Ostrom (eostrom) Assigned to: Nobody (None) Summary: windows?: autotest suppresses output Initial Comment: When I run rspec under autotest (with the change I noted in 11258), it seems to run okay; it detects specs that should be run anew; it runs them (as evidenced by test.log); but it never, ever shows me any output from the spec runner. Even a test known to fail shows me nothing. If I use rspec without autotest, everything works fine. If I use Test::Unit instead of rspec, autotest shows me the full test runner output. So it must be a problem with the way rspec and autotest interact. (I don't know if this is actually a Windows problem, but it seems plausible.) ---------------------------------------------------------------------- >Comment By: Erik Ostrom (eostrom) Date: 2007-05-31 21:44 Message: Another useful piece of information I could have given you, it turns out, is the contents of my spec.opts file, which starts with '--colour'. With that removed, the bug goes away. That's probably good enough for me. In case it'll help track down this problem now or in the future, this is as far as I got: * In run_tests() in autotest.rb, the loop that's supposed to loop over characters in the test command's output gets EOF immediately, i.e., there's apparently no output from the spec script. * In colour() in base_text_formatter.rb, @colour and output_to_tty? are both true, so presumably the colour-formatted string is returned. I don't know what happens to it after it's returned and before it gets output. ---------------------------------------------------------------------- Comment By: Erik Ostrom (eostrom) Date: 2007-05-31 20:46 Message: Sorry, I forgot. I think I've got the latest everything: * Windows XP SP2 * Ruby 1.8.6 * Rails 1.2.3 * RSpec and Spec::Rails r2064 * ZenTest 3.6.0 ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-05-31 12:27 Message: Before investigating this we need to know the versions of all relevant software you are using, for example: * OS X 10.4.9 * Ruby 1.8.6 * RSpec 1.8.2 or RSpec trunk r1643 * Spec::Rails 1.8.2 or Spec::Rails tag r1234... * Rails 1.2.3 or Rails edge r5645 * Whatever other relevant software. Without this information it's like solving 1 equation (your question) with 5 unknown variables (the versions). We strongly recommend that you use the latest released version of RSpec, alternatively the subversion trunk (if you're the bleeding edge kind of person). ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11259&group_id=797 From noreply at rubyforge.org Fri Jun 1 03:33:17 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Fri, 1 Jun 2007 03:33:17 -0400 (EDT) Subject: [rspec-devel] [ rspec-Feature Requests-10932 ] Documentation on upgrading the Rspec on Rails Plugin Message-ID: <20070601073317.B34F952409AD@rubyforge.org> Feature Requests item #10932, was opened at 2007-05-20 00:44 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3152&aid=10932&group_id=797 Category: rails plugin Group: None >Status: Open Priority: 3 Submitted By: Brian Takita (btakita) >Assigned to: Aslak Helles?y (aslak_hellesoy) Summary: Documentation on upgrading the Rspec on Rails Plugin Initial Comment: Upgrading rpsec can be a pain. There should be some procedues. e.g. svn mv Rename existing plugin install latest version of plugin remove renamed old version of plugin ---------------------------------------------------------------------- >Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-06-01 03:33 Message: This won't work for people who checked it into svn - or people using svn:externals. It looks like these instructions will only work for people not using an scm at all(?) ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-05-31 19:40 Message: Added this to docs in r2067 # from the root of your rails project rm -rf vendor/plugins/rspec rm -rf vendor/plugins/rspec_on_rails ruby script/plugin install svn://rubyforge.org/var/svn/rspec/tags/CURRENT/rspec ruby script/plugin install svn://rubyforge.org/var/svn/rspec/tags/CURRENT/rspec_on_rails ruby script/generate rspec ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3152&aid=10932&group_id=797 From noreply at rubyforge.org Fri Jun 1 06:44:48 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Fri, 1 Jun 2007 06:44:48 -0400 (EDT) Subject: [rspec-devel] [ rspec-Feature Requests-10932 ] Documentation on upgrading the Rspec on Rails Plugin Message-ID: <20070601104448.E4EA0524096F@rubyforge.org> Feature Requests item #10932, was opened at 2007-05-20 04:44 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3152&aid=10932&group_id=797 Category: rails plugin Group: None Status: Open Priority: 3 Submitted By: Brian Takita (btakita) >Assigned to: David Chelimsky (dchelimsky) Summary: Documentation on upgrading the Rspec on Rails Plugin Initial Comment: Upgrading rpsec can be a pain. There should be some procedues. e.g. svn mv Rename existing plugin install latest version of plugin remove renamed old version of plugin ---------------------------------------------------------------------- >Comment By: David Chelimsky (dchelimsky) Date: 2007-06-01 10:44 Message: Good point. I'll extend it. ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-06-01 07:33 Message: This won't work for people who checked it into svn - or people using svn:externals. It looks like these instructions will only work for people not using an scm at all(?) ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-05-31 23:40 Message: Added this to docs in r2067 # from the root of your rails project rm -rf vendor/plugins/rspec rm -rf vendor/plugins/rspec_on_rails ruby script/plugin install svn://rubyforge.org/var/svn/rspec/tags/CURRENT/rspec ruby script/plugin install svn://rubyforge.org/var/svn/rspec/tags/CURRENT/rspec_on_rails ruby script/generate rspec ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3152&aid=10932&group_id=797 From noreply at rubyforge.org Fri Jun 1 11:44:54 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Fri, 1 Jun 2007 11:44:54 -0400 (EDT) Subject: [rspec-devel] [ rspec-Feature Requests-10781 ] Hierarchical specdoc output for shared behaviors Message-ID: <20070601154454.DE0C15240AD3@rubyforge.org> Feature Requests item #10781, was opened at 2007-05-11 10:17 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3152&aid=10781&group_id=797 Category: reports Group: None Status: Open Priority: 3 Submitted By: Greg Spurrier (gregspurrier) Assigned to: Nobody (None) Summary: Hierarchical specdoc output for shared behaviors Initial Comment: When shared behaviors are included into a behavior, there is no indication of the source of the behavior in the specdoc output. This can be confusing when multiple shared behaviors are included and have similar examples. E.g.: describe "REST index action", :shared => true do it "should return status code 200" do end end describe "REST show action", :shared => true do it "should return status code 200" do end end describe "FooController" do it_should_behave_like "REST index action" it_should_behave_like "REST show action" end gives the following output with 0.9.4: % spec -fs a_spec.rb FooController - should return status code 200 - should return status code 200 It would be better, IMHO, if it looked like: FooController - should behave like REST index action and: - should return status code 200 - should behave like REST show action and: - should return status code 200 What do you guys think? ---------------------------------------------------------------------- >Comment By: Greg Spurrier (gregspurrier) Date: 2007-06-01 08:44 Message: After the discussion in the previous comments for this feature request and attending the RSpec BoF at RailsConf, I've come to the conclusion that this feature request is unnecessary and can be closed. ---------------------------------------------------------------------- Comment By: Greg Spurrier (gregspurrier) Date: 2007-05-11 16:35 Message: Yes, there may indeed be a new construct waiting to emerge add address this elegantly. Essentially, what I'm looking for is a way to group a set of behaviors that pertain to a superclass (or module that is mixed in) and then include them into the specification of derived classes. Sort of a spec hierarchy that runs parallel to the class hierarchy. Looking at the RFE you mentioned, unless I'm missing something, the "aspects" there seem to be more about namespace management than about defining generic aspects that can be included into multiple behaviors. Anyway, I'll continue to ponder it over the weekend as well, and maybe something will come to one of us. :) ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-05-11 16:11 Message: I hadn't really thought of shared behaviours as being about context. I think that the "concrete" behaviours that use them are where context should be expressed. I see the problem, but I feel like this is a misuse of shared behaviors and that there is some other construct that is trying to be emerge here. One thought is an RFE from a while back about "aspects" (or "facets"): http://rubyforge.org/tracker/?group_id=797&atid=3152&func=detail&aid=8654 Take a look at that and let me know what you think about it vis a vis this particular problem. ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-05-11 16:06 Message: OK, now I understand the problem better. Let me think on it for a bit. ---------------------------------------------------------------------- Comment By: Greg Spurrier (gregspurrier) Date: 2007-05-11 15:18 Message: The output you describe is great, but it requires you to put "if it's raining" in the description of each example that is part of the "when it's raining" behavior, which seems redundant. Writing the spec the natural way in which the descriptions of the examples are taken to be within the context of the description: describe "A when it's sunny", :shared => true do it "should be open for business" do end it "should be use natural lighting" do end end describe "A when it's cloudy", :shared =>true do it "should be open for business" do end it "should be use electric lighting" do end end describe "A", :shared => true do it_should_behave_like "A when it's sunny" it_should_behave_like "A when it's cloudy" end describe "B's inherited behavior" do it_should_behave_like "A" end gives: B's inherited behavior - should be open for business - should be use natural lighting - should be open for business - should be use electric lighting which is what I was referring to as being confusing. It'd be nice if there was a way for the context of the behavior to carry through to the specdoc output so that the output can be unambiguous, but the specs can still read naturally without having to explicitly include the context in each example. ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-05-11 12:10 Message: Why would the output be confusing? Everything just gets flattened, so for an A that does 2 things when it rains and 2 other things when it's cloudy, with subclasses B and C, the output would say: B - should do thing 1 if it's raining - should do thing 2 if it's raining - should do thing 3 if it's cloudy - should do thing 4 if it's cloudy C - should do thing 1 if it's raining - should do thing 2 if it's raining - should do thing 3 if it's cloudy - should do thing 4 if it's cloudy Looking at either listing, everything seems clear. What am I missing? ---------------------------------------------------------------------- Comment By: Greg Spurrier (gregspurrier) Date: 2007-05-11 11:38 Message: I can certainly see your point for simple examples like the one in the docs: Officer - should be payable - should be bonusable - should be optionable is indeed preferable to: Officer - should behave like All Managers, and: - should behave like All Employees, and : - be bonusable - be payable - be optionable Let me describe the root issue that I'm grappling with and that initially led me to request hierarchical output. Perhaps there's a beter way. How do you deal with subclasses that should share multiple behaviors with their superclass. E.g., suppose you have: class A #... end class B < A # ... end and behaviors like: describe "A when it is sunny", :shared => true do end describe "A when it is cloudy", :shared => true do end For B, you can do: describe "B when it is sunny" do it_should_behave_like "A when it is sunny" end describe "B when it is cloudy" do it_should_behave_like "A when it is cloudy" end and, maybe that's the right way to do it. But, it leads to a lot of repeated typing when A has a lot of shared behaviors or there are a lot of subclasses of A. So, I was thinking about doing something like this for A: describe "A", :shared => true do it_should_behave_like "A when it is sunny" it_should_behave_like "A when is is cloudy" end And for B: describe "B inherited behavior" do it_should_behave_like "A" end The advantage of this approach is that you can continue to add shared behaviors to the "A" description without having to go update the specs of all the subclasses. But, with the current specdoc output, this aggregating of shared behaviors into another shared behavior would be pretty confusing in the output. Maybe there's another way to tackle this. Suggestions? ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-05-11 11:13 Message: Personally I think that makes things more confusing. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3152&aid=10781&group_id=797 From noreply at rubyforge.org Fri Jun 1 11:45:22 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Fri, 1 Jun 2007 11:45:22 -0400 (EDT) Subject: [rspec-devel] [ rspec-Feature Requests-10781 ] Hierarchical specdoc output for shared behaviors Message-ID: <20070601154522.E54495240AF4@rubyforge.org> Feature Requests item #10781, was opened at 2007-05-11 10:17 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3152&aid=10781&group_id=797 Category: reports Group: None >Status: Closed Priority: 3 Submitted By: Greg Spurrier (gregspurrier) Assigned to: Nobody (None) Summary: Hierarchical specdoc output for shared behaviors Initial Comment: When shared behaviors are included into a behavior, there is no indication of the source of the behavior in the specdoc output. This can be confusing when multiple shared behaviors are included and have similar examples. E.g.: describe "REST index action", :shared => true do it "should return status code 200" do end end describe "REST show action", :shared => true do it "should return status code 200" do end end describe "FooController" do it_should_behave_like "REST index action" it_should_behave_like "REST show action" end gives the following output with 0.9.4: % spec -fs a_spec.rb FooController - should return status code 200 - should return status code 200 It would be better, IMHO, if it looked like: FooController - should behave like REST index action and: - should return status code 200 - should behave like REST show action and: - should return status code 200 What do you guys think? ---------------------------------------------------------------------- Comment By: Greg Spurrier (gregspurrier) Date: 2007-06-01 08:44 Message: After the discussion in the previous comments for this feature request and attending the RSpec BoF at RailsConf, I've come to the conclusion that this feature request is unnecessary and can be closed. ---------------------------------------------------------------------- Comment By: Greg Spurrier (gregspurrier) Date: 2007-05-11 16:35 Message: Yes, there may indeed be a new construct waiting to emerge add address this elegantly. Essentially, what I'm looking for is a way to group a set of behaviors that pertain to a superclass (or module that is mixed in) and then include them into the specification of derived classes. Sort of a spec hierarchy that runs parallel to the class hierarchy. Looking at the RFE you mentioned, unless I'm missing something, the "aspects" there seem to be more about namespace management than about defining generic aspects that can be included into multiple behaviors. Anyway, I'll continue to ponder it over the weekend as well, and maybe something will come to one of us. :) ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-05-11 16:11 Message: I hadn't really thought of shared behaviours as being about context. I think that the "concrete" behaviours that use them are where context should be expressed. I see the problem, but I feel like this is a misuse of shared behaviors and that there is some other construct that is trying to be emerge here. One thought is an RFE from a while back about "aspects" (or "facets"): http://rubyforge.org/tracker/?group_id=797&atid=3152&func=detail&aid=8654 Take a look at that and let me know what you think about it vis a vis this particular problem. ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-05-11 16:06 Message: OK, now I understand the problem better. Let me think on it for a bit. ---------------------------------------------------------------------- Comment By: Greg Spurrier (gregspurrier) Date: 2007-05-11 15:18 Message: The output you describe is great, but it requires you to put "if it's raining" in the description of each example that is part of the "when it's raining" behavior, which seems redundant. Writing the spec the natural way in which the descriptions of the examples are taken to be within the context of the description: describe "A when it's sunny", :shared => true do it "should be open for business" do end it "should be use natural lighting" do end end describe "A when it's cloudy", :shared =>true do it "should be open for business" do end it "should be use electric lighting" do end end describe "A", :shared => true do it_should_behave_like "A when it's sunny" it_should_behave_like "A when it's cloudy" end describe "B's inherited behavior" do it_should_behave_like "A" end gives: B's inherited behavior - should be open for business - should be use natural lighting - should be open for business - should be use electric lighting which is what I was referring to as being confusing. It'd be nice if there was a way for the context of the behavior to carry through to the specdoc output so that the output can be unambiguous, but the specs can still read naturally without having to explicitly include the context in each example. ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-05-11 12:10 Message: Why would the output be confusing? Everything just gets flattened, so for an A that does 2 things when it rains and 2 other things when it's cloudy, with subclasses B and C, the output would say: B - should do thing 1 if it's raining - should do thing 2 if it's raining - should do thing 3 if it's cloudy - should do thing 4 if it's cloudy C - should do thing 1 if it's raining - should do thing 2 if it's raining - should do thing 3 if it's cloudy - should do thing 4 if it's cloudy Looking at either listing, everything seems clear. What am I missing? ---------------------------------------------------------------------- Comment By: Greg Spurrier (gregspurrier) Date: 2007-05-11 11:38 Message: I can certainly see your point for simple examples like the one in the docs: Officer - should be payable - should be bonusable - should be optionable is indeed preferable to: Officer - should behave like All Managers, and: - should behave like All Employees, and : - be bonusable - be payable - be optionable Let me describe the root issue that I'm grappling with and that initially led me to request hierarchical output. Perhaps there's a beter way. How do you deal with subclasses that should share multiple behaviors with their superclass. E.g., suppose you have: class A #... end class B < A # ... end and behaviors like: describe "A when it is sunny", :shared => true do end describe "A when it is cloudy", :shared => true do end For B, you can do: describe "B when it is sunny" do it_should_behave_like "A when it is sunny" end describe "B when it is cloudy" do it_should_behave_like "A when it is cloudy" end and, maybe that's the right way to do it. But, it leads to a lot of repeated typing when A has a lot of shared behaviors or there are a lot of subclasses of A. So, I was thinking about doing something like this for A: describe "A", :shared => true do it_should_behave_like "A when it is sunny" it_should_behave_like "A when is is cloudy" end And for B: describe "B inherited behavior" do it_should_behave_like "A" end The advantage of this approach is that you can continue to add shared behaviors to the "A" description without having to go update the specs of all the subclasses. But, with the current specdoc output, this aggregating of shared behaviors into another shared behavior would be pretty confusing in the output. Maybe there's another way to tackle this. Suggestions? ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-05-11 11:13 Message: Personally I think that makes things more confusing. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3152&aid=10781&group_id=797 From noreply at rubyforge.org Fri Jun 1 14:25:55 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Fri, 1 Jun 2007 14:25:55 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-10577 ] Rails with Oracle breaks 0.9.2 Message-ID: <20070601182555.1C4AF52409E6@rubyforge.org> Bugs item #10577, was opened at 2007-05-04 10:57 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=10577&group_id=797 Category: rails plugin Group: None Status: Open Resolution: None Priority: 3 Submitted By: John Andrews (jandrews) Assigned to: Nobody (None) Summary: Rails with Oracle breaks 0.9.2 Initial Comment: Upgrading to rspec 0.9.2 from 0.8.2 using Oracle database with ActiveRecord breaks due to the following: oracle_adapter.rb:316 (owner, table_name) = @connection.describe(table_name) @connection is an instance of OCI8AutoRecover which itself delegates the describe method to OCI8. class OCI8AutoRecover < DelegateClass(OCI8) #... # no def describe method end DelegateClass internally uses method_missing to call the delegate class' describe class OCI8 #:nodoc: def describe(name) #... end #... end The problem is that rspec defines Kernel#describe, so method_missing never catches the call to delegate and it fails from rspec because there is obviously no block given. My work-around modifies 2 files. I will just include the methods I changed because I don't have diffs from trunk. from file: rspec_on_rails/lib/spec/rails/extensions/kernel.rb def describe(*args, &block) # assuming that if a block is not given that it is not a call # for rspec if block_given? args << {} unless Hash === args.last args.last[:spec_path] = caller(0)[1] end original_describe(*args, &block) end from file: rspec-0.9.2/lib/spec/runner/extensions/kernel.rb def describe(*args, &block) if block_given? raise ArgumentError if args.empty? register_behaviour(Spec::DSL::BehaviourFactory.create(*args, &block)) else # not the describe that we are looking for # it's probably a call from the oracle adapter super *args end end I don't know if this is the best way to fix the issue, but it works for me and all my specs pass again. if you need more info or someone to test a fix for Oracle I am able to help. ---------------------------------------------------------------------- Comment By: sinclair bain (sinclair) Date: 2007-06-01 13:25 Message: Hi, I just ran into this problem in rspec_for_rails 1.0.0. The solution I think we will settle for in the short term is a monkey patch to the OCI8AutoRecover class. The patch implements the #describe method in the OCI8AutoRecover class (via a module include). The patch file is in our rails_app/lib directory and is #required in the environment.rb. This is the implementation: module OracleAdapterPatch # rspec method name collision patch def describe(obj) puts "OCI8AutoRecover#describe( #{obj} ) forwarded to #{@connection}" @connection.describe(obj) end end OCI8AutoRecover.send(:include, OracleAdapterPatch) As is stated below this is (still) a band-aid approach. Cheers! sinclair ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-05-05 18:56 Message: I'm uncomfortable with this solution. It's a band-aid for this particular example, but someone else might come along and do something similar - using method_missing to delegate to another object WITH a block expected in that object's #describe method. Does anyone have any other suggestions? ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=10577&group_id=797 From noreply at rubyforge.org Fri Jun 1 18:47:05 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Fri, 1 Jun 2007 18:47:05 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11296 ] svn export gives errors Message-ID: <20070601224706.0F05A52409E6@rubyforge.org> Bugs item #11296, was opened at 2007-06-01 15:47 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11296&group_id=797 Category: rails plugin Group: None Status: Open Resolution: None Priority: 3 Submitted By: Jim Morris (wolfmanjm) Assigned to: Nobody (None) Summary: svn export gives errors Initial Comment: Trying to import via piston (svn export) there is an inconsistent line ending error... > piston import svn://rubyforge.org/var/svn/rspec/tags/CURRENT/rspec_on_rails vendor/plugins/rspec_on_rails svn: File 'vendor/plugins/rspec_on_rails/lib/spec/rails/version.rb' has inconsistent newlines svn: Inconsistent line ending style /usr/lib/ruby/gems/1.8/gems/piston-1.3.3/lib/piston/command.rb:43:in `svn': Command svn add --force --quiet vendor/plugins/rspec_on_rails resulted in an error: (RuntimeError) from /usr/lib/ruby/gems/1.8/gems/piston-1.3.3/lib/piston/commands/import.rb:50:in `run' from /usr/lib/ruby/gems/1.8/gems/piston-1.3.3/lib/transat/parser.rb:131:in `execute' from /usr/lib/ruby/gems/1.8/gems/piston-1.3.3/lib/transat/parser.rb:127:in `each' from /usr/lib/ruby/gems/1.8/gems/piston-1.3.3/lib/transat/parser.rb:127:in `execute' from /usr/lib/ruby/gems/1.8/gems/piston-1.3.3/lib/transat/parser.rb:104:in `parse_and_execute' from /usr/lib/ruby/gems/1.8/gems/piston-1.3.3/bin/piston:10 from /usr/bin/piston:16:in `load' from /usr/bin/piston:16 ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11296&group_id=797 From noreply at rubyforge.org Fri Jun 1 19:28:22 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Fri, 1 Jun 2007 19:28:22 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11296 ] svn export gives errors Message-ID: <20070601232822.8D8AE52409E6@rubyforge.org> Bugs item #11296, was opened at 2007-06-01 22:47 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11296&group_id=797 Category: rails plugin Group: None Status: Open Resolution: None Priority: 3 Submitted By: Jim Morris (wolfmanjm) Assigned to: Nobody (None) Summary: svn export gives errors Initial Comment: Trying to import via piston (svn export) there is an inconsistent line ending error... > piston import svn://rubyforge.org/var/svn/rspec/tags/CURRENT/rspec_on_rails vendor/plugins/rspec_on_rails svn: File 'vendor/plugins/rspec_on_rails/lib/spec/rails/version.rb' has inconsistent newlines svn: Inconsistent line ending style /usr/lib/ruby/gems/1.8/gems/piston-1.3.3/lib/piston/command.rb:43:in `svn': Command svn add --force --quiet vendor/plugins/rspec_on_rails resulted in an error: (RuntimeError) from /usr/lib/ruby/gems/1.8/gems/piston-1.3.3/lib/piston/commands/import.rb:50:in `run' from /usr/lib/ruby/gems/1.8/gems/piston-1.3.3/lib/transat/parser.rb:131:in `execute' from /usr/lib/ruby/gems/1.8/gems/piston-1.3.3/lib/transat/parser.rb:127:in `each' from /usr/lib/ruby/gems/1.8/gems/piston-1.3.3/lib/transat/parser.rb:127:in `execute' from /usr/lib/ruby/gems/1.8/gems/piston-1.3.3/lib/transat/parser.rb:104:in `parse_and_execute' from /usr/lib/ruby/gems/1.8/gems/piston-1.3.3/bin/piston:10 from /usr/bin/piston:16:in `load' from /usr/bin/piston:16 ---------------------------------------------------------------------- >Comment By: David Chelimsky (dchelimsky) Date: 2007-06-01 23:28 Message: I'm not experiencing this. I'm using Mac OS 10.4.9, piston 1.3.3 and svn 1.4.3. You? ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11296&group_id=797 From noreply at rubyforge.org Fri Jun 1 20:26:59 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Fri, 1 Jun 2007 20:26:59 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11296 ] svn export gives errors Message-ID: <20070602002659.F02B152409E6@rubyforge.org> Bugs item #11296, was opened at 2007-06-01 15:47 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11296&group_id=797 Category: rails plugin Group: None Status: Open Resolution: None Priority: 3 Submitted By: Jim Morris (wolfmanjm) Assigned to: Nobody (None) Summary: svn export gives errors Initial Comment: Trying to import via piston (svn export) there is an inconsistent line ending error... > piston import svn://rubyforge.org/var/svn/rspec/tags/CURRENT/rspec_on_rails vendor/plugins/rspec_on_rails svn: File 'vendor/plugins/rspec_on_rails/lib/spec/rails/version.rb' has inconsistent newlines svn: Inconsistent line ending style /usr/lib/ruby/gems/1.8/gems/piston-1.3.3/lib/piston/command.rb:43:in `svn': Command svn add --force --quiet vendor/plugins/rspec_on_rails resulted in an error: (RuntimeError) from /usr/lib/ruby/gems/1.8/gems/piston-1.3.3/lib/piston/commands/import.rb:50:in `run' from /usr/lib/ruby/gems/1.8/gems/piston-1.3.3/lib/transat/parser.rb:131:in `execute' from /usr/lib/ruby/gems/1.8/gems/piston-1.3.3/lib/transat/parser.rb:127:in `each' from /usr/lib/ruby/gems/1.8/gems/piston-1.3.3/lib/transat/parser.rb:127:in `execute' from /usr/lib/ruby/gems/1.8/gems/piston-1.3.3/lib/transat/parser.rb:104:in `parse_and_execute' from /usr/lib/ruby/gems/1.8/gems/piston-1.3.3/bin/piston:10 from /usr/bin/piston:16:in `load' from /usr/bin/piston:16 ---------------------------------------------------------------------- >Comment By: Jim Morris (wolfmanjm) Date: 2007-06-01 17:26 Message: I'm using svn, version 1.4.3 (r23084) on Ubuntu Linux Feisty. piston (1.3.3) It actually checked out ok, but the failure was on the svn add The file vendor/plugins/rspec_on_rails/lib/spec/rails/version.rb had DOS style line endings, but was inconsistent, so some \n and some \r\n When I did a dos2unix on the file it worked fine. ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-06-01 16:28 Message: I'm not experiencing this. I'm using Mac OS 10.4.9, piston 1.3.3 and svn 1.4.3. You? ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11296&group_id=797 From noreply at rubyforge.org Sat Jun 2 14:42:18 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Sat, 2 Jun 2007 14:42:18 -0400 (EDT) Subject: [rspec-devel] [ rspec-Feature Requests-10932 ] Documentation on upgrading the Rspec on Rails Plugin Message-ID: <20070602184218.96FF45240ABF@rubyforge.org> Feature Requests item #10932, was opened at 2007-05-20 04:44 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3152&aid=10932&group_id=797 Category: rails plugin Group: None Status: Open Priority: 3 Submitted By: Brian Takita (btakita) >Assigned to: Aslak Helles?y (aslak_hellesoy) Summary: Documentation on upgrading the Rspec on Rails Plugin Initial Comment: Upgrading rpsec can be a pain. There should be some procedues. e.g. svn mv Rename existing plugin install latest version of plugin remove renamed old version of plugin ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-06-01 10:44 Message: Good point. I'll extend it. ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-06-01 07:33 Message: This won't work for people who checked it into svn - or people using svn:externals. It looks like these instructions will only work for people not using an scm at all(?) ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-05-31 23:40 Message: Added this to docs in r2067 # from the root of your rails project rm -rf vendor/plugins/rspec rm -rf vendor/plugins/rspec_on_rails ruby script/plugin install svn://rubyforge.org/var/svn/rspec/tags/CURRENT/rspec ruby script/plugin install svn://rubyforge.org/var/svn/rspec/tags/CURRENT/rspec_on_rails ruby script/generate rspec ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3152&aid=10932&group_id=797 From rbarlow at raymanoz.com Sun Jun 3 12:57:32 2007 From: rbarlow at raymanoz.com (Raymond Barlow) Date: Sun, 03 Jun 2007 17:57:32 +0100 Subject: [rspec-devel] rspec runner for eclipse Message-ID: <4662F2FC.3040408@raymanoz.com> Hi guys, I'm looking at writing an rspec runner for eclipse like the jUnit and ruby's TestUnit plugins. I think this would get rspec used a lot more. To do this, I'm going to use jRuby to start a ruby script that kicks off the rspec tests. I've written a custom BehaviourRunner that basically substitutes the @options.report for my own version. This way I can see when the tests are starting, stopping, passing, not passing etc. The ruby code will call back to the Java runner and communicate with an RSpecListener. But, my current problem is this: How do you start an rspec test in Ruby? i.e. not from the command line? I've been using this command line to workout where in the ruby code to do the Java callbacks: spec --require j_behaviour_runner.rb --runner JBehaviourRunner bowling_spec.rb and now I need to do this in a ruby script so that I can start it from jRuby. Comments? Oh, and one last (stupid!) question--is there already an eclipse runner out there? Cheers! Raymond Barlow From noreply at rubyforge.org Sun Jun 3 16:38:37 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Sun, 3 Jun 2007 16:38:37 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11337 ] autotest runs specs redundantly Message-ID: <20070603203837.215F75240AE2@rubyforge.org> Bugs item #11337, was opened at 2007-06-03 13:38 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11337&group_id=797 Category: None Group: None Status: Open Resolution: None Priority: 3 Submitted By: Erik Ostrom (eostrom) Assigned to: Nobody (None) Summary: autotest runs specs redundantly Initial Comment: I'm running autotest 3.6.0 with rspec 2064 on Ruby 1.8.6 and Rails 1.2.3 on Windows XP SP2. When I have a spec with two failing examples, autotest/rspec tries to rerun the spec twice. For example, the command line might look like this: ruby script/spec -O spec/spec.opts spec/models/comment_spec.rb; ruby script/spec -O spec/spec.opts spec/models/comment_spec.rb BTW, this doesn't work on Windows, even after hacking autotest/rspec.rb to honor autotest's new command separator constant, but I think it's an autotest bug (http://rubyforge.org/tracker/index.php?func=detail&aid=11335&group_id=419&atid=1678). The point of THIS bug is, it's running the same spec twice. Or more, if there are more failing examples. I was able to fix this to my satisfaction by changing this line in make_test_cmd in autotest/rspec.rb: return cmds.join('; ') to return cmds.uniq.join('; ') It might be better to compress the set of files before generating the commands, but I don't know the right place to do that. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11337&group_id=797 From noreply at rubyforge.org Sun Jun 3 17:39:08 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Sun, 3 Jun 2007 17:39:08 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11296 ] svn export gives errors Message-ID: <20070603213908.2F8CE5240AD8@rubyforge.org> Bugs item #11296, was opened at 2007-06-01 15:47 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11296&group_id=797 Category: rails plugin Group: None Status: Open Resolution: None Priority: 3 Submitted By: Jim Morris (wolfmanjm) Assigned to: Nobody (None) Summary: svn export gives errors Initial Comment: Trying to import via piston (svn export) there is an inconsistent line ending error... > piston import svn://rubyforge.org/var/svn/rspec/tags/CURRENT/rspec_on_rails vendor/plugins/rspec_on_rails svn: File 'vendor/plugins/rspec_on_rails/lib/spec/rails/version.rb' has inconsistent newlines svn: Inconsistent line ending style /usr/lib/ruby/gems/1.8/gems/piston-1.3.3/lib/piston/command.rb:43:in `svn': Command svn add --force --quiet vendor/plugins/rspec_on_rails resulted in an error: (RuntimeError) from /usr/lib/ruby/gems/1.8/gems/piston-1.3.3/lib/piston/commands/import.rb:50:in `run' from /usr/lib/ruby/gems/1.8/gems/piston-1.3.3/lib/transat/parser.rb:131:in `execute' from /usr/lib/ruby/gems/1.8/gems/piston-1.3.3/lib/transat/parser.rb:127:in `each' from /usr/lib/ruby/gems/1.8/gems/piston-1.3.3/lib/transat/parser.rb:127:in `execute' from /usr/lib/ruby/gems/1.8/gems/piston-1.3.3/lib/transat/parser.rb:104:in `parse_and_execute' from /usr/lib/ruby/gems/1.8/gems/piston-1.3.3/bin/piston:10 from /usr/bin/piston:16:in `load' from /usr/bin/piston:16 ---------------------------------------------------------------------- Comment By: Rick Tessner (ricktessner) Date: 2007-06-03 14:39 Message: I'm seeing the same error about "inconsistent line ending style" on version.rb. I'd guess that it's happening on my system since I have a line in my subversion config [auto-props] section that reads *.rb = svn:eol-style=native It looks like none of the *.rb files in rspec where checked in with the svn:eol-style property set. In the event of having developers on multiple platforms (ie. *nix-style and windows), both *nix and windows style line endings can end up in a given file. Upon svn import on another system that by default trys to set the svn:eol-style to native, the mixed line-ending styles will result in the error being seen by the OP and myself. The solution would be to get the line-endings into a consistent state via a utility such as dos2unix, make sure the plugin still works, set the svn:eol-style property to "native" and commit. Hope this helps. ---------------------------------------------------------------------- Comment By: Jim Morris (wolfmanjm) Date: 2007-06-01 17:26 Message: I'm using svn, version 1.4.3 (r23084) on Ubuntu Linux Feisty. piston (1.3.3) It actually checked out ok, but the failure was on the svn add The file vendor/plugins/rspec_on_rails/lib/spec/rails/version.rb had DOS style line endings, but was inconsistent, so some \n and some \r\n When I did a dos2unix on the file it worked fine. ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-06-01 16:28 Message: I'm not experiencing this. I'm using Mac OS 10.4.9, piston 1.3.3 and svn 1.4.3. You? ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11296&group_id=797 From aslak.hellesoy at gmail.com Sun Jun 3 17:55:28 2007 From: aslak.hellesoy at gmail.com (aslak hellesoy) Date: Sun, 3 Jun 2007 23:55:28 +0200 Subject: [rspec-devel] rspec runner for eclipse In-Reply-To: <4662F2FC.3040408@raymanoz.com> References: <4662F2FC.3040408@raymanoz.com> Message-ID: <8d961d900706031455v3bf8b051q6dcbdd245b9913f0@mail.gmail.com> On 6/3/07, Raymond Barlow wrote: > Hi guys, > > I'm looking at writing an rspec runner for eclipse like the jUnit and > ruby's TestUnit plugins. I think this would get rspec used a lot more. > > To do this, I'm going to use jRuby to start a ruby script that kicks off > the rspec tests. I've written a custom BehaviourRunner that basically > substitutes the @options.report for my own version. This way I can see > when the tests are starting, stopping, passing, not passing etc. The > ruby code will call back to the Java runner and communicate with an > RSpecListener. > > But, my current problem is this: How do you start an rspec test in Ruby? > i.e. not from the command line? I've been using this command line to > workout where in the ruby code to do the Java callbacks: > spec --require j_behaviour_runner.rb --runner JBehaviourRunner > bowling_spec.rb > > and now I need to do this in a ruby script so that I can start it from > jRuby. > > Comments? > You'll find instructions about IDE integration here: http://rspec.rubyforge.org/documentation/tools/extensions/editors/index.html > Oh, and one last (stupid!) question--is there already an eclipse runner > out there? > There is nothing for Eclipse. I would get in touch with the Aptana people if I were you. Aslak > Cheers! > Raymond Barlow > _______________________________________________ > rspec-devel mailing list > rspec-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-devel > From noreply at rubyforge.org Sun Jun 3 19:19:42 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Sun, 3 Jun 2007 19:19:42 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11296 ] svn export gives errors Message-ID: <20070603231942.097565240AD7@rubyforge.org> Bugs item #11296, was opened at 2007-06-01 18:47 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11296&group_id=797 Category: rails plugin Group: None Status: Open >Resolution: Accepted Priority: 3 Submitted By: Jim Morris (wolfmanjm) >Assigned to: Aslak Helles?y (aslak_hellesoy) Summary: svn export gives errors Initial Comment: Trying to import via piston (svn export) there is an inconsistent line ending error... > piston import svn://rubyforge.org/var/svn/rspec/tags/CURRENT/rspec_on_rails vendor/plugins/rspec_on_rails svn: File 'vendor/plugins/rspec_on_rails/lib/spec/rails/version.rb' has inconsistent newlines svn: Inconsistent line ending style /usr/lib/ruby/gems/1.8/gems/piston-1.3.3/lib/piston/command.rb:43:in `svn': Command svn add --force --quiet vendor/plugins/rspec_on_rails resulted in an error: (RuntimeError) from /usr/lib/ruby/gems/1.8/gems/piston-1.3.3/lib/piston/commands/import.rb:50:in `run' from /usr/lib/ruby/gems/1.8/gems/piston-1.3.3/lib/transat/parser.rb:131:in `execute' from /usr/lib/ruby/gems/1.8/gems/piston-1.3.3/lib/transat/parser.rb:127:in `each' from /usr/lib/ruby/gems/1.8/gems/piston-1.3.3/lib/transat/parser.rb:127:in `execute' from /usr/lib/ruby/gems/1.8/gems/piston-1.3.3/lib/transat/parser.rb:104:in `parse_and_execute' from /usr/lib/ruby/gems/1.8/gems/piston-1.3.3/bin/piston:10 from /usr/bin/piston:16:in `load' from /usr/bin/piston:16 ---------------------------------------------------------------------- >Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-06-03 19:19 Message: Fixed in r2075 (hopefully) The fix was done by adding a fix_cr_lf task to the root Rakefile which now runs before every commit. No futzing with svn:eol-style should be necessary (we'd have to set it on a lot of files, not only version.rb) Someone please confirm whether this is working or not and I'll close this. ---------------------------------------------------------------------- Comment By: Rick Tessner (ricktessner) Date: 2007-06-03 17:39 Message: I'm seeing the same error about "inconsistent line ending style" on version.rb. I'd guess that it's happening on my system since I have a line in my subversion config [auto-props] section that reads *.rb = svn:eol-style=native It looks like none of the *.rb files in rspec where checked in with the svn:eol-style property set. In the event of having developers on multiple platforms (ie. *nix-style and windows), both *nix and windows style line endings can end up in a given file. Upon svn import on another system that by default trys to set the svn:eol-style to native, the mixed line-ending styles will result in the error being seen by the OP and myself. The solution would be to get the line-endings into a consistent state via a utility such as dos2unix, make sure the plugin still works, set the svn:eol-style property to "native" and commit. Hope this helps. ---------------------------------------------------------------------- Comment By: Jim Morris (wolfmanjm) Date: 2007-06-01 20:26 Message: I'm using svn, version 1.4.3 (r23084) on Ubuntu Linux Feisty. piston (1.3.3) It actually checked out ok, but the failure was on the svn add The file vendor/plugins/rspec_on_rails/lib/spec/rails/version.rb had DOS style line endings, but was inconsistent, so some \n and some \r\n When I did a dos2unix on the file it worked fine. ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-06-01 19:28 Message: I'm not experiencing this. I'm using Mac OS 10.4.9, piston 1.3.3 and svn 1.4.3. You? ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11296&group_id=797 From noreply at rubyforge.org Sun Jun 3 20:39:39 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Sun, 3 Jun 2007 20:39:39 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11296 ] svn export gives errors Message-ID: <20070604003940.033405240ABB@rubyforge.org> Bugs item #11296, was opened at 2007-06-01 15:47 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11296&group_id=797 Category: rails plugin Group: None Status: Open Resolution: Accepted Priority: 3 Submitted By: Jim Morris (wolfmanjm) Assigned to: Aslak Helles?y (aslak_hellesoy) Summary: svn export gives errors Initial Comment: Trying to import via piston (svn export) there is an inconsistent line ending error... > piston import svn://rubyforge.org/var/svn/rspec/tags/CURRENT/rspec_on_rails vendor/plugins/rspec_on_rails svn: File 'vendor/plugins/rspec_on_rails/lib/spec/rails/version.rb' has inconsistent newlines svn: Inconsistent line ending style /usr/lib/ruby/gems/1.8/gems/piston-1.3.3/lib/piston/command.rb:43:in `svn': Command svn add --force --quiet vendor/plugins/rspec_on_rails resulted in an error: (RuntimeError) from /usr/lib/ruby/gems/1.8/gems/piston-1.3.3/lib/piston/commands/import.rb:50:in `run' from /usr/lib/ruby/gems/1.8/gems/piston-1.3.3/lib/transat/parser.rb:131:in `execute' from /usr/lib/ruby/gems/1.8/gems/piston-1.3.3/lib/transat/parser.rb:127:in `each' from /usr/lib/ruby/gems/1.8/gems/piston-1.3.3/lib/transat/parser.rb:127:in `execute' from /usr/lib/ruby/gems/1.8/gems/piston-1.3.3/lib/transat/parser.rb:104:in `parse_and_execute' from /usr/lib/ruby/gems/1.8/gems/piston-1.3.3/bin/piston:10 from /usr/bin/piston:16:in `load' from /usr/bin/piston:16 ---------------------------------------------------------------------- Comment By: Rick Tessner (ricktessner) Date: 2007-06-03 17:39 Message: Just tried doing a "piston import" as well as a plugin install followed by "svn add" and got the same message about "inconsistent newlines" To set the svn:eol-style property across a large number of files, using the following on a Mac or *nix system should do it: find . -name '.svn' -prune -o -type f | \ xargs svn ps svn:eol-style native svn commit NOTE: The above assumes that (1) you're cd'd to the top-level dir of the plugin source and (2) that all files in the plugin are text files. (I took a quick look thru the plugin source and didn't see anything that looked like binary data. ie images, pdf, etc) ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-06-03 16:19 Message: Fixed in r2075 (hopefully) The fix was done by adding a fix_cr_lf task to the root Rakefile which now runs before every commit. No futzing with svn:eol-style should be necessary (we'd have to set it on a lot of files, not only version.rb) Someone please confirm whether this is working or not and I'll close this. ---------------------------------------------------------------------- Comment By: Rick Tessner (ricktessner) Date: 2007-06-03 14:39 Message: I'm seeing the same error about "inconsistent line ending style" on version.rb. I'd guess that it's happening on my system since I have a line in my subversion config [auto-props] section that reads *.rb = svn:eol-style=native It looks like none of the *.rb files in rspec where checked in with the svn:eol-style property set. In the event of having developers on multiple platforms (ie. *nix-style and windows), both *nix and windows style line endings can end up in a given file. Upon svn import on another system that by default trys to set the svn:eol-style to native, the mixed line-ending styles will result in the error being seen by the OP and myself. The solution would be to get the line-endings into a consistent state via a utility such as dos2unix, make sure the plugin still works, set the svn:eol-style property to "native" and commit. Hope this helps. ---------------------------------------------------------------------- Comment By: Jim Morris (wolfmanjm) Date: 2007-06-01 17:26 Message: I'm using svn, version 1.4.3 (r23084) on Ubuntu Linux Feisty. piston (1.3.3) It actually checked out ok, but the failure was on the svn add The file vendor/plugins/rspec_on_rails/lib/spec/rails/version.rb had DOS style line endings, but was inconsistent, so some \n and some \r\n When I did a dos2unix on the file it worked fine. ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-06-01 16:28 Message: I'm not experiencing this. I'm using Mac OS 10.4.9, piston 1.3.3 and svn 1.4.3. You? ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11296&group_id=797 From noreply at rubyforge.org Sun Jun 3 20:47:31 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Sun, 3 Jun 2007 20:47:31 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11296 ] svn export gives errors Message-ID: <20070604004731.9B52A5240ABB@rubyforge.org> Bugs item #11296, was opened at 2007-06-01 15:47 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11296&group_id=797 Category: rails plugin Group: None Status: Open Resolution: Accepted Priority: 3 Submitted By: Jim Morris (wolfmanjm) Assigned to: Aslak Helles?y (aslak_hellesoy) Summary: svn export gives errors Initial Comment: Trying to import via piston (svn export) there is an inconsistent line ending error... > piston import svn://rubyforge.org/var/svn/rspec/tags/CURRENT/rspec_on_rails vendor/plugins/rspec_on_rails svn: File 'vendor/plugins/rspec_on_rails/lib/spec/rails/version.rb' has inconsistent newlines svn: Inconsistent line ending style /usr/lib/ruby/gems/1.8/gems/piston-1.3.3/lib/piston/command.rb:43:in `svn': Command svn add --force --quiet vendor/plugins/rspec_on_rails resulted in an error: (RuntimeError) from /usr/lib/ruby/gems/1.8/gems/piston-1.3.3/lib/piston/commands/import.rb:50:in `run' from /usr/lib/ruby/gems/1.8/gems/piston-1.3.3/lib/transat/parser.rb:131:in `execute' from /usr/lib/ruby/gems/1.8/gems/piston-1.3.3/lib/transat/parser.rb:127:in `each' from /usr/lib/ruby/gems/1.8/gems/piston-1.3.3/lib/transat/parser.rb:127:in `execute' from /usr/lib/ruby/gems/1.8/gems/piston-1.3.3/lib/transat/parser.rb:104:in `parse_and_execute' from /usr/lib/ruby/gems/1.8/gems/piston-1.3.3/bin/piston:10 from /usr/bin/piston:16:in `load' from /usr/bin/piston:16 ---------------------------------------------------------------------- Comment By: Rick Tessner (ricktessner) Date: 2007-06-03 17:47 Message: Sorry, the fix you put in with the rake task did work. I got bit by not paying attention to my command history. I was still working with CURRENT rather than trunk. The rake task you put in place did work. ---------------------------------------------------------------------- Comment By: Rick Tessner (ricktessner) Date: 2007-06-03 17:39 Message: Just tried doing a "piston import" as well as a plugin install followed by "svn add" and got the same message about "inconsistent newlines" To set the svn:eol-style property across a large number of files, using the following on a Mac or *nix system should do it: find . -name '.svn' -prune -o -type f | \ xargs svn ps svn:eol-style native svn commit NOTE: The above assumes that (1) you're cd'd to the top-level dir of the plugin source and (2) that all files in the plugin are text files. (I took a quick look thru the plugin source and didn't see anything that looked like binary data. ie images, pdf, etc) ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-06-03 16:19 Message: Fixed in r2075 (hopefully) The fix was done by adding a fix_cr_lf task to the root Rakefile which now runs before every commit. No futzing with svn:eol-style should be necessary (we'd have to set it on a lot of files, not only version.rb) Someone please confirm whether this is working or not and I'll close this. ---------------------------------------------------------------------- Comment By: Rick Tessner (ricktessner) Date: 2007-06-03 14:39 Message: I'm seeing the same error about "inconsistent line ending style" on version.rb. I'd guess that it's happening on my system since I have a line in my subversion config [auto-props] section that reads *.rb = svn:eol-style=native It looks like none of the *.rb files in rspec where checked in with the svn:eol-style property set. In the event of having developers on multiple platforms (ie. *nix-style and windows), both *nix and windows style line endings can end up in a given file. Upon svn import on another system that by default trys to set the svn:eol-style to native, the mixed line-ending styles will result in the error being seen by the OP and myself. The solution would be to get the line-endings into a consistent state via a utility such as dos2unix, make sure the plugin still works, set the svn:eol-style property to "native" and commit. Hope this helps. ---------------------------------------------------------------------- Comment By: Jim Morris (wolfmanjm) Date: 2007-06-01 17:26 Message: I'm using svn, version 1.4.3 (r23084) on Ubuntu Linux Feisty. piston (1.3.3) It actually checked out ok, but the failure was on the svn add The file vendor/plugins/rspec_on_rails/lib/spec/rails/version.rb had DOS style line endings, but was inconsistent, so some \n and some \r\n When I did a dos2unix on the file it worked fine. ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-06-01 16:28 Message: I'm not experiencing this. I'm using Mac OS 10.4.9, piston 1.3.3 and svn 1.4.3. You? ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11296&group_id=797 From noreply at rubyforge.org Sun Jun 3 21:05:40 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Sun, 3 Jun 2007 21:05:40 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11296 ] svn export gives errors Message-ID: <20070604010540.9E4A45240ABB@rubyforge.org> Bugs item #11296, was opened at 2007-06-01 18:47 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11296&group_id=797 Category: rails plugin Group: None >Status: Closed Resolution: Accepted Priority: 3 Submitted By: Jim Morris (wolfmanjm) Assigned to: Aslak Helles?y (aslak_hellesoy) Summary: svn export gives errors Initial Comment: Trying to import via piston (svn export) there is an inconsistent line ending error... > piston import svn://rubyforge.org/var/svn/rspec/tags/CURRENT/rspec_on_rails vendor/plugins/rspec_on_rails svn: File 'vendor/plugins/rspec_on_rails/lib/spec/rails/version.rb' has inconsistent newlines svn: Inconsistent line ending style /usr/lib/ruby/gems/1.8/gems/piston-1.3.3/lib/piston/command.rb:43:in `svn': Command svn add --force --quiet vendor/plugins/rspec_on_rails resulted in an error: (RuntimeError) from /usr/lib/ruby/gems/1.8/gems/piston-1.3.3/lib/piston/commands/import.rb:50:in `run' from /usr/lib/ruby/gems/1.8/gems/piston-1.3.3/lib/transat/parser.rb:131:in `execute' from /usr/lib/ruby/gems/1.8/gems/piston-1.3.3/lib/transat/parser.rb:127:in `each' from /usr/lib/ruby/gems/1.8/gems/piston-1.3.3/lib/transat/parser.rb:127:in `execute' from /usr/lib/ruby/gems/1.8/gems/piston-1.3.3/lib/transat/parser.rb:104:in `parse_and_execute' from /usr/lib/ruby/gems/1.8/gems/piston-1.3.3/bin/piston:10 from /usr/bin/piston:16:in `load' from /usr/bin/piston:16 ---------------------------------------------------------------------- >Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-06-03 21:05 Message: Thanks for the heads up. I'll close this then :-) ---------------------------------------------------------------------- Comment By: Rick Tessner (ricktessner) Date: 2007-06-03 20:47 Message: Sorry, the fix you put in with the rake task did work. I got bit by not paying attention to my command history. I was still working with CURRENT rather than trunk. The rake task you put in place did work. ---------------------------------------------------------------------- Comment By: Rick Tessner (ricktessner) Date: 2007-06-03 20:39 Message: Just tried doing a "piston import" as well as a plugin install followed by "svn add" and got the same message about "inconsistent newlines" To set the svn:eol-style property across a large number of files, using the following on a Mac or *nix system should do it: find . -name '.svn' -prune -o -type f | \ xargs svn ps svn:eol-style native svn commit NOTE: The above assumes that (1) you're cd'd to the top-level dir of the plugin source and (2) that all files in the plugin are text files. (I took a quick look thru the plugin source and didn't see anything that looked like binary data. ie images, pdf, etc) ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-06-03 19:19 Message: Fixed in r2075 (hopefully) The fix was done by adding a fix_cr_lf task to the root Rakefile which now runs before every commit. No futzing with svn:eol-style should be necessary (we'd have to set it on a lot of files, not only version.rb) Someone please confirm whether this is working or not and I'll close this. ---------------------------------------------------------------------- Comment By: Rick Tessner (ricktessner) Date: 2007-06-03 17:39 Message: I'm seeing the same error about "inconsistent line ending style" on version.rb. I'd guess that it's happening on my system since I have a line in my subversion config [auto-props] section that reads *.rb = svn:eol-style=native It looks like none of the *.rb files in rspec where checked in with the svn:eol-style property set. In the event of having developers on multiple platforms (ie. *nix-style and windows), both *nix and windows style line endings can end up in a given file. Upon svn import on another system that by default trys to set the svn:eol-style to native, the mixed line-ending styles will result in the error being seen by the OP and myself. The solution would be to get the line-endings into a consistent state via a utility such as dos2unix, make sure the plugin still works, set the svn:eol-style property to "native" and commit. Hope this helps. ---------------------------------------------------------------------- Comment By: Jim Morris (wolfmanjm) Date: 2007-06-01 20:26 Message: I'm using svn, version 1.4.3 (r23084) on Ubuntu Linux Feisty. piston (1.3.3) It actually checked out ok, but the failure was on the svn add The file vendor/plugins/rspec_on_rails/lib/spec/rails/version.rb had DOS style line endings, but was inconsistent, so some \n and some \r\n When I did a dos2unix on the file it worked fine. ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-06-01 19:28 Message: I'm not experiencing this. I'm using Mac OS 10.4.9, piston 1.3.3 and svn 1.4.3. You? ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11296&group_id=797 From noreply at rubyforge.org Sun Jun 3 21:38:58 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Sun, 3 Jun 2007 21:38:58 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11296 ] svn export gives errors Message-ID: <20070604013858.EC3125240ABB@rubyforge.org> Bugs item #11296, was opened at 2007-06-01 15:47 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11296&group_id=797 Category: rails plugin Group: None Status: Closed Resolution: Accepted Priority: 3 Submitted By: Jim Morris (wolfmanjm) Assigned to: Aslak Helles?y (aslak_hellesoy) Summary: svn export gives errors Initial Comment: Trying to import via piston (svn export) there is an inconsistent line ending error... > piston import svn://rubyforge.org/var/svn/rspec/tags/CURRENT/rspec_on_rails vendor/plugins/rspec_on_rails svn: File 'vendor/plugins/rspec_on_rails/lib/spec/rails/version.rb' has inconsistent newlines svn: Inconsistent line ending style /usr/lib/ruby/gems/1.8/gems/piston-1.3.3/lib/piston/command.rb:43:in `svn': Command svn add --force --quiet vendor/plugins/rspec_on_rails resulted in an error: (RuntimeError) from /usr/lib/ruby/gems/1.8/gems/piston-1.3.3/lib/piston/commands/import.rb:50:in `run' from /usr/lib/ruby/gems/1.8/gems/piston-1.3.3/lib/transat/parser.rb:131:in `execute' from /usr/lib/ruby/gems/1.8/gems/piston-1.3.3/lib/transat/parser.rb:127:in `each' from /usr/lib/ruby/gems/1.8/gems/piston-1.3.3/lib/transat/parser.rb:127:in `execute' from /usr/lib/ruby/gems/1.8/gems/piston-1.3.3/lib/transat/parser.rb:104:in `parse_and_execute' from /usr/lib/ruby/gems/1.8/gems/piston-1.3.3/bin/piston:10 from /usr/bin/piston:16:in `load' from /usr/bin/piston:16 ---------------------------------------------------------------------- Comment By: Rick Tessner (ricktessner) Date: 2007-06-03 18:38 Message: Sorry, the fix you put in with the rake task did work. I got bit by not paying attention to my command history. I was still working with CURRENT rather than trunk. The rake task you put in place did work. ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-06-03 18:05 Message: Thanks for the heads up. I'll close this then :-) ---------------------------------------------------------------------- Comment By: Rick Tessner (ricktessner) Date: 2007-06-03 17:47 Message: Sorry, the fix you put in with the rake task did work. I got bit by not paying attention to my command history. I was still working with CURRENT rather than trunk. The rake task you put in place did work. ---------------------------------------------------------------------- Comment By: Rick Tessner (ricktessner) Date: 2007-06-03 17:39 Message: Just tried doing a "piston import" as well as a plugin install followed by "svn add" and got the same message about "inconsistent newlines" To set the svn:eol-style property across a large number of files, using the following on a Mac or *nix system should do it: find . -name '.svn' -prune -o -type f | \ xargs svn ps svn:eol-style native svn commit NOTE: The above assumes that (1) you're cd'd to the top-level dir of the plugin source and (2) that all files in the plugin are text files. (I took a quick look thru the plugin source and didn't see anything that looked like binary data. ie images, pdf, etc) ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-06-03 16:19 Message: Fixed in r2075 (hopefully) The fix was done by adding a fix_cr_lf task to the root Rakefile which now runs before every commit. No futzing with svn:eol-style should be necessary (we'd have to set it on a lot of files, not only version.rb) Someone please confirm whether this is working or not and I'll close this. ---------------------------------------------------------------------- Comment By: Rick Tessner (ricktessner) Date: 2007-06-03 14:39 Message: I'm seeing the same error about "inconsistent line ending style" on version.rb. I'd guess that it's happening on my system since I have a line in my subversion config [auto-props] section that reads *.rb = svn:eol-style=native It looks like none of the *.rb files in rspec where checked in with the svn:eol-style property set. In the event of having developers on multiple platforms (ie. *nix-style and windows), both *nix and windows style line endings can end up in a given file. Upon svn import on another system that by default trys to set the svn:eol-style to native, the mixed line-ending styles will result in the error being seen by the OP and myself. The solution would be to get the line-endings into a consistent state via a utility such as dos2unix, make sure the plugin still works, set the svn:eol-style property to "native" and commit. Hope this helps. ---------------------------------------------------------------------- Comment By: Jim Morris (wolfmanjm) Date: 2007-06-01 17:26 Message: I'm using svn, version 1.4.3 (r23084) on Ubuntu Linux Feisty. piston (1.3.3) It actually checked out ok, but the failure was on the svn add The file vendor/plugins/rspec_on_rails/lib/spec/rails/version.rb had DOS style line endings, but was inconsistent, so some \n and some \r\n When I did a dos2unix on the file it worked fine. ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-06-01 16:28 Message: I'm not experiencing this. I'm using Mac OS 10.4.9, piston 1.3.3 and svn 1.4.3. You? ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11296&group_id=797 From noreply at rubyforge.org Mon Jun 4 00:27:31 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Mon, 4 Jun 2007 00:27:31 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11337 ] autotest runs specs redundantly Message-ID: <20070604042731.543A05240B7C@rubyforge.org> Bugs item #11337, was opened at 2007-06-03 20:38 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11337&group_id=797 Category: None Group: None >Status: Closed >Resolution: Accepted Priority: 3 Submitted By: Erik Ostrom (eostrom) >Assigned to: David Chelimsky (dchelimsky) Summary: autotest runs specs redundantly Initial Comment: I'm running autotest 3.6.0 with rspec 2064 on Ruby 1.8.6 and Rails 1.2.3 on Windows XP SP2. When I have a spec with two failing examples, autotest/rspec tries to rerun the spec twice. For example, the command line might look like this: ruby script/spec -O spec/spec.opts spec/models/comment_spec.rb; ruby script/spec -O spec/spec.opts spec/models/comment_spec.rb BTW, this doesn't work on Windows, even after hacking autotest/rspec.rb to honor autotest's new command separator constant, but I think it's an autotest bug (http://rubyforge.org/tracker/index.php?func=detail&aid=11335&group_id=419&atid=1678). The point of THIS bug is, it's running the same spec twice. Or more, if there are more failing examples. I was able to fix this to my satisfaction by changing this line in make_test_cmd in autotest/rspec.rb: return cmds.join('; ') to return cmds.uniq.join('; ') It might be better to compress the set of files before generating the commands, but I don't know the right place to do that. ---------------------------------------------------------------------- >Comment By: David Chelimsky (dchelimsky) Date: 2007-06-04 04:27 Message: Actually it turns out that there is a MUCH easier approach. Fixed in r2076. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11337&group_id=797 From dan at tastapod.com Mon Jun 4 10:54:50 2007 From: dan at tastapod.com (Dan North) Date: Mon, 04 Jun 2007 15:54:50 +0100 Subject: [rspec-devel] rspec runner for eclipse In-Reply-To: <4662F2FC.3040408@raymanoz.com> References: <4662F2FC.3040408@raymanoz.com> Message-ID: <466427BA.3010109@tastapod.com> I think that would be really sweet. I currently run my "daddy" behaviour file - usually called examples.rb - as a ruby program. Eclipse makes the path names in the stack trace clickable so I can navigate to the source, but a test::unit style plugin would be great. Cheers, Dan Raymond Barlow wrote: > Hi guys, > > I'm looking at writing an rspec runner for eclipse like the jUnit and > ruby's TestUnit plugins. I think this would get rspec used a lot more. > > To do this, I'm going to use jRuby to start a ruby script that kicks off > the rspec tests. I've written a custom BehaviourRunner that basically > substitutes the @options.report for my own version. This way I can see > when the tests are starting, stopping, passing, not passing etc. The > ruby code will call back to the Java runner and communicate with an > RSpecListener. > > But, my current problem is this: How do you start an rspec test in Ruby? > i.e. not from the command line? I've been using this command line to > workout where in the ruby code to do the Java callbacks: > spec --require j_behaviour_runner.rb --runner JBehaviourRunner > bowling_spec.rb > > and now I need to do this in a ruby script so that I can start it from > jRuby. > > Comments? > > Oh, and one last (stupid!) question--is there already an eclipse runner > out there? > > Cheers! > Raymond Barlow > _______________________________________________ > rspec-devel mailing list > rspec-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-devel > From noreply at rubyforge.org Mon Jun 4 20:16:13 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Mon, 4 Jun 2007 20:16:13 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11337 ] autotest runs specs redundantly Message-ID: <20070605001613.9629852409C6@rubyforge.org> Bugs item #11337, was opened at 2007-06-03 13:38 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11337&group_id=797 Category: None Group: None Status: Closed Resolution: Accepted Priority: 3 Submitted By: Erik Ostrom (eostrom) Assigned to: David Chelimsky (dchelimsky) Summary: autotest runs specs redundantly Initial Comment: I'm running autotest 3.6.0 with rspec 2064 on Ruby 1.8.6 and Rails 1.2.3 on Windows XP SP2. When I have a spec with two failing examples, autotest/rspec tries to rerun the spec twice. For example, the command line might look like this: ruby script/spec -O spec/spec.opts spec/models/comment_spec.rb; ruby script/spec -O spec/spec.opts spec/models/comment_spec.rb BTW, this doesn't work on Windows, even after hacking autotest/rspec.rb to honor autotest's new command separator constant, but I think it's an autotest bug (http://rubyforge.org/tracker/index.php?func=detail&aid=11335&group_id=419&atid=1678). The point of THIS bug is, it's running the same spec twice. Or more, if there are more failing examples. I was able to fix this to my satisfaction by changing this line in make_test_cmd in autotest/rspec.rb: return cmds.join('; ') to return cmds.uniq.join('; ') It might be better to compress the set of files before generating the commands, but I don't know the right place to do that. ---------------------------------------------------------------------- >Comment By: Erik Ostrom (eostrom) Date: 2007-06-04 17:16 Message: And that approach solves my command separator problem, too. Thanks! ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-06-03 21:27 Message: Actually it turns out that there is a MUCH easier approach. Fixed in r2076. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11337&group_id=797 From noreply at rubyforge.org Mon Jun 4 23:15:45 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Mon, 4 Jun 2007 23:15:45 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11143 ] Views code for ActionController::Base#render broke between 1.0.0 and 1.0.3 on Rails Edge r6731 Message-ID: <20070605031546.06E8A5240B95@rubyforge.org> Bugs item #11143, was opened at 2007-05-26 00:53 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11143&group_id=797 Category: rails plugin Group: None Status: Closed Resolution: Accepted Priority: 3 Submitted By: Coda Hale (codahale) Assigned to: David Chelimsky (dchelimsky) Summary: Views code for ActionController::Base#render broke between 1.0.0 and 1.0.3 on Rails Edge r6731 Initial Comment: I just updated to Rails r6731 and RSpec 1.0.3, and all my controller specs exploded: 1) ActionView::ActionViewError in 'FavoritesController handling GET /user/1/favorites should be successful' Couldn't find template file for favorites/index in ["/Users/coda/Project/app/views"] /Users/coda/Project/vendor/plugins/rspec_on_rails/lib/spec/rails/dsl/behaviour/controller.rb:70:in `render' /Users/coda/Project/app/controllers/favorites_controller.rb:10:in `index' spec/controllers/favorites_controller_spec.rb:41:in `do_get' spec/controllers/favorites_controller_spec.rb:45: spec/controllers/favorites_controller_spec.rb:31: The view is in app/views/favorites/index.html.erb, and the call to render it is just the default: respond_to do |format| format.html # index.html.erb end The code works fine in development -- renders the right view and everything. This code used to pass with an older revision of Edge and RSpec 1.0.0, and I noticed that Spec::Rails::DSL::ControllerInstanceMethods#render has changed. ---------------------------------------------------------------------- Comment By: Timothy Bennett (lanaer) Date: 2007-06-04 20:15 Message: A somewhat cleaner way to fix it is to add define_method :full_template_path do "fake path generated by rspec" end to ControllerInstanceMethods::render (along side all those other define_methods) ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-05-26 11:23 Message: Fixed in r2041. The problem was two-fold. We recently removed the implicit re-raising (using rescue_action) of errors in controller examples to fix another bug. This had the unfortunate side effect of hiding errors. Additionally, there was a change in rails that caused rspec to fall down in controller examples with isolated views. The rescue_action issue is now resolved by adding a method available in controller examples named "raise_controller_errors". This gets called from the generated spec_helper: config.before(:each, :behaviour_type => :controller) do raise_controller_errors end The render problem is resolved by overriding render_file instead of render_template in Spec::Rails::DSL::ControllerInstanceMethods#render. ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-05-26 08:21 Message: No - that was wrong. Working on it though. ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-05-26 08:01 Message: Making some progress. I was able to duplicate this by defining rescue_action. It turns out that this is due to a change in rails, not the changes in RSpec. Spec::Rails::DSL::ControllerInstanceMethods#render is never being called in the example I've got failing!!!! Still looking. ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-05-26 07:49 Message: Coda, can you post the spec please? I'm not able to reproduce this error. ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-05-26 03:06 Message: David, this is what I mentioned the other day. I haven't found a solution yet. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11143&group_id=797 From noreply at rubyforge.org Tue Jun 5 02:30:55 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Tue, 5 Jun 2007 02:30:55 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11223 ] Unable to access flash from rails helper specs Message-ID: <20070605063055.0C6985240BC1@rubyforge.org> Bugs item #11223, was opened at 2007-05-30 01:07 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11223&group_id=797 Category: rails plugin Group: None Status: Open Resolution: None Priority: 3 Submitted By: Josh Knowles (joshknowles) Assigned to: Nobody (None) Summary: Unable to access flash from rails helper specs Initial Comment: The changes made with changeset 2044 to fix issue 11137 appear to have broken the ability to access the flash from helper specs (unless I'm doing something completely wrong...). While I haven't had time to investigate the internals of the TestResponse logic I have attached a failing helper spec (spec/helpers) for the time being. ---------------------------------------------------------------------- Comment By: Jim Morris (wolfmanjm) Date: 2007-06-04 23:30 Message: I'm using the current release of RSpec 1.0.4 and I cannot access the flash from a helper spec test either. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11223&group_id=797 From noreply at rubyforge.org Tue Jun 5 08:04:06 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Tue, 5 Jun 2007 08:04:06 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11223 ] Unable to access flash from rails helper specs Message-ID: <20070605120406.6832F5240A30@rubyforge.org> Bugs item #11223, was opened at 2007-05-30 08:07 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11223&group_id=797 Category: rails plugin Group: None Status: Open Resolution: None Priority: 3 Submitted By: Josh Knowles (joshknowles) Assigned to: Nobody (None) Summary: Unable to access flash from rails helper specs Initial Comment: The changes made with changeset 2044 to fix issue 11137 appear to have broken the ability to access the flash from helper specs (unless I'm doing something completely wrong...). While I haven't had time to investigate the internals of the TestResponse logic I have attached a failing helper spec (spec/helpers) for the time being. ---------------------------------------------------------------------- >Comment By: David Chelimsky (dchelimsky) Date: 2007-06-05 12:04 Message: Josh - thanks for pointing right to the revision that broke this! That helped a lot. Fixed in r2078. ---------------------------------------------------------------------- Comment By: Jim Morris (wolfmanjm) Date: 2007-06-05 06:30 Message: I'm using the current release of RSpec 1.0.4 and I cannot access the flash from a helper spec test either. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11223&group_id=797 From noreply at rubyforge.org Tue Jun 5 08:04:22 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Tue, 5 Jun 2007 08:04:22 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11223 ] Unable to access flash from rails helper specs Message-ID: <20070605120422.52C315240A30@rubyforge.org> Bugs item #11223, was opened at 2007-05-30 08:07 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11223&group_id=797 Category: rails plugin Group: None >Status: Closed >Resolution: Accepted Priority: 3 Submitted By: Josh Knowles (joshknowles) >Assigned to: David Chelimsky (dchelimsky) Summary: Unable to access flash from rails helper specs Initial Comment: The changes made with changeset 2044 to fix issue 11137 appear to have broken the ability to access the flash from helper specs (unless I'm doing something completely wrong...). While I haven't had time to investigate the internals of the TestResponse logic I have attached a failing helper spec (spec/helpers) for the time being. ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-06-05 12:04 Message: Josh - thanks for pointing right to the revision that broke this! That helped a lot. Fixed in r2078. ---------------------------------------------------------------------- Comment By: Jim Morris (wolfmanjm) Date: 2007-06-05 06:30 Message: I'm using the current release of RSpec 1.0.4 and I cannot access the flash from a helper spec test either. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11223&group_id=797 From noreply at rubyforge.org Tue Jun 5 08:52:30 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Tue, 5 Jun 2007 08:52:30 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-10534 ] Windows: undefined method `controller_name' Message-ID: <20070605125230.3CC1D5240A23@rubyforge.org> Bugs item #10534, was opened at 2007-05-02 23:52 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=10534&group_id=797 Category: None Group: None Status: Open Resolution: None Priority: 3 Submitted By: Larry Kluger (larrykluger) Assigned to: Nobody (None) Summary: Windows: undefined method `controller_name' Initial Comment: Running 0.9.1 on windows -- (InstantRails with updated rails and other gems) gives following trace (below). I have updated to all the latest gems and plugins as of today, May 2, 07. The exact same svn tree on Linux works fine for rake spec I think something is not requiring the right modules due to Window's back slashes. Regards, LarryK ~~~~~~~~~~~~~~~ Trace followed by list of installed gems > rake spec C:/instant_rails_1.7/InstantRails/ruby/lib/ruby/gems/1.8/gems/rspec-0.9.1/lib/spec/dsl/behaviour_eval.rb:95:in `method_missing': undefined method `controller_name' for # (NoMethodError) from ./spec/controllers/session_controller_spec.rb:4 from C:/instant_rails_1.7/InstantRails/ruby/lib/ruby/gems/1.8/gems/rspec-0.9.1/lib/spec/dsl/ behaviour.rb:47:in `class_eval' from C:/instant_rails_1.7/InstantRails/ruby/lib/ruby/gems/1.8/gems/rspec-0.9.1/lib/spec/dsl/ behaviour.rb:47:in `eval_behaviour' from C:/instant_rails_1.7/InstantRails/ruby/lib/ruby/gems/1.8/gems/rspec-0.9.1/lib/spec/dsl/ behaviour.rb:29:in `initialize' from C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec_on_rails/lib/spec /dsl/behaviour_factory.rb:43:in `new' from C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec_on_rails/lib/spec /dsl/behaviour_factory.rb:43:in `create' from C:/instant_rails_1.7/InstantRails/ruby/lib/ruby/gems/1.8/gems/rspec-0.9.1/lib/spec/runn er/extensions/kernel.rb:4:in `context' from ./spec/controllers/session_controller_spec.rb:3 ... 14 levels... from C:/instant_rails_1.7/InstantRails/ruby/lib/ruby/gems/1.8/gems/rspec-0.9.1/lib/spec/runn er/option_parser.rb:261:in `parse' from C:/instant_rails_1.7/InstantRails/ruby/lib/ruby/gems/1.8/gems/rspec-0.9.1/lib/spec/runn er/option_parser.rb:28:in `create_behaviour_runner' from C:/instant_rails_1.7/InstantRails/ruby/lib/ruby/gems/1.8/gems/rspec-0.9.1/lib/spec/runn er/command_line.rb:14:in `run' from C:/instant_rails_1.7/InstantRails/ruby/lib/ruby/gems/1.8/gems/rspec-0.9.1/bin/spec:3 rake aborted! Command ruby -I"C:/instant_rails_1.7/InstantRails/ruby/lib/ruby/gems/1.8/gems/rspec-0.9.1/lib" "C:/i nstant_rails_1.7/InstantRails/ruby/lib/ruby/gems/1.8/gems/rspec-0.9.1/bin/spec" "spec/controllers/se ssion_controller_spec.rb" "spec/controllers/users_controller_spec.rb" "spec/controllers/user_assets_ controller_spec.rb" "spec/helpers/user_assets_helper_spec.rb" "spec/helpers/user_assets_url_helpers_ spec.rb" "spec/models/asset_spec.rb" "spec/models/authenticated_base_spec.rb" "spec/models/user_spec .rb" "spec/views/assets/edit_rhtml_spec.rb" "spec/views/assets/index_rhtml_spec.rb" "spec/views/asse ts/new_rhtml_spec.rb" "spec/views/assets/show_rhtml_spec.rb" "spec/views/users/edit_rhtml_spec.rb" " spec/views/users/index_rhtml_spec.rb" "spec/views/users/new_rhtml_spec.rb" "spec/views/users/show_rh tml_spec.rb" --options "C:/instant_rails_1.7/InstantRails/rails_apps/am2/config/../spec/spec.opts" failed C:\instant_rails_1.7\InstantRails\rails_apps\am2>gem list --local *** LOCAL GEMS *** actionmailer (1.3.3) Service layer for easy email delivery and testing. actionpack (1.13.3) Web-flow and rendering framework putting the VC in MVC. actionwebservice (1.2.3) Web service support for Action Pack. activerecord (1.15.3) Implements the ActiveRecord pattern for ORM. activesupport (1.4.2) Support and utility classes used by the Rails framework. capistrano (1.4.1) Capistrano is a framework and utility for executing commands in parallel on multiple remote machines, via SSH. The primary goal is to simplify and automate the deployment of web applications. cgi_multipart_eof_fix (2.1) Fix an exploitable bug in CGI multipart parsing which affects Ruby <= 1.8.5 when multipart boundary attribute contains a non-halting regular expression string. cmdparse (2.0.2) Advanced command line parser supporting commands fxri (0.3.6) Graphical interface to the RI documentation, with search engine. fxruby (1.6.6) FXRuby is the Ruby binding to the FOX GUI toolkit. gem_plugin (0.2.2) A plugin system based only on rubygems that uses dependencies only highline (1.2.7) HighLine is a high-level command-line IO library. hpricot (0.4) a swift, liberal HTML parser with a fantastic library log4r (1.0.5) Log4r is a comprehensive and flexible logging library for Ruby. mongrel (1.0.1) A small fast HTTP library and server that runs Rails, Camping, Nitro and Iowa apps. mongrel_cluster (0.2.1) Mongrel plugin that provides commands and Capistrano tasks for managing multiple Mongrel processes. mysql (2.7.3) A win32-native build of the MySQL API module for Ruby. needle (1.3.0) Needle is a Dependency Injection/Inversion of Control container for Ruby. It supports both type-2 (setter) and type-3 (constructor) injection. It takes advantage of the dynamic nature of Ruby to provide a rich and flexible approach to injecting dependencies. net-sftp (1.1.0) Net::SFTP is a pure-Ruby implementation of the SFTP client protocol. net-ssh (1.0.10) Net::SSH is a pure-Ruby implementation of the SSH2 client protocol. piston (1.3.3) Piston is a utility that enables merge tracking of remote repositories. rails (1.2.3) Web-application framework with template engine, control-flow layer, and ORM. rake (0.7.2) Ruby based make-like utility. rcov (0.8.0.2) Code coverage analysis tool for Ruby rmagick (1.14.1) RMagick is an interface between the Ruby programming language and the ImageMagick and GraphicsMagick image processing libraries. rspec (0.9.1, 0.8.2) RSpec-0.9.1 (r1880) - BDD for Ruby http://rspec.rubyforge.org/ sources (0.0.1) This package provides download sources for remote gem installation win32-clipboard (0.4.1) A package for interacting with the Windows clipboard win32-dir (0.3.1) Extra constants and methods for the Dir class on Windows. win32-eventlog (0.4.3) Interface for the MS Windows Event Log. win32-file (0.5.3) Extra or redefined methods for the File class on Windows. win32-file-stat (1.2.3) A File::Stat class tailored to MS Windows win32-process (0.5.1) Adds fork, wait, wait2, waitpid, waitpid2 and a special kill method win32-sapi (0.1.3) An interface to the MS SAPI (Sound API) library. win32-sound (0.4.0) A package for playing with sound on Windows. win32console (1.0.8) A library giving the Win32 console ANSI escape sequence support. windows-pr (0.6.2) Windows functions and constants predefined via Win32API ---------------------------------------------------------------------- >Comment By: David Chelimsky (dchelimsky) Date: 2007-06-05 12:52 Message: Larry - things have moved around a bit since this was raised. Are you still experiencing the same thing with 1.0.x? ---------------------------------------------------------------------- Comment By: Larry Kluger (larrykluger) Date: 2007-05-10 01:20 Message: Hi David, nil seems a bit boring. Please let me know how I can further help track this down. I'm at your service. Larry Source: def create(*args, &block) opts = Hash === args.last ? args.last : {} require 'pp' puts pp(opts) if opts[:shared] key = :default .... result: C:\instant_rails_1.7\InstantRails\rails_apps\am2>ruby script/spec spec/controllers/session_controlle r_spec.rb /config/../vendor/plugins/acts_as_wizard/lib/wizard_setup_filter.rb:2) {} nil C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec/lib/spec/dsl/behaviour_eval.rb:95:in `method_missing': undefined method `controller_name' for # (NoMethodError) from ./spec/controllers/session_controller_spec.rb:6 from C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec/lib/spec/dsl/behaviour.rb:47:in `class_eval' .... ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-05-09 22:44 Message: Hi Larry - what I'm looking for is not the args, but the options: puts opts.inspect or puts pp(opts) Thanks ---------------------------------------------------------------------- Comment By: Larry Kluger (larrykluger) Date: 2007-05-06 20:22 Message: Hi, I changed behaviour_factory.rb to be: def create(*args, &block) opts = Hash === args.last ? args.last : {} require 'pp' puts pp(args) if opts[:shared] .... Here is the output: ["/session/new GET"] nil C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec/lib/spec/dsl/behaviour_eval.rb :95:in `method_missing': undefined method `controller_name' for # ( NoMethodError) .... Larry ---------------------------------------------------------------------- Comment By: Larry Kluger (larrykluger) Date: 2007-05-06 20:13 Message: Hi David, I've deleted the rspec gem and plugin. I then installed ver 0.9.3 as plugins per the installation instructions. I added the puts as requested the result was nil, see trace. Aslak, where do I put the lines describe MyController, :behaviour_type => :controller do end ? I tried describe "SessionController", :behaviour_type => :controller do end just after the require statement in my session_controller_spec.rb but received the same problem. Thank you for your help and time on this puzzler. Larry C:\instant_rails_1.7\InstantRails\rails_apps\am2>ruby script/spec spec/controllers/session_controller_spec.rb nil C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec/lib/spec/dsl/behaviour_eval.rb:95:in `method_missing': undefined method `controller_name' for # (NoMethodError) from ./spec/controllers/session_controller_spec.rb:4 from C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec/lib/spec/dsl/behaviour.rb:47:in `class_eval' from C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec/lib/spec/dsl/behaviour.rb:47:in `eval_behaviour' from C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec/lib/spec/dsl/behaviour.rb:29:in `initialize' from C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec_on_rails/lib/spec/dsl/behaviour_factory.rb:44:in `new' from C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec_on_rails/lib/spec/dsl/behaviour_factory.rb:44:in `create' from C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec/lib/spec/runner/extensions/kernel.rb:4:in `context' from ./spec/controllers/session_controller_spec.rb:3 from C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec/lib/spec/runner/behaviour_runner.rb:85:in `load' from C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec/lib/spec/runner/behaviour_runner.rb:85:in `load_specs' from C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec/lib/spec/runner/behaviour_runner.rb:84:in `each' from C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec/lib/spec/runner/behaviour_runner.rb:84:in `load_specs' from C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec/lib/spec/runner/behaviour_runner.rb:22:in `run' from C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec/lib/spec/runner/command_line.rb:17:in `run' from script/spec:4 C:\instant_rails_1.7\InstantRails\rails_apps\am2> ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-05-06 11:52 Message: "However, I think maybe the call to caller might yield slightly different values on Windows and Linux/OS X." Now THAT would make sense. Larry, would you kindly apply the patch below, run `script/spec spec/controllers/session_controller_spec.rb` and show us the output? Thanks Index: rspec_on_rails/lib/spec/dsl/behaviour_factory.rb =================================================================== --- rspec_on_rails/lib/spec/dsl/behaviour_factory.rb (revision 1893) +++ rspec_on_rails/lib/spec/dsl/behaviour_factory.rb (working copy) @@ -31,6 +31,7 @@ # describe "name", :behaviour_type => :view ... def create(*args, &block) opts = Hash === args.last ? args.last : {} + puts opts[:spec_path] if opts[:shared] key = :default elsif opts[:behaviour_type] ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-05-06 11:44 Message: There shouldn't be any need to support Windows style paths with \. Ruby will always report forward slashes for paths, even on Windows. I don't think Regexp support is different on Windows either, that would never slip through the Ruby community. However, I think maybe the call to caller might yield slightly different values on Windows and Linux/OS X. ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-05-06 11:12 Message: Here's the regexp used to determine the path: /spec(\/|\)+(view|helper|controller|model)s/ The (\/|\) is there to support /unix/style and \windows\style paths. This used be to expressed in 4 separate regexps and this release merged them into one. The specs that describe windows style paths still pass, but I'm running them on *nix. Could there be a difference in the way windows is handling regexps? Also, please try this one windows as well: script/spec spec/controllers/session_controller_spec.rb and let us know if you get the same result. Thanks, David ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-05-06 10:24 Message: I think the source of this bug is in rspec_on_rails/lib/spec/rails/extensions/kernel.rb This is where Spec::Rails tries to guess what kind of spec this is. Perhaps this behaves differently on windows? Could you investigate this please? ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-05-06 10:10 Message: Hint: Spec::Rails mixes in different modules for specs depending on whether it thinks it is a model spec, controller spec, view spec or helper spec. Your error tells me that the controller mixin wasn't included. RSpec decides what to mix in by looking at the folder of your spec. If it's under spec/controllers this should happen automatically (and apparently this is buggy on windows). Just to verify this theory (and work around it until a fix has been committed), you could try to be explicit about it: describe MyController, :behaviour_type => :controller do end ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=10534&group_id=797 From webs.dev at gmail.com Tue Jun 5 10:23:06 2007 From: webs.dev at gmail.com (greg weber) Date: Tue, 5 Jun 2007 09:23:06 -0500 Subject: [rspec-devel] in source unit testing Message-ID: After spending a little time programming in D (which has built-in support for unittests and contracts), I got to like placing unittests directly in the source code instead of in a seperate file. I have created a similiar implementation that uses rspec. This is especially nice for testing module functions or class methods- methods that do not maintain state, and thus do not require different context setups, or classes that have very minimal state. It can also be nice to use when first starting to code. To use, simply surround the rspec 'it' method in a unittest{} block. The unittest block will only be ran when using rspec. The context is automatically recorded as self, and the method is automatically recorded as part of the specification. require 'unittest' module Query def Query.compile_queries( queries ) ('(?:' << queries.join(')|(?:') << ')').map { |q| Regexp.compile q } end unittest{ it "should compile regular expressions" do compile_queries(["foo"]).should == [/(?:foo)/] compile_queries(["foo","BAR"]).should == [/(?:foo)|(?:BAR)/] end } end The output from spec -f s Query - compile_queries should compile regular expressions For distribution of the file without the unittest dependency: begin require "unittest" rescue LoadError # for sure no unit testing def unittest; end end Is there interest in adding this to rspec? Attached is the implementation code. -Greg Weber -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/rspec-devel/attachments/20070605/c9a4da56/attachment.html -------------- next part -------------- A non-text attachment was scrubbed... Name: unittester.rb Type: application/x-ruby Size: 2258 bytes Desc: not available Url : http://rubyforge.org/pipermail/rspec-devel/attachments/20070605/c9a4da56/attachment.bin From noreply at rubyforge.org Tue Jun 5 18:00:36 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Tue, 5 Jun 2007 18:00:36 -0400 (EDT) Subject: [rspec-devel] [ rspec-Feature Requests-10814 ] Runner loads shared code, test cases require them again Message-ID: <20070605220036.E81F05240A4C@rubyforge.org> Feature Requests item #10814, was opened at 2007-05-13 19:03 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3152&aid=10814&group_id=797 Category: runner / command line Group: None Status: Closed Priority: 3 Submitted By: Assaf Arkin (assaf) Assigned to: David Chelimsky (dchelimsky) Summary: Runner loads shared code, test cases require them again Initial Comment: Our test directory contains one file that provides methods and behaviores shared by all other test files. To run individual files, each one requires that shared file. However, when running spec test, RSpec loads all the files from the test directory (and its sub-directories). So the file gets loaded once (by RSpec) and required once (by the test files), and interpreted twice (by Ruby). Some of the code doesn't like that. The current workaround is to detect the second load and ignore it (e.g. unless defined?(SomeConst)). But given the amount of time it took to find the culprit and work around it, can RSpec require the file instead, or allow a directory of shared behaviors not loaded by default? ---------------------------------------------------------------------- Comment By: Patrick Ritchie (pritchie) Date: 2007-06-05 18:00 Message: Reason: load is required for spec_server (drb) to work correctly. If we use require the behaviours only get checked on the first run of a given spec file. On subsequent runs we get the behaviours don't get loaded causing this problem: http://rubyforge.org/pipermail/rspec-users/2007-May/001633.html ---------------------------------------------------------------------- Comment By: Assaf Arkin (assaf) Date: 2007-05-16 01:00 Message: Thanks! Assaf ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-05-15 23:35 Message: No reason. Fixed in r1958. ---------------------------------------------------------------------- Comment By: Assaf Arkin (assaf) Date: 2007-05-15 22:21 Message: More pain than it's worth. I'm going to have to explain to every developer how to properly run the test cases, they're of course not going to RTFM, so their first attempt will fail miserably. And with each project deciding to exclude a different file ... Is there a particular reason for RSpec to use load instead of require? ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-05-15 20:35 Message: How about an "exclude" command line option? spec spec --exclude spec/shared.rb ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3152&aid=10814&group_id=797 From noreply at rubyforge.org Tue Jun 5 18:16:04 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Tue, 5 Jun 2007 18:16:04 -0400 (EDT) Subject: [rspec-devel] [ rspec-Feature Requests-10814 ] Runner loads shared code, test cases require them again Message-ID: <20070605221605.065865240A58@rubyforge.org> Feature Requests item #10814, was opened at 2007-05-13 23:03 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3152&aid=10814&group_id=797 Category: runner / command line Group: None >Status: Open Priority: 3 Submitted By: Assaf Arkin (assaf) Assigned to: David Chelimsky (dchelimsky) Summary: Runner loads shared code, test cases require them again Initial Comment: Our test directory contains one file that provides methods and behaviores shared by all other test files. To run individual files, each one requires that shared file. However, when running spec test, RSpec loads all the files from the test directory (and its sub-directories). So the file gets loaded once (by RSpec) and required once (by the test files), and interpreted twice (by Ruby). Some of the code doesn't like that. The current workaround is to detect the second load and ignore it (e.g. unless defined?(SomeConst)). But given the amount of time it took to find the culprit and work around it, can RSpec require the file instead, or allow a directory of shared behaviors not loaded by default? ---------------------------------------------------------------------- >Comment By: David Chelimsky (dchelimsky) Date: 2007-06-05 22:16 Message: Unfortunately, I'm going to have to revert this - this fix broke drb. We'll have to find a different solution. ---------------------------------------------------------------------- Comment By: Patrick Ritchie (pritchie) Date: 2007-06-05 22:00 Message: Reason: load is required for spec_server (drb) to work correctly. If we use require the behaviours only get checked on the first run of a given spec file. On subsequent runs we get the behaviours don't get loaded causing this problem: http://rubyforge.org/pipermail/rspec-users/2007-May/001633.html ---------------------------------------------------------------------- Comment By: Assaf Arkin (assaf) Date: 2007-05-16 05:00 Message: Thanks! Assaf ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-05-16 03:35 Message: No reason. Fixed in r1958. ---------------------------------------------------------------------- Comment By: Assaf Arkin (assaf) Date: 2007-05-16 02:21 Message: More pain than it's worth. I'm going to have to explain to every developer how to properly run the test cases, they're of course not going to RTFM, so their first attempt will fail miserably. And with each project deciding to exclude a different file ... Is there a particular reason for RSpec to use load instead of require? ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-05-16 00:35 Message: How about an "exclude" command line option? spec spec --exclude spec/shared.rb ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3152&aid=10814&group_id=797 From noreply at rubyforge.org Tue Jun 5 18:33:55 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Tue, 5 Jun 2007 18:33:55 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11378 ] fix to 10814 broke drb Message-ID: <20070605223355.9F1D65240A51@rubyforge.org> Bugs item #11378, was opened at 2007-06-05 22:33 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11378&group_id=797 Category: None Group: None Status: Open Resolution: None Priority: 3 Submitted By: David Chelimsky (dchelimsky) Assigned to: David Chelimsky (dchelimsky) Summary: fix to 10814 broke drb Initial Comment: http://rubyforge.org/tracker/?func=detail&atid=3152&aid=10814&group_id=797 ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11378&group_id=797 From noreply at rubyforge.org Tue Jun 5 18:36:43 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Tue, 5 Jun 2007 18:36:43 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11378 ] fix to 10814 broke drb Message-ID: <20070605223643.71B6A5240A51@rubyforge.org> Bugs item #11378, was opened at 2007-06-05 22:33 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11378&group_id=797 Category: None Group: None >Status: Closed >Resolution: Accepted Priority: 3 Submitted By: David Chelimsky (dchelimsky) Assigned to: David Chelimsky (dchelimsky) Summary: fix to 10814 broke drb Initial Comment: http://rubyforge.org/tracker/?func=detail&atid=3152&aid=10814&group_id=797 ---------------------------------------------------------------------- >Comment By: David Chelimsky (dchelimsky) Date: 2007-06-05 22:36 Message: Fixed in r2081 Changed behaviour_runner to load files rather than require them so that drb would work. Note that this leaves http://rubyforge.org/tracker/?func=detail&atid=3152&aid=10814&group_id=797 open and needing a new solution. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11378&group_id=797 From noreply at rubyforge.org Tue Jun 5 18:49:56 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Tue, 5 Jun 2007 18:49:56 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-10534 ] Windows: undefined method `controller_name' Message-ID: <20070605224957.1BB08A970002@rubyforge.org> Bugs item #10534, was opened at 2007-05-02 19:52 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=10534&group_id=797 Category: None Group: None Status: Open Resolution: None Priority: 3 Submitted By: Larry Kluger (larrykluger) Assigned to: Nobody (None) Summary: Windows: undefined method `controller_name' Initial Comment: Running 0.9.1 on windows -- (InstantRails with updated rails and other gems) gives following trace (below). I have updated to all the latest gems and plugins as of today, May 2, 07. The exact same svn tree on Linux works fine for rake spec I think something is not requiring the right modules due to Window's back slashes. Regards, LarryK ~~~~~~~~~~~~~~~ Trace followed by list of installed gems > rake spec C:/instant_rails_1.7/InstantRails/ruby/lib/ruby/gems/1.8/gems/rspec-0.9.1/lib/spec/dsl/behaviour_eval.rb:95:in `method_missing': undefined method `controller_name' for # (NoMethodError) from ./spec/controllers/session_controller_spec.rb:4 from C:/instant_rails_1.7/InstantRails/ruby/lib/ruby/gems/1.8/gems/rspec-0.9.1/lib/spec/dsl/ behaviour.rb:47:in `class_eval' from C:/instant_rails_1.7/InstantRails/ruby/lib/ruby/gems/1.8/gems/rspec-0.9.1/lib/spec/dsl/ behaviour.rb:47:in `eval_behaviour' from C:/instant_rails_1.7/InstantRails/ruby/lib/ruby/gems/1.8/gems/rspec-0.9.1/lib/spec/dsl/ behaviour.rb:29:in `initialize' from C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec_on_rails/lib/spec /dsl/behaviour_factory.rb:43:in `new' from C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec_on_rails/lib/spec /dsl/behaviour_factory.rb:43:in `create' from C:/instant_rails_1.7/InstantRails/ruby/lib/ruby/gems/1.8/gems/rspec-0.9.1/lib/spec/runn er/extensions/kernel.rb:4:in `context' from ./spec/controllers/session_controller_spec.rb:3 ... 14 levels... from C:/instant_rails_1.7/InstantRails/ruby/lib/ruby/gems/1.8/gems/rspec-0.9.1/lib/spec/runn er/option_parser.rb:261:in `parse' from C:/instant_rails_1.7/InstantRails/ruby/lib/ruby/gems/1.8/gems/rspec-0.9.1/lib/spec/runn er/option_parser.rb:28:in `create_behaviour_runner' from C:/instant_rails_1.7/InstantRails/ruby/lib/ruby/gems/1.8/gems/rspec-0.9.1/lib/spec/runn er/command_line.rb:14:in `run' from C:/instant_rails_1.7/InstantRails/ruby/lib/ruby/gems/1.8/gems/rspec-0.9.1/bin/spec:3 rake aborted! Command ruby -I"C:/instant_rails_1.7/InstantRails/ruby/lib/ruby/gems/1.8/gems/rspec-0.9.1/lib" "C:/i nstant_rails_1.7/InstantRails/ruby/lib/ruby/gems/1.8/gems/rspec-0.9.1/bin/spec" "spec/controllers/se ssion_controller_spec.rb" "spec/controllers/users_controller_spec.rb" "spec/controllers/user_assets_ controller_spec.rb" "spec/helpers/user_assets_helper_spec.rb" "spec/helpers/user_assets_url_helpers_ spec.rb" "spec/models/asset_spec.rb" "spec/models/authenticated_base_spec.rb" "spec/models/user_spec .rb" "spec/views/assets/edit_rhtml_spec.rb" "spec/views/assets/index_rhtml_spec.rb" "spec/views/asse ts/new_rhtml_spec.rb" "spec/views/assets/show_rhtml_spec.rb" "spec/views/users/edit_rhtml_spec.rb" " spec/views/users/index_rhtml_spec.rb" "spec/views/users/new_rhtml_spec.rb" "spec/views/users/show_rh tml_spec.rb" --options "C:/instant_rails_1.7/InstantRails/rails_apps/am2/config/../spec/spec.opts" failed C:\instant_rails_1.7\InstantRails\rails_apps\am2>gem list --local *** LOCAL GEMS *** actionmailer (1.3.3) Service layer for easy email delivery and testing. actionpack (1.13.3) Web-flow and rendering framework putting the VC in MVC. actionwebservice (1.2.3) Web service support for Action Pack. activerecord (1.15.3) Implements the ActiveRecord pattern for ORM. activesupport (1.4.2) Support and utility classes used by the Rails framework. capistrano (1.4.1) Capistrano is a framework and utility for executing commands in parallel on multiple remote machines, via SSH. The primary goal is to simplify and automate the deployment of web applications. cgi_multipart_eof_fix (2.1) Fix an exploitable bug in CGI multipart parsing which affects Ruby <= 1.8.5 when multipart boundary attribute contains a non-halting regular expression string. cmdparse (2.0.2) Advanced command line parser supporting commands fxri (0.3.6) Graphical interface to the RI documentation, with search engine. fxruby (1.6.6) FXRuby is the Ruby binding to the FOX GUI toolkit. gem_plugin (0.2.2) A plugin system based only on rubygems that uses dependencies only highline (1.2.7) HighLine is a high-level command-line IO library. hpricot (0.4) a swift, liberal HTML parser with a fantastic library log4r (1.0.5) Log4r is a comprehensive and flexible logging library for Ruby. mongrel (1.0.1) A small fast HTTP library and server that runs Rails, Camping, Nitro and Iowa apps. mongrel_cluster (0.2.1) Mongrel plugin that provides commands and Capistrano tasks for managing multiple Mongrel processes. mysql (2.7.3) A win32-native build of the MySQL API module for Ruby. needle (1.3.0) Needle is a Dependency Injection/Inversion of Control container for Ruby. It supports both type-2 (setter) and type-3 (constructor) injection. It takes advantage of the dynamic nature of Ruby to provide a rich and flexible approach to injecting dependencies. net-sftp (1.1.0) Net::SFTP is a pure-Ruby implementation of the SFTP client protocol. net-ssh (1.0.10) Net::SSH is a pure-Ruby implementation of the SSH2 client protocol. piston (1.3.3) Piston is a utility that enables merge tracking of remote repositories. rails (1.2.3) Web-application framework with template engine, control-flow layer, and ORM. rake (0.7.2) Ruby based make-like utility. rcov (0.8.0.2) Code coverage analysis tool for Ruby rmagick (1.14.1) RMagick is an interface between the Ruby programming language and the ImageMagick and GraphicsMagick image processing libraries. rspec (0.9.1, 0.8.2) RSpec-0.9.1 (r1880) - BDD for Ruby http://rspec.rubyforge.org/ sources (0.0.1) This package provides download sources for remote gem installation win32-clipboard (0.4.1) A package for interacting with the Windows clipboard win32-dir (0.3.1) Extra constants and methods for the Dir class on Windows. win32-eventlog (0.4.3) Interface for the MS Windows Event Log. win32-file (0.5.3) Extra or redefined methods for the File class on Windows. win32-file-stat (1.2.3) A File::Stat class tailored to MS Windows win32-process (0.5.1) Adds fork, wait, wait2, waitpid, waitpid2 and a special kill method win32-sapi (0.1.3) An interface to the MS SAPI (Sound API) library. win32-sound (0.4.0) A package for playing with sound on Windows. win32console (1.0.8) A library giving the Win32 console ANSI escape sequence support. windows-pr (0.6.2) Windows functions and constants predefined via Win32API ---------------------------------------------------------------------- >Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-06-05 18:49 Message: And what's the file path of the spec? ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-06-05 08:52 Message: Larry - things have moved around a bit since this was raised. Are you still experiencing the same thing with 1.0.x? ---------------------------------------------------------------------- Comment By: Larry Kluger (larrykluger) Date: 2007-05-09 21:20 Message: Hi David, nil seems a bit boring. Please let me know how I can further help track this down. I'm at your service. Larry Source: def create(*args, &block) opts = Hash === args.last ? args.last : {} require 'pp' puts pp(opts) if opts[:shared] key = :default .... result: C:\instant_rails_1.7\InstantRails\rails_apps\am2>ruby script/spec spec/controllers/session_controlle r_spec.rb /config/../vendor/plugins/acts_as_wizard/lib/wizard_setup_filter.rb:2) {} nil C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec/lib/spec/dsl/behaviour_eval.rb:95:in `method_missing': undefined method `controller_name' for # (NoMethodError) from ./spec/controllers/session_controller_spec.rb:6 from C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec/lib/spec/dsl/behaviour.rb:47:in `class_eval' .... ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-05-09 18:44 Message: Hi Larry - what I'm looking for is not the args, but the options: puts opts.inspect or puts pp(opts) Thanks ---------------------------------------------------------------------- Comment By: Larry Kluger (larrykluger) Date: 2007-05-06 16:22 Message: Hi, I changed behaviour_factory.rb to be: def create(*args, &block) opts = Hash === args.last ? args.last : {} require 'pp' puts pp(args) if opts[:shared] .... Here is the output: ["/session/new GET"] nil C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec/lib/spec/dsl/behaviour_eval.rb :95:in `method_missing': undefined method `controller_name' for # ( NoMethodError) .... Larry ---------------------------------------------------------------------- Comment By: Larry Kluger (larrykluger) Date: 2007-05-06 16:13 Message: Hi David, I've deleted the rspec gem and plugin. I then installed ver 0.9.3 as plugins per the installation instructions. I added the puts as requested the result was nil, see trace. Aslak, where do I put the lines describe MyController, :behaviour_type => :controller do end ? I tried describe "SessionController", :behaviour_type => :controller do end just after the require statement in my session_controller_spec.rb but received the same problem. Thank you for your help and time on this puzzler. Larry C:\instant_rails_1.7\InstantRails\rails_apps\am2>ruby script/spec spec/controllers/session_controller_spec.rb nil C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec/lib/spec/dsl/behaviour_eval.rb:95:in `method_missing': undefined method `controller_name' for # (NoMethodError) from ./spec/controllers/session_controller_spec.rb:4 from C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec/lib/spec/dsl/behaviour.rb:47:in `class_eval' from C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec/lib/spec/dsl/behaviour.rb:47:in `eval_behaviour' from C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec/lib/spec/dsl/behaviour.rb:29:in `initialize' from C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec_on_rails/lib/spec/dsl/behaviour_factory.rb:44:in `new' from C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec_on_rails/lib/spec/dsl/behaviour_factory.rb:44:in `create' from C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec/lib/spec/runner/extensions/kernel.rb:4:in `context' from ./spec/controllers/session_controller_spec.rb:3 from C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec/lib/spec/runner/behaviour_runner.rb:85:in `load' from C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec/lib/spec/runner/behaviour_runner.rb:85:in `load_specs' from C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec/lib/spec/runner/behaviour_runner.rb:84:in `each' from C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec/lib/spec/runner/behaviour_runner.rb:84:in `load_specs' from C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec/lib/spec/runner/behaviour_runner.rb:22:in `run' from C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec/lib/spec/runner/command_line.rb:17:in `run' from script/spec:4 C:\instant_rails_1.7\InstantRails\rails_apps\am2> ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-05-06 07:52 Message: "However, I think maybe the call to caller might yield slightly different values on Windows and Linux/OS X." Now THAT would make sense. Larry, would you kindly apply the patch below, run `script/spec spec/controllers/session_controller_spec.rb` and show us the output? Thanks Index: rspec_on_rails/lib/spec/dsl/behaviour_factory.rb =================================================================== --- rspec_on_rails/lib/spec/dsl/behaviour_factory.rb (revision 1893) +++ rspec_on_rails/lib/spec/dsl/behaviour_factory.rb (working copy) @@ -31,6 +31,7 @@ # describe "name", :behaviour_type => :view ... def create(*args, &block) opts = Hash === args.last ? args.last : {} + puts opts[:spec_path] if opts[:shared] key = :default elsif opts[:behaviour_type] ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-05-06 07:44 Message: There shouldn't be any need to support Windows style paths with \. Ruby will always report forward slashes for paths, even on Windows. I don't think Regexp support is different on Windows either, that would never slip through the Ruby community. However, I think maybe the call to caller might yield slightly different values on Windows and Linux/OS X. ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-05-06 07:12 Message: Here's the regexp used to determine the path: /spec(\/|\)+(view|helper|controller|model)s/ The (\/|\) is there to support /unix/style and \windows\style paths. This used be to expressed in 4 separate regexps and this release merged them into one. The specs that describe windows style paths still pass, but I'm running them on *nix. Could there be a difference in the way windows is handling regexps? Also, please try this one windows as well: script/spec spec/controllers/session_controller_spec.rb and let us know if you get the same result. Thanks, David ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-05-06 06:24 Message: I think the source of this bug is in rspec_on_rails/lib/spec/rails/extensions/kernel.rb This is where Spec::Rails tries to guess what kind of spec this is. Perhaps this behaves differently on windows? Could you investigate this please? ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-05-06 06:10 Message: Hint: Spec::Rails mixes in different modules for specs depending on whether it thinks it is a model spec, controller spec, view spec or helper spec. Your error tells me that the controller mixin wasn't included. RSpec decides what to mix in by looking at the folder of your spec. If it's under spec/controllers this should happen automatically (and apparently this is buggy on windows). Just to verify this theory (and work around it until a fix has been committed), you could try to be explicit about it: describe MyController, :behaviour_type => :controller do end ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=10534&group_id=797 From noreply at rubyforge.org Tue Jun 5 19:44:01 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Tue, 5 Jun 2007 19:44:01 -0400 (EDT) Subject: [rspec-devel] [ rspec-Feature Requests-11379 ] Add a Text Formatter that Show failures right away (as they come up) Message-ID: <20070605234401.805F85240A5E@rubyforge.org> Feature Requests item #11379, was opened at 2007-06-05 16:44 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3152&aid=11379&group_id=797 Category: None Group: None Status: Open Priority: 3 Submitted By: Brian Takita (btakita) Assigned to: Nobody (None) Summary: Add a Text Formatter that Show failures right away (as they come up) Initial Comment: This is useful for suites that take a long time to run (> 30 seconds). The advantage is the developer can investigate the error right away instead of waiting for the suite run to finish. This can be used in conjunction with the ProgressBarFormatter. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3152&aid=11379&group_id=797 From dsisnero at gmail.com Tue Jun 5 20:47:34 2007 From: dsisnero at gmail.com (Dominic Sisneros) Date: Tue, 5 Jun 2007 18:47:34 -0600 Subject: [rspec-devel] [ rspec-Bugs-10534 ] Windows: undefined method `controller_name' In-Reply-To: <20070605224957.1BB08A970002@rubyforge.org> References: <20070605224957.1BB08A970002@rubyforge.org> Message-ID: I am getting similar errors on Windows. running ruby-debug 29 elsif opts[:behaviour_type] 30 behaviour_type = opts[:behaviour_type] 31 elsif opts[:spec_path] =~ /spec\/(#{BEHAVIOUR_CLASSES.keys.join('|')})/ 32 behaviour_type = $1.to_sym 33 else 34 behaviour_type = :default 35 end 36 return BEHAVIOUR_CLASSES[behaviour_type].new(*args, &block) 37 end 38 and (rdb:1) eval opts {:spec_path=>"./spec\\controllers\\cart_controller_spec.rb:30"} so the behaviour_type gets set to :default -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/rspec-devel/attachments/20070605/79ae45ec/attachment.html From noreply at rubyforge.org Wed Jun 6 00:22:21 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Wed, 6 Jun 2007 00:22:21 -0400 (EDT) Subject: [rspec-devel] [ rspec-Feature Requests-10814 ] Runner loads shared code, test cases require them again Message-ID: <20070606042221.2A6D85240BED@rubyforge.org> Feature Requests item #10814, was opened at 2007-05-13 23:03 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3152&aid=10814&group_id=797 Category: runner / command line Group: None Status: Open Priority: 3 Submitted By: Assaf Arkin (assaf) Assigned to: David Chelimsky (dchelimsky) Summary: Runner loads shared code, test cases require them again Initial Comment: Our test directory contains one file that provides methods and behaviores shared by all other test files. To run individual files, each one requires that shared file. However, when running spec test, RSpec loads all the files from the test directory (and its sub-directories). So the file gets loaded once (by RSpec) and required once (by the test files), and interpreted twice (by Ruby). Some of the code doesn't like that. The current workaround is to detect the second load and ignore it (e.g. unless defined?(SomeConst)). But given the amount of time it took to find the culprit and work around it, can RSpec require the file instead, or allow a directory of shared behaviors not loaded by default? ---------------------------------------------------------------------- >Comment By: Assaf Arkin (assaf) Date: 2007-06-06 04:22 Message: require is essentially load but it checks against $LOADED_FEATURES, so you can always remove those entries from $LOADED_FEATURES (or just keep a before copy and replace it) in order to load the same test files again. This wouldn't work for my test cases in DRb, but will work for them on the command line. In my opinion a long term solution can't assume that the Ruby environment returns to pristine condition, and will fork a new process each time the tests are run. ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-06-05 22:16 Message: Unfortunately, I'm going to have to revert this - this fix broke drb. We'll have to find a different solution. ---------------------------------------------------------------------- Comment By: Patrick Ritchie (pritchie) Date: 2007-06-05 22:00 Message: Reason: load is required for spec_server (drb) to work correctly. If we use require the behaviours only get checked on the first run of a given spec file. On subsequent runs we get the behaviours don't get loaded causing this problem: http://rubyforge.org/pipermail/rspec-users/2007-May/001633.html ---------------------------------------------------------------------- Comment By: Assaf Arkin (assaf) Date: 2007-05-16 05:00 Message: Thanks! Assaf ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-05-16 03:35 Message: No reason. Fixed in r1958. ---------------------------------------------------------------------- Comment By: Assaf Arkin (assaf) Date: 2007-05-16 02:21 Message: More pain than it's worth. I'm going to have to explain to every developer how to properly run the test cases, they're of course not going to RTFM, so their first attempt will fail miserably. And with each project deciding to exclude a different file ... Is there a particular reason for RSpec to use load instead of require? ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-05-16 00:35 Message: How about an "exclude" command line option? spec spec --exclude spec/shared.rb ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3152&aid=10814&group_id=797 From noreply at rubyforge.org Wed Jun 6 01:30:33 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Wed, 6 Jun 2007 01:30:33 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-10534 ] Windows: undefined method `controller_name' Message-ID: <20070606053033.51AC15240BEE@rubyforge.org> Bugs item #10534, was opened at 2007-05-02 23:52 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=10534&group_id=797 Category: None Group: None Status: Open Resolution: None Priority: 3 Submitted By: Larry Kluger (larrykluger) Assigned to: Nobody (None) Summary: Windows: undefined method `controller_name' Initial Comment: Running 0.9.1 on windows -- (InstantRails with updated rails and other gems) gives following trace (below). I have updated to all the latest gems and plugins as of today, May 2, 07. The exact same svn tree on Linux works fine for rake spec I think something is not requiring the right modules due to Window's back slashes. Regards, LarryK ~~~~~~~~~~~~~~~ Trace followed by list of installed gems > rake spec C:/instant_rails_1.7/InstantRails/ruby/lib/ruby/gems/1.8/gems/rspec-0.9.1/lib/spec/dsl/behaviour_eval.rb:95:in `method_missing': undefined method `controller_name' for # (NoMethodError) from ./spec/controllers/session_controller_spec.rb:4 from C:/instant_rails_1.7/InstantRails/ruby/lib/ruby/gems/1.8/gems/rspec-0.9.1/lib/spec/dsl/ behaviour.rb:47:in `class_eval' from C:/instant_rails_1.7/InstantRails/ruby/lib/ruby/gems/1.8/gems/rspec-0.9.1/lib/spec/dsl/ behaviour.rb:47:in `eval_behaviour' from C:/instant_rails_1.7/InstantRails/ruby/lib/ruby/gems/1.8/gems/rspec-0.9.1/lib/spec/dsl/ behaviour.rb:29:in `initialize' from C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec_on_rails/lib/spec /dsl/behaviour_factory.rb:43:in `new' from C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec_on_rails/lib/spec /dsl/behaviour_factory.rb:43:in `create' from C:/instant_rails_1.7/InstantRails/ruby/lib/ruby/gems/1.8/gems/rspec-0.9.1/lib/spec/runn er/extensions/kernel.rb:4:in `context' from ./spec/controllers/session_controller_spec.rb:3 ... 14 levels... from C:/instant_rails_1.7/InstantRails/ruby/lib/ruby/gems/1.8/gems/rspec-0.9.1/lib/spec/runn er/option_parser.rb:261:in `parse' from C:/instant_rails_1.7/InstantRails/ruby/lib/ruby/gems/1.8/gems/rspec-0.9.1/lib/spec/runn er/option_parser.rb:28:in `create_behaviour_runner' from C:/instant_rails_1.7/InstantRails/ruby/lib/ruby/gems/1.8/gems/rspec-0.9.1/lib/spec/runn er/command_line.rb:14:in `run' from C:/instant_rails_1.7/InstantRails/ruby/lib/ruby/gems/1.8/gems/rspec-0.9.1/bin/spec:3 rake aborted! Command ruby -I"C:/instant_rails_1.7/InstantRails/ruby/lib/ruby/gems/1.8/gems/rspec-0.9.1/lib" "C:/i nstant_rails_1.7/InstantRails/ruby/lib/ruby/gems/1.8/gems/rspec-0.9.1/bin/spec" "spec/controllers/se ssion_controller_spec.rb" "spec/controllers/users_controller_spec.rb" "spec/controllers/user_assets_ controller_spec.rb" "spec/helpers/user_assets_helper_spec.rb" "spec/helpers/user_assets_url_helpers_ spec.rb" "spec/models/asset_spec.rb" "spec/models/authenticated_base_spec.rb" "spec/models/user_spec .rb" "spec/views/assets/edit_rhtml_spec.rb" "spec/views/assets/index_rhtml_spec.rb" "spec/views/asse ts/new_rhtml_spec.rb" "spec/views/assets/show_rhtml_spec.rb" "spec/views/users/edit_rhtml_spec.rb" " spec/views/users/index_rhtml_spec.rb" "spec/views/users/new_rhtml_spec.rb" "spec/views/users/show_rh tml_spec.rb" --options "C:/instant_rails_1.7/InstantRails/rails_apps/am2/config/../spec/spec.opts" failed C:\instant_rails_1.7\InstantRails\rails_apps\am2>gem list --local *** LOCAL GEMS *** actionmailer (1.3.3) Service layer for easy email delivery and testing. actionpack (1.13.3) Web-flow and rendering framework putting the VC in MVC. actionwebservice (1.2.3) Web service support for Action Pack. activerecord (1.15.3) Implements the ActiveRecord pattern for ORM. activesupport (1.4.2) Support and utility classes used by the Rails framework. capistrano (1.4.1) Capistrano is a framework and utility for executing commands in parallel on multiple remote machines, via SSH. The primary goal is to simplify and automate the deployment of web applications. cgi_multipart_eof_fix (2.1) Fix an exploitable bug in CGI multipart parsing which affects Ruby <= 1.8.5 when multipart boundary attribute contains a non-halting regular expression string. cmdparse (2.0.2) Advanced command line parser supporting commands fxri (0.3.6) Graphical interface to the RI documentation, with search engine. fxruby (1.6.6) FXRuby is the Ruby binding to the FOX GUI toolkit. gem_plugin (0.2.2) A plugin system based only on rubygems that uses dependencies only highline (1.2.7) HighLine is a high-level command-line IO library. hpricot (0.4) a swift, liberal HTML parser with a fantastic library log4r (1.0.5) Log4r is a comprehensive and flexible logging library for Ruby. mongrel (1.0.1) A small fast HTTP library and server that runs Rails, Camping, Nitro and Iowa apps. mongrel_cluster (0.2.1) Mongrel plugin that provides commands and Capistrano tasks for managing multiple Mongrel processes. mysql (2.7.3) A win32-native build of the MySQL API module for Ruby. needle (1.3.0) Needle is a Dependency Injection/Inversion of Control container for Ruby. It supports both type-2 (setter) and type-3 (constructor) injection. It takes advantage of the dynamic nature of Ruby to provide a rich and flexible approach to injecting dependencies. net-sftp (1.1.0) Net::SFTP is a pure-Ruby implementation of the SFTP client protocol. net-ssh (1.0.10) Net::SSH is a pure-Ruby implementation of the SSH2 client protocol. piston (1.3.3) Piston is a utility that enables merge tracking of remote repositories. rails (1.2.3) Web-application framework with template engine, control-flow layer, and ORM. rake (0.7.2) Ruby based make-like utility. rcov (0.8.0.2) Code coverage analysis tool for Ruby rmagick (1.14.1) RMagick is an interface between the Ruby programming language and the ImageMagick and GraphicsMagick image processing libraries. rspec (0.9.1, 0.8.2) RSpec-0.9.1 (r1880) - BDD for Ruby http://rspec.rubyforge.org/ sources (0.0.1) This package provides download sources for remote gem installation win32-clipboard (0.4.1) A package for interacting with the Windows clipboard win32-dir (0.3.1) Extra constants and methods for the Dir class on Windows. win32-eventlog (0.4.3) Interface for the MS Windows Event Log. win32-file (0.5.3) Extra or redefined methods for the File class on Windows. win32-file-stat (1.2.3) A File::Stat class tailored to MS Windows win32-process (0.5.1) Adds fork, wait, wait2, waitpid, waitpid2 and a special kill method win32-sapi (0.1.3) An interface to the MS SAPI (Sound API) library. win32-sound (0.4.0) A package for playing with sound on Windows. win32console (1.0.8) A library giving the Win32 console ANSI escape sequence support. windows-pr (0.6.2) Windows functions and constants predefined via Win32API ---------------------------------------------------------------------- Comment By: Dominic Sisneros (dsisnero) Date: 2007-06-06 05:30 Message: I am getting similar errors on Windows. running ruby-debug 29 elsif opts[:behaviour_type] 30 behaviour_type = opts[:behaviour_type] 31 elsif opts[:spec_path] =~ /spec\/(#{BEHAVIOUR_CLASSES.keys.join('|')})/ 32 behaviour_type = $1.to_sym 33 else 34 behaviour_type = :default 35 end 36 return BEHAVIOUR_CLASSES[behaviour_type].new(*args, &block) 37 end 38 and (rdb:1) eval opts {:spec_path=>"./spec\controllers\cart_controller_spec.rb:30"} so the behaviour_type gets set to :default ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-06-05 22:49 Message: And what's the file path of the spec? ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-06-05 12:52 Message: Larry - things have moved around a bit since this was raised. Are you still experiencing the same thing with 1.0.x? ---------------------------------------------------------------------- Comment By: Larry Kluger (larrykluger) Date: 2007-05-10 01:20 Message: Hi David, nil seems a bit boring. Please let me know how I can further help track this down. I'm at your service. Larry Source: def create(*args, &block) opts = Hash === args.last ? args.last : {} require 'pp' puts pp(opts) if opts[:shared] key = :default .... result: C:\instant_rails_1.7\InstantRails\rails_apps\am2>ruby script/spec spec/controllers/session_controlle r_spec.rb /config/../vendor/plugins/acts_as_wizard/lib/wizard_setup_filter.rb:2) {} nil C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec/lib/spec/dsl/behaviour_eval.rb:95:in `method_missing': undefined method `controller_name' for # (NoMethodError) from ./spec/controllers/session_controller_spec.rb:6 from C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec/lib/spec/dsl/behaviour.rb:47:in `class_eval' .... ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-05-09 22:44 Message: Hi Larry - what I'm looking for is not the args, but the options: puts opts.inspect or puts pp(opts) Thanks ---------------------------------------------------------------------- Comment By: Larry Kluger (larrykluger) Date: 2007-05-06 20:22 Message: Hi, I changed behaviour_factory.rb to be: def create(*args, &block) opts = Hash === args.last ? args.last : {} require 'pp' puts pp(args) if opts[:shared] .... Here is the output: ["/session/new GET"] nil C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec/lib/spec/dsl/behaviour_eval.rb :95:in `method_missing': undefined method `controller_name' for # ( NoMethodError) .... Larry ---------------------------------------------------------------------- Comment By: Larry Kluger (larrykluger) Date: 2007-05-06 20:13 Message: Hi David, I've deleted the rspec gem and plugin. I then installed ver 0.9.3 as plugins per the installation instructions. I added the puts as requested the result was nil, see trace. Aslak, where do I put the lines describe MyController, :behaviour_type => :controller do end ? I tried describe "SessionController", :behaviour_type => :controller do end just after the require statement in my session_controller_spec.rb but received the same problem. Thank you for your help and time on this puzzler. Larry C:\instant_rails_1.7\InstantRails\rails_apps\am2>ruby script/spec spec/controllers/session_controller_spec.rb nil C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec/lib/spec/dsl/behaviour_eval.rb:95:in `method_missing': undefined method `controller_name' for # (NoMethodError) from ./spec/controllers/session_controller_spec.rb:4 from C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec/lib/spec/dsl/behaviour.rb:47:in `class_eval' from C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec/lib/spec/dsl/behaviour.rb:47:in `eval_behaviour' from C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec/lib/spec/dsl/behaviour.rb:29:in `initialize' from C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec_on_rails/lib/spec/dsl/behaviour_factory.rb:44:in `new' from C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec_on_rails/lib/spec/dsl/behaviour_factory.rb:44:in `create' from C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec/lib/spec/runner/extensions/kernel.rb:4:in `context' from ./spec/controllers/session_controller_spec.rb:3 from C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec/lib/spec/runner/behaviour_runner.rb:85:in `load' from C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec/lib/spec/runner/behaviour_runner.rb:85:in `load_specs' from C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec/lib/spec/runner/behaviour_runner.rb:84:in `each' from C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec/lib/spec/runner/behaviour_runner.rb:84:in `load_specs' from C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec/lib/spec/runner/behaviour_runner.rb:22:in `run' from C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec/lib/spec/runner/command_line.rb:17:in `run' from script/spec:4 C:\instant_rails_1.7\InstantRails\rails_apps\am2> ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-05-06 11:52 Message: "However, I think maybe the call to caller might yield slightly different values on Windows and Linux/OS X." Now THAT would make sense. Larry, would you kindly apply the patch below, run `script/spec spec/controllers/session_controller_spec.rb` and show us the output? Thanks Index: rspec_on_rails/lib/spec/dsl/behaviour_factory.rb =================================================================== --- rspec_on_rails/lib/spec/dsl/behaviour_factory.rb (revision 1893) +++ rspec_on_rails/lib/spec/dsl/behaviour_factory.rb (working copy) @@ -31,6 +31,7 @@ # describe "name", :behaviour_type => :view ... def create(*args, &block) opts = Hash === args.last ? args.last : {} + puts opts[:spec_path] if opts[:shared] key = :default elsif opts[:behaviour_type] ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-05-06 11:44 Message: There shouldn't be any need to support Windows style paths with \. Ruby will always report forward slashes for paths, even on Windows. I don't think Regexp support is different on Windows either, that would never slip through the Ruby community. However, I think maybe the call to caller might yield slightly different values on Windows and Linux/OS X. ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-05-06 11:12 Message: Here's the regexp used to determine the path: /spec(\/|\)+(view|helper|controller|model)s/ The (\/|\) is there to support /unix/style and \windows\style paths. This used be to expressed in 4 separate regexps and this release merged them into one. The specs that describe windows style paths still pass, but I'm running them on *nix. Could there be a difference in the way windows is handling regexps? Also, please try this one windows as well: script/spec spec/controllers/session_controller_spec.rb and let us know if you get the same result. Thanks, David ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-05-06 10:24 Message: I think the source of this bug is in rspec_on_rails/lib/spec/rails/extensions/kernel.rb This is where Spec::Rails tries to guess what kind of spec this is. Perhaps this behaves differently on windows? Could you investigate this please? ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-05-06 10:10 Message: Hint: Spec::Rails mixes in different modules for specs depending on whether it thinks it is a model spec, controller spec, view spec or helper spec. Your error tells me that the controller mixin wasn't included. RSpec decides what to mix in by looking at the folder of your spec. If it's under spec/controllers this should happen automatically (and apparently this is buggy on windows). Just to verify this theory (and work around it until a fix has been committed), you could try to be explicit about it: describe MyController, :behaviour_type => :controller do end ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=10534&group_id=797 From noreply at rubyforge.org Wed Jun 6 09:16:29 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Wed, 6 Jun 2007 09:16:29 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-10534 ] Windows: undefined method `controller_name' Message-ID: <20070606131629.6ED6F5240A66@rubyforge.org> Bugs item #10534, was opened at 2007-05-02 23:52 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=10534&group_id=797 Category: None Group: None Status: Open Resolution: None Priority: 3 Submitted By: Larry Kluger (larrykluger) Assigned to: Nobody (None) Summary: Windows: undefined method `controller_name' Initial Comment: Running 0.9.1 on windows -- (InstantRails with updated rails and other gems) gives following trace (below). I have updated to all the latest gems and plugins as of today, May 2, 07. The exact same svn tree on Linux works fine for rake spec I think something is not requiring the right modules due to Window's back slashes. Regards, LarryK ~~~~~~~~~~~~~~~ Trace followed by list of installed gems > rake spec C:/instant_rails_1.7/InstantRails/ruby/lib/ruby/gems/1.8/gems/rspec-0.9.1/lib/spec/dsl/behaviour_eval.rb:95:in `method_missing': undefined method `controller_name' for # (NoMethodError) from ./spec/controllers/session_controller_spec.rb:4 from C:/instant_rails_1.7/InstantRails/ruby/lib/ruby/gems/1.8/gems/rspec-0.9.1/lib/spec/dsl/ behaviour.rb:47:in `class_eval' from C:/instant_rails_1.7/InstantRails/ruby/lib/ruby/gems/1.8/gems/rspec-0.9.1/lib/spec/dsl/ behaviour.rb:47:in `eval_behaviour' from C:/instant_rails_1.7/InstantRails/ruby/lib/ruby/gems/1.8/gems/rspec-0.9.1/lib/spec/dsl/ behaviour.rb:29:in `initialize' from C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec_on_rails/lib/spec /dsl/behaviour_factory.rb:43:in `new' from C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec_on_rails/lib/spec /dsl/behaviour_factory.rb:43:in `create' from C:/instant_rails_1.7/InstantRails/ruby/lib/ruby/gems/1.8/gems/rspec-0.9.1/lib/spec/runn er/extensions/kernel.rb:4:in `context' from ./spec/controllers/session_controller_spec.rb:3 ... 14 levels... from C:/instant_rails_1.7/InstantRails/ruby/lib/ruby/gems/1.8/gems/rspec-0.9.1/lib/spec/runn er/option_parser.rb:261:in `parse' from C:/instant_rails_1.7/InstantRails/ruby/lib/ruby/gems/1.8/gems/rspec-0.9.1/lib/spec/runn er/option_parser.rb:28:in `create_behaviour_runner' from C:/instant_rails_1.7/InstantRails/ruby/lib/ruby/gems/1.8/gems/rspec-0.9.1/lib/spec/runn er/command_line.rb:14:in `run' from C:/instant_rails_1.7/InstantRails/ruby/lib/ruby/gems/1.8/gems/rspec-0.9.1/bin/spec:3 rake aborted! Command ruby -I"C:/instant_rails_1.7/InstantRails/ruby/lib/ruby/gems/1.8/gems/rspec-0.9.1/lib" "C:/i nstant_rails_1.7/InstantRails/ruby/lib/ruby/gems/1.8/gems/rspec-0.9.1/bin/spec" "spec/controllers/se ssion_controller_spec.rb" "spec/controllers/users_controller_spec.rb" "spec/controllers/user_assets_ controller_spec.rb" "spec/helpers/user_assets_helper_spec.rb" "spec/helpers/user_assets_url_helpers_ spec.rb" "spec/models/asset_spec.rb" "spec/models/authenticated_base_spec.rb" "spec/models/user_spec .rb" "spec/views/assets/edit_rhtml_spec.rb" "spec/views/assets/index_rhtml_spec.rb" "spec/views/asse ts/new_rhtml_spec.rb" "spec/views/assets/show_rhtml_spec.rb" "spec/views/users/edit_rhtml_spec.rb" " spec/views/users/index_rhtml_spec.rb" "spec/views/users/new_rhtml_spec.rb" "spec/views/users/show_rh tml_spec.rb" --options "C:/instant_rails_1.7/InstantRails/rails_apps/am2/config/../spec/spec.opts" failed C:\instant_rails_1.7\InstantRails\rails_apps\am2>gem list --local *** LOCAL GEMS *** actionmailer (1.3.3) Service layer for easy email delivery and testing. actionpack (1.13.3) Web-flow and rendering framework putting the VC in MVC. actionwebservice (1.2.3) Web service support for Action Pack. activerecord (1.15.3) Implements the ActiveRecord pattern for ORM. activesupport (1.4.2) Support and utility classes used by the Rails framework. capistrano (1.4.1) Capistrano is a framework and utility for executing commands in parallel on multiple remote machines, via SSH. The primary goal is to simplify and automate the deployment of web applications. cgi_multipart_eof_fix (2.1) Fix an exploitable bug in CGI multipart parsing which affects Ruby <= 1.8.5 when multipart boundary attribute contains a non-halting regular expression string. cmdparse (2.0.2) Advanced command line parser supporting commands fxri (0.3.6) Graphical interface to the RI documentation, with search engine. fxruby (1.6.6) FXRuby is the Ruby binding to the FOX GUI toolkit. gem_plugin (0.2.2) A plugin system based only on rubygems that uses dependencies only highline (1.2.7) HighLine is a high-level command-line IO library. hpricot (0.4) a swift, liberal HTML parser with a fantastic library log4r (1.0.5) Log4r is a comprehensive and flexible logging library for Ruby. mongrel (1.0.1) A small fast HTTP library and server that runs Rails, Camping, Nitro and Iowa apps. mongrel_cluster (0.2.1) Mongrel plugin that provides commands and Capistrano tasks for managing multiple Mongrel processes. mysql (2.7.3) A win32-native build of the MySQL API module for Ruby. needle (1.3.0) Needle is a Dependency Injection/Inversion of Control container for Ruby. It supports both type-2 (setter) and type-3 (constructor) injection. It takes advantage of the dynamic nature of Ruby to provide a rich and flexible approach to injecting dependencies. net-sftp (1.1.0) Net::SFTP is a pure-Ruby implementation of the SFTP client protocol. net-ssh (1.0.10) Net::SSH is a pure-Ruby implementation of the SSH2 client protocol. piston (1.3.3) Piston is a utility that enables merge tracking of remote repositories. rails (1.2.3) Web-application framework with template engine, control-flow layer, and ORM. rake (0.7.2) Ruby based make-like utility. rcov (0.8.0.2) Code coverage analysis tool for Ruby rmagick (1.14.1) RMagick is an interface between the Ruby programming language and the ImageMagick and GraphicsMagick image processing libraries. rspec (0.9.1, 0.8.2) RSpec-0.9.1 (r1880) - BDD for Ruby http://rspec.rubyforge.org/ sources (0.0.1) This package provides download sources for remote gem installation win32-clipboard (0.4.1) A package for interacting with the Windows clipboard win32-dir (0.3.1) Extra constants and methods for the Dir class on Windows. win32-eventlog (0.4.3) Interface for the MS Windows Event Log. win32-file (0.5.3) Extra or redefined methods for the File class on Windows. win32-file-stat (1.2.3) A File::Stat class tailored to MS Windows win32-process (0.5.1) Adds fork, wait, wait2, waitpid, waitpid2 and a special kill method win32-sapi (0.1.3) An interface to the MS SAPI (Sound API) library. win32-sound (0.4.0) A package for playing with sound on Windows. win32console (1.0.8) A library giving the Win32 console ANSI escape sequence support. windows-pr (0.6.2) Windows functions and constants predefined via Win32API ---------------------------------------------------------------------- >Comment By: David Chelimsky (dchelimsky) Date: 2007-06-06 13:16 Message: OK - looks like the problem is in caller providing a path w/ backslashes in windows. I'll bring back the test for (\/|\) in the regexp and that should fix this. ---------------------------------------------------------------------- Comment By: Dominic Sisneros (dsisnero) Date: 2007-06-06 05:30 Message: I am getting similar errors on Windows. running ruby-debug 29 elsif opts[:behaviour_type] 30 behaviour_type = opts[:behaviour_type] 31 elsif opts[:spec_path] =~ /spec\/(#{BEHAVIOUR_CLASSES.keys.join('|')})/ 32 behaviour_type = $1.to_sym 33 else 34 behaviour_type = :default 35 end 36 return BEHAVIOUR_CLASSES[behaviour_type].new(*args, &block) 37 end 38 and (rdb:1) eval opts {:spec_path=>"./spec\controllers\cart_controller_spec.rb:30"} so the behaviour_type gets set to :default ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-06-05 22:49 Message: And what's the file path of the spec? ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-06-05 12:52 Message: Larry - things have moved around a bit since this was raised. Are you still experiencing the same thing with 1.0.x? ---------------------------------------------------------------------- Comment By: Larry Kluger (larrykluger) Date: 2007-05-10 01:20 Message: Hi David, nil seems a bit boring. Please let me know how I can further help track this down. I'm at your service. Larry Source: def create(*args, &block) opts = Hash === args.last ? args.last : {} require 'pp' puts pp(opts) if opts[:shared] key = :default .... result: C:\instant_rails_1.7\InstantRails\rails_apps\am2>ruby script/spec spec/controllers/session_controlle r_spec.rb /config/../vendor/plugins/acts_as_wizard/lib/wizard_setup_filter.rb:2) {} nil C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec/lib/spec/dsl/behaviour_eval.rb:95:in `method_missing': undefined method `controller_name' for # (NoMethodError) from ./spec/controllers/session_controller_spec.rb:6 from C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec/lib/spec/dsl/behaviour.rb:47:in `class_eval' .... ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-05-09 22:44 Message: Hi Larry - what I'm looking for is not the args, but the options: puts opts.inspect or puts pp(opts) Thanks ---------------------------------------------------------------------- Comment By: Larry Kluger (larrykluger) Date: 2007-05-06 20:22 Message: Hi, I changed behaviour_factory.rb to be: def create(*args, &block) opts = Hash === args.last ? args.last : {} require 'pp' puts pp(args) if opts[:shared] .... Here is the output: ["/session/new GET"] nil C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec/lib/spec/dsl/behaviour_eval.rb :95:in `method_missing': undefined method `controller_name' for # ( NoMethodError) .... Larry ---------------------------------------------------------------------- Comment By: Larry Kluger (larrykluger) Date: 2007-05-06 20:13 Message: Hi David, I've deleted the rspec gem and plugin. I then installed ver 0.9.3 as plugins per the installation instructions. I added the puts as requested the result was nil, see trace. Aslak, where do I put the lines describe MyController, :behaviour_type => :controller do end ? I tried describe "SessionController", :behaviour_type => :controller do end just after the require statement in my session_controller_spec.rb but received the same problem. Thank you for your help and time on this puzzler. Larry C:\instant_rails_1.7\InstantRails\rails_apps\am2>ruby script/spec spec/controllers/session_controller_spec.rb nil C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec/lib/spec/dsl/behaviour_eval.rb:95:in `method_missing': undefined method `controller_name' for # (NoMethodError) from ./spec/controllers/session_controller_spec.rb:4 from C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec/lib/spec/dsl/behaviour.rb:47:in `class_eval' from C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec/lib/spec/dsl/behaviour.rb:47:in `eval_behaviour' from C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec/lib/spec/dsl/behaviour.rb:29:in `initialize' from C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec_on_rails/lib/spec/dsl/behaviour_factory.rb:44:in `new' from C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec_on_rails/lib/spec/dsl/behaviour_factory.rb:44:in `create' from C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec/lib/spec/runner/extensions/kernel.rb:4:in `context' from ./spec/controllers/session_controller_spec.rb:3 from C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec/lib/spec/runner/behaviour_runner.rb:85:in `load' from C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec/lib/spec/runner/behaviour_runner.rb:85:in `load_specs' from C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec/lib/spec/runner/behaviour_runner.rb:84:in `each' from C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec/lib/spec/runner/behaviour_runner.rb:84:in `load_specs' from C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec/lib/spec/runner/behaviour_runner.rb:22:in `run' from C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec/lib/spec/runner/command_line.rb:17:in `run' from script/spec:4 C:\instant_rails_1.7\InstantRails\rails_apps\am2> ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-05-06 11:52 Message: "However, I think maybe the call to caller might yield slightly different values on Windows and Linux/OS X." Now THAT would make sense. Larry, would you kindly apply the patch below, run `script/spec spec/controllers/session_controller_spec.rb` and show us the output? Thanks Index: rspec_on_rails/lib/spec/dsl/behaviour_factory.rb =================================================================== --- rspec_on_rails/lib/spec/dsl/behaviour_factory.rb (revision 1893) +++ rspec_on_rails/lib/spec/dsl/behaviour_factory.rb (working copy) @@ -31,6 +31,7 @@ # describe "name", :behaviour_type => :view ... def create(*args, &block) opts = Hash === args.last ? args.last : {} + puts opts[:spec_path] if opts[:shared] key = :default elsif opts[:behaviour_type] ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-05-06 11:44 Message: There shouldn't be any need to support Windows style paths with \. Ruby will always report forward slashes for paths, even on Windows. I don't think Regexp support is different on Windows either, that would never slip through the Ruby community. However, I think maybe the call to caller might yield slightly different values on Windows and Linux/OS X. ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-05-06 11:12 Message: Here's the regexp used to determine the path: /spec(\/|\)+(view|helper|controller|model)s/ The (\/|\) is there to support /unix/style and \windows\style paths. This used be to expressed in 4 separate regexps and this release merged them into one. The specs that describe windows style paths still pass, but I'm running them on *nix. Could there be a difference in the way windows is handling regexps? Also, please try this one windows as well: script/spec spec/controllers/session_controller_spec.rb and let us know if you get the same result. Thanks, David ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-05-06 10:24 Message: I think the source of this bug is in rspec_on_rails/lib/spec/rails/extensions/kernel.rb This is where Spec::Rails tries to guess what kind of spec this is. Perhaps this behaves differently on windows? Could you investigate this please? ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-05-06 10:10 Message: Hint: Spec::Rails mixes in different modules for specs depending on whether it thinks it is a model spec, controller spec, view spec or helper spec. Your error tells me that the controller mixin wasn't included. RSpec decides what to mix in by looking at the folder of your spec. If it's under spec/controllers this should happen automatically (and apparently this is buggy on windows). Just to verify this theory (and work around it until a fix has been committed), you could try to be explicit about it: describe MyController, :behaviour_type => :controller do end ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=10534&group_id=797 From noreply at rubyforge.org Wed Jun 6 10:51:06 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Wed, 6 Jun 2007 10:51:06 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-10534 ] Windows: undefined method `controller_name' Message-ID: <20070606145106.954195240AC3@rubyforge.org> Bugs item #10534, was opened at 2007-05-02 19:52 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=10534&group_id=797 Category: None Group: None Status: Open Resolution: None Priority: 3 Submitted By: Larry Kluger (larrykluger) Assigned to: Nobody (None) Summary: Windows: undefined method `controller_name' Initial Comment: Running 0.9.1 on windows -- (InstantRails with updated rails and other gems) gives following trace (below). I have updated to all the latest gems and plugins as of today, May 2, 07. The exact same svn tree on Linux works fine for rake spec I think something is not requiring the right modules due to Window's back slashes. Regards, LarryK ~~~~~~~~~~~~~~~ Trace followed by list of installed gems > rake spec C:/instant_rails_1.7/InstantRails/ruby/lib/ruby/gems/1.8/gems/rspec-0.9.1/lib/spec/dsl/behaviour_eval.rb:95:in `method_missing': undefined method `controller_name' for # (NoMethodError) from ./spec/controllers/session_controller_spec.rb:4 from C:/instant_rails_1.7/InstantRails/ruby/lib/ruby/gems/1.8/gems/rspec-0.9.1/lib/spec/dsl/ behaviour.rb:47:in `class_eval' from C:/instant_rails_1.7/InstantRails/ruby/lib/ruby/gems/1.8/gems/rspec-0.9.1/lib/spec/dsl/ behaviour.rb:47:in `eval_behaviour' from C:/instant_rails_1.7/InstantRails/ruby/lib/ruby/gems/1.8/gems/rspec-0.9.1/lib/spec/dsl/ behaviour.rb:29:in `initialize' from C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec_on_rails/lib/spec /dsl/behaviour_factory.rb:43:in `new' from C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec_on_rails/lib/spec /dsl/behaviour_factory.rb:43:in `create' from C:/instant_rails_1.7/InstantRails/ruby/lib/ruby/gems/1.8/gems/rspec-0.9.1/lib/spec/runn er/extensions/kernel.rb:4:in `context' from ./spec/controllers/session_controller_spec.rb:3 ... 14 levels... from C:/instant_rails_1.7/InstantRails/ruby/lib/ruby/gems/1.8/gems/rspec-0.9.1/lib/spec/runn er/option_parser.rb:261:in `parse' from C:/instant_rails_1.7/InstantRails/ruby/lib/ruby/gems/1.8/gems/rspec-0.9.1/lib/spec/runn er/option_parser.rb:28:in `create_behaviour_runner' from C:/instant_rails_1.7/InstantRails/ruby/lib/ruby/gems/1.8/gems/rspec-0.9.1/lib/spec/runn er/command_line.rb:14:in `run' from C:/instant_rails_1.7/InstantRails/ruby/lib/ruby/gems/1.8/gems/rspec-0.9.1/bin/spec:3 rake aborted! Command ruby -I"C:/instant_rails_1.7/InstantRails/ruby/lib/ruby/gems/1.8/gems/rspec-0.9.1/lib" "C:/i nstant_rails_1.7/InstantRails/ruby/lib/ruby/gems/1.8/gems/rspec-0.9.1/bin/spec" "spec/controllers/se ssion_controller_spec.rb" "spec/controllers/users_controller_spec.rb" "spec/controllers/user_assets_ controller_spec.rb" "spec/helpers/user_assets_helper_spec.rb" "spec/helpers/user_assets_url_helpers_ spec.rb" "spec/models/asset_spec.rb" "spec/models/authenticated_base_spec.rb" "spec/models/user_spec .rb" "spec/views/assets/edit_rhtml_spec.rb" "spec/views/assets/index_rhtml_spec.rb" "spec/views/asse ts/new_rhtml_spec.rb" "spec/views/assets/show_rhtml_spec.rb" "spec/views/users/edit_rhtml_spec.rb" " spec/views/users/index_rhtml_spec.rb" "spec/views/users/new_rhtml_spec.rb" "spec/views/users/show_rh tml_spec.rb" --options "C:/instant_rails_1.7/InstantRails/rails_apps/am2/config/../spec/spec.opts" failed C:\instant_rails_1.7\InstantRails\rails_apps\am2>gem list --local *** LOCAL GEMS *** actionmailer (1.3.3) Service layer for easy email delivery and testing. actionpack (1.13.3) Web-flow and rendering framework putting the VC in MVC. actionwebservice (1.2.3) Web service support for Action Pack. activerecord (1.15.3) Implements the ActiveRecord pattern for ORM. activesupport (1.4.2) Support and utility classes used by the Rails framework. capistrano (1.4.1) Capistrano is a framework and utility for executing commands in parallel on multiple remote machines, via SSH. The primary goal is to simplify and automate the deployment of web applications. cgi_multipart_eof_fix (2.1) Fix an exploitable bug in CGI multipart parsing which affects Ruby <= 1.8.5 when multipart boundary attribute contains a non-halting regular expression string. cmdparse (2.0.2) Advanced command line parser supporting commands fxri (0.3.6) Graphical interface to the RI documentation, with search engine. fxruby (1.6.6) FXRuby is the Ruby binding to the FOX GUI toolkit. gem_plugin (0.2.2) A plugin system based only on rubygems that uses dependencies only highline (1.2.7) HighLine is a high-level command-line IO library. hpricot (0.4) a swift, liberal HTML parser with a fantastic library log4r (1.0.5) Log4r is a comprehensive and flexible logging library for Ruby. mongrel (1.0.1) A small fast HTTP library and server that runs Rails, Camping, Nitro and Iowa apps. mongrel_cluster (0.2.1) Mongrel plugin that provides commands and Capistrano tasks for managing multiple Mongrel processes. mysql (2.7.3) A win32-native build of the MySQL API module for Ruby. needle (1.3.0) Needle is a Dependency Injection/Inversion of Control container for Ruby. It supports both type-2 (setter) and type-3 (constructor) injection. It takes advantage of the dynamic nature of Ruby to provide a rich and flexible approach to injecting dependencies. net-sftp (1.1.0) Net::SFTP is a pure-Ruby implementation of the SFTP client protocol. net-ssh (1.0.10) Net::SSH is a pure-Ruby implementation of the SSH2 client protocol. piston (1.3.3) Piston is a utility that enables merge tracking of remote repositories. rails (1.2.3) Web-application framework with template engine, control-flow layer, and ORM. rake (0.7.2) Ruby based make-like utility. rcov (0.8.0.2) Code coverage analysis tool for Ruby rmagick (1.14.1) RMagick is an interface between the Ruby programming language and the ImageMagick and GraphicsMagick image processing libraries. rspec (0.9.1, 0.8.2) RSpec-0.9.1 (r1880) - BDD for Ruby http://rspec.rubyforge.org/ sources (0.0.1) This package provides download sources for remote gem installation win32-clipboard (0.4.1) A package for interacting with the Windows clipboard win32-dir (0.3.1) Extra constants and methods for the Dir class on Windows. win32-eventlog (0.4.3) Interface for the MS Windows Event Log. win32-file (0.5.3) Extra or redefined methods for the File class on Windows. win32-file-stat (1.2.3) A File::Stat class tailored to MS Windows win32-process (0.5.1) Adds fork, wait, wait2, waitpid, waitpid2 and a special kill method win32-sapi (0.1.3) An interface to the MS SAPI (Sound API) library. win32-sound (0.4.0) A package for playing with sound on Windows. win32console (1.0.8) A library giving the Win32 console ANSI escape sequence support. windows-pr (0.6.2) Windows functions and constants predefined via Win32API ---------------------------------------------------------------------- >Comment By: Larry Kluger (larrykluger) Date: 2007-06-06 10:51 Message: Hi, I hadn't heard back for several weeks so I let it go. (Not yet using rspec.) The path for the rspec file was rails_root/spec/controllers/session_controller_spec.rb (logically speaking) The actual filesystem path was rails_root\spec\controllers\session_controller_spec.rb Regards, Larry ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-06-06 09:16 Message: OK - looks like the problem is in caller providing a path w/ backslashes in windows. I'll bring back the test for (\/|\) in the regexp and that should fix this. ---------------------------------------------------------------------- Comment By: Dominic Sisneros (dsisnero) Date: 2007-06-06 01:30 Message: I am getting similar errors on Windows. running ruby-debug 29 elsif opts[:behaviour_type] 30 behaviour_type = opts[:behaviour_type] 31 elsif opts[:spec_path] =~ /spec\/(#{BEHAVIOUR_CLASSES.keys.join('|')})/ 32 behaviour_type = $1.to_sym 33 else 34 behaviour_type = :default 35 end 36 return BEHAVIOUR_CLASSES[behaviour_type].new(*args, &block) 37 end 38 and (rdb:1) eval opts {:spec_path=>"./spec\controllers\cart_controller_spec.rb:30"} so the behaviour_type gets set to :default ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-06-05 18:49 Message: And what's the file path of the spec? ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-06-05 08:52 Message: Larry - things have moved around a bit since this was raised. Are you still experiencing the same thing with 1.0.x? ---------------------------------------------------------------------- Comment By: Larry Kluger (larrykluger) Date: 2007-05-09 21:20 Message: Hi David, nil seems a bit boring. Please let me know how I can further help track this down. I'm at your service. Larry Source: def create(*args, &block) opts = Hash === args.last ? args.last : {} require 'pp' puts pp(opts) if opts[:shared] key = :default .... result: C:\instant_rails_1.7\InstantRails\rails_apps\am2>ruby script/spec spec/controllers/session_controlle r_spec.rb /config/../vendor/plugins/acts_as_wizard/lib/wizard_setup_filter.rb:2) {} nil C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec/lib/spec/dsl/behaviour_eval.rb:95:in `method_missing': undefined method `controller_name' for # (NoMethodError) from ./spec/controllers/session_controller_spec.rb:6 from C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec/lib/spec/dsl/behaviour.rb:47:in `class_eval' .... ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-05-09 18:44 Message: Hi Larry - what I'm looking for is not the args, but the options: puts opts.inspect or puts pp(opts) Thanks ---------------------------------------------------------------------- Comment By: Larry Kluger (larrykluger) Date: 2007-05-06 16:22 Message: Hi, I changed behaviour_factory.rb to be: def create(*args, &block) opts = Hash === args.last ? args.last : {} require 'pp' puts pp(args) if opts[:shared] .... Here is the output: ["/session/new GET"] nil C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec/lib/spec/dsl/behaviour_eval.rb :95:in `method_missing': undefined method `controller_name' for # ( NoMethodError) .... Larry ---------------------------------------------------------------------- Comment By: Larry Kluger (larrykluger) Date: 2007-05-06 16:13 Message: Hi David, I've deleted the rspec gem and plugin. I then installed ver 0.9.3 as plugins per the installation instructions. I added the puts as requested the result was nil, see trace. Aslak, where do I put the lines describe MyController, :behaviour_type => :controller do end ? I tried describe "SessionController", :behaviour_type => :controller do end just after the require statement in my session_controller_spec.rb but received the same problem. Thank you for your help and time on this puzzler. Larry C:\instant_rails_1.7\InstantRails\rails_apps\am2>ruby script/spec spec/controllers/session_controller_spec.rb nil C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec/lib/spec/dsl/behaviour_eval.rb:95:in `method_missing': undefined method `controller_name' for # (NoMethodError) from ./spec/controllers/session_controller_spec.rb:4 from C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec/lib/spec/dsl/behaviour.rb:47:in `class_eval' from C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec/lib/spec/dsl/behaviour.rb:47:in `eval_behaviour' from C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec/lib/spec/dsl/behaviour.rb:29:in `initialize' from C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec_on_rails/lib/spec/dsl/behaviour_factory.rb:44:in `new' from C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec_on_rails/lib/spec/dsl/behaviour_factory.rb:44:in `create' from C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec/lib/spec/runner/extensions/kernel.rb:4:in `context' from ./spec/controllers/session_controller_spec.rb:3 from C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec/lib/spec/runner/behaviour_runner.rb:85:in `load' from C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec/lib/spec/runner/behaviour_runner.rb:85:in `load_specs' from C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec/lib/spec/runner/behaviour_runner.rb:84:in `each' from C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec/lib/spec/runner/behaviour_runner.rb:84:in `load_specs' from C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec/lib/spec/runner/behaviour_runner.rb:22:in `run' from C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec/lib/spec/runner/command_line.rb:17:in `run' from script/spec:4 C:\instant_rails_1.7\InstantRails\rails_apps\am2> ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-05-06 07:52 Message: "However, I think maybe the call to caller might yield slightly different values on Windows and Linux/OS X." Now THAT would make sense. Larry, would you kindly apply the patch below, run `script/spec spec/controllers/session_controller_spec.rb` and show us the output? Thanks Index: rspec_on_rails/lib/spec/dsl/behaviour_factory.rb =================================================================== --- rspec_on_rails/lib/spec/dsl/behaviour_factory.rb (revision 1893) +++ rspec_on_rails/lib/spec/dsl/behaviour_factory.rb (working copy) @@ -31,6 +31,7 @@ # describe "name", :behaviour_type => :view ... def create(*args, &block) opts = Hash === args.last ? args.last : {} + puts opts[:spec_path] if opts[:shared] key = :default elsif opts[:behaviour_type] ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-05-06 07:44 Message: There shouldn't be any need to support Windows style paths with \. Ruby will always report forward slashes for paths, even on Windows. I don't think Regexp support is different on Windows either, that would never slip through the Ruby community. However, I think maybe the call to caller might yield slightly different values on Windows and Linux/OS X. ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-05-06 07:12 Message: Here's the regexp used to determine the path: /spec(\/|\)+(view|helper|controller|model)s/ The (\/|\) is there to support /unix/style and \windows\style paths. This used be to expressed in 4 separate regexps and this release merged them into one. The specs that describe windows style paths still pass, but I'm running them on *nix. Could there be a difference in the way windows is handling regexps? Also, please try this one windows as well: script/spec spec/controllers/session_controller_spec.rb and let us know if you get the same result. Thanks, David ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-05-06 06:24 Message: I think the source of this bug is in rspec_on_rails/lib/spec/rails/extensions/kernel.rb This is where Spec::Rails tries to guess what kind of spec this is. Perhaps this behaves differently on windows? Could you investigate this please? ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-05-06 06:10 Message: Hint: Spec::Rails mixes in different modules for specs depending on whether it thinks it is a model spec, controller spec, view spec or helper spec. Your error tells me that the controller mixin wasn't included. RSpec decides what to mix in by looking at the folder of your spec. If it's under spec/controllers this should happen automatically (and apparently this is buggy on windows). Just to verify this theory (and work around it until a fix has been committed), you could try to be explicit about it: describe MyController, :behaviour_type => :controller do end ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=10534&group_id=797 From noreply at rubyforge.org Wed Jun 6 11:26:12 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Wed, 6 Jun 2007 11:26:12 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-10534 ] Windows: undefined method `controller_name' Message-ID: <20070606152612.D8E655240ADD@rubyforge.org> Bugs item #10534, was opened at 2007-05-02 23:52 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=10534&group_id=797 Category: None Group: None >Status: Closed >Resolution: Accepted Priority: 3 Submitted By: Larry Kluger (larrykluger) >Assigned to: David Chelimsky (dchelimsky) Summary: Windows: undefined method `controller_name' Initial Comment: Running 0.9.1 on windows -- (InstantRails with updated rails and other gems) gives following trace (below). I have updated to all the latest gems and plugins as of today, May 2, 07. The exact same svn tree on Linux works fine for rake spec I think something is not requiring the right modules due to Window's back slashes. Regards, LarryK ~~~~~~~~~~~~~~~ Trace followed by list of installed gems > rake spec C:/instant_rails_1.7/InstantRails/ruby/lib/ruby/gems/1.8/gems/rspec-0.9.1/lib/spec/dsl/behaviour_eval.rb:95:in `method_missing': undefined method `controller_name' for # (NoMethodError) from ./spec/controllers/session_controller_spec.rb:4 from C:/instant_rails_1.7/InstantRails/ruby/lib/ruby/gems/1.8/gems/rspec-0.9.1/lib/spec/dsl/ behaviour.rb:47:in `class_eval' from C:/instant_rails_1.7/InstantRails/ruby/lib/ruby/gems/1.8/gems/rspec-0.9.1/lib/spec/dsl/ behaviour.rb:47:in `eval_behaviour' from C:/instant_rails_1.7/InstantRails/ruby/lib/ruby/gems/1.8/gems/rspec-0.9.1/lib/spec/dsl/ behaviour.rb:29:in `initialize' from C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec_on_rails/lib/spec /dsl/behaviour_factory.rb:43:in `new' from C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec_on_rails/lib/spec /dsl/behaviour_factory.rb:43:in `create' from C:/instant_rails_1.7/InstantRails/ruby/lib/ruby/gems/1.8/gems/rspec-0.9.1/lib/spec/runn er/extensions/kernel.rb:4:in `context' from ./spec/controllers/session_controller_spec.rb:3 ... 14 levels... from C:/instant_rails_1.7/InstantRails/ruby/lib/ruby/gems/1.8/gems/rspec-0.9.1/lib/spec/runn er/option_parser.rb:261:in `parse' from C:/instant_rails_1.7/InstantRails/ruby/lib/ruby/gems/1.8/gems/rspec-0.9.1/lib/spec/runn er/option_parser.rb:28:in `create_behaviour_runner' from C:/instant_rails_1.7/InstantRails/ruby/lib/ruby/gems/1.8/gems/rspec-0.9.1/lib/spec/runn er/command_line.rb:14:in `run' from C:/instant_rails_1.7/InstantRails/ruby/lib/ruby/gems/1.8/gems/rspec-0.9.1/bin/spec:3 rake aborted! Command ruby -I"C:/instant_rails_1.7/InstantRails/ruby/lib/ruby/gems/1.8/gems/rspec-0.9.1/lib" "C:/i nstant_rails_1.7/InstantRails/ruby/lib/ruby/gems/1.8/gems/rspec-0.9.1/bin/spec" "spec/controllers/se ssion_controller_spec.rb" "spec/controllers/users_controller_spec.rb" "spec/controllers/user_assets_ controller_spec.rb" "spec/helpers/user_assets_helper_spec.rb" "spec/helpers/user_assets_url_helpers_ spec.rb" "spec/models/asset_spec.rb" "spec/models/authenticated_base_spec.rb" "spec/models/user_spec .rb" "spec/views/assets/edit_rhtml_spec.rb" "spec/views/assets/index_rhtml_spec.rb" "spec/views/asse ts/new_rhtml_spec.rb" "spec/views/assets/show_rhtml_spec.rb" "spec/views/users/edit_rhtml_spec.rb" " spec/views/users/index_rhtml_spec.rb" "spec/views/users/new_rhtml_spec.rb" "spec/views/users/show_rh tml_spec.rb" --options "C:/instant_rails_1.7/InstantRails/rails_apps/am2/config/../spec/spec.opts" failed C:\instant_rails_1.7\InstantRails\rails_apps\am2>gem list --local *** LOCAL GEMS *** actionmailer (1.3.3) Service layer for easy email delivery and testing. actionpack (1.13.3) Web-flow and rendering framework putting the VC in MVC. actionwebservice (1.2.3) Web service support for Action Pack. activerecord (1.15.3) Implements the ActiveRecord pattern for ORM. activesupport (1.4.2) Support and utility classes used by the Rails framework. capistrano (1.4.1) Capistrano is a framework and utility for executing commands in parallel on multiple remote machines, via SSH. The primary goal is to simplify and automate the deployment of web applications. cgi_multipart_eof_fix (2.1) Fix an exploitable bug in CGI multipart parsing which affects Ruby <= 1.8.5 when multipart boundary attribute contains a non-halting regular expression string. cmdparse (2.0.2) Advanced command line parser supporting commands fxri (0.3.6) Graphical interface to the RI documentation, with search engine. fxruby (1.6.6) FXRuby is the Ruby binding to the FOX GUI toolkit. gem_plugin (0.2.2) A plugin system based only on rubygems that uses dependencies only highline (1.2.7) HighLine is a high-level command-line IO library. hpricot (0.4) a swift, liberal HTML parser with a fantastic library log4r (1.0.5) Log4r is a comprehensive and flexible logging library for Ruby. mongrel (1.0.1) A small fast HTTP library and server that runs Rails, Camping, Nitro and Iowa apps. mongrel_cluster (0.2.1) Mongrel plugin that provides commands and Capistrano tasks for managing multiple Mongrel processes. mysql (2.7.3) A win32-native build of the MySQL API module for Ruby. needle (1.3.0) Needle is a Dependency Injection/Inversion of Control container for Ruby. It supports both type-2 (setter) and type-3 (constructor) injection. It takes advantage of the dynamic nature of Ruby to provide a rich and flexible approach to injecting dependencies. net-sftp (1.1.0) Net::SFTP is a pure-Ruby implementation of the SFTP client protocol. net-ssh (1.0.10) Net::SSH is a pure-Ruby implementation of the SSH2 client protocol. piston (1.3.3) Piston is a utility that enables merge tracking of remote repositories. rails (1.2.3) Web-application framework with template engine, control-flow layer, and ORM. rake (0.7.2) Ruby based make-like utility. rcov (0.8.0.2) Code coverage analysis tool for Ruby rmagick (1.14.1) RMagick is an interface between the Ruby programming language and the ImageMagick and GraphicsMagick image processing libraries. rspec (0.9.1, 0.8.2) RSpec-0.9.1 (r1880) - BDD for Ruby http://rspec.rubyforge.org/ sources (0.0.1) This package provides download sources for remote gem installation win32-clipboard (0.4.1) A package for interacting with the Windows clipboard win32-dir (0.3.1) Extra constants and methods for the Dir class on Windows. win32-eventlog (0.4.3) Interface for the MS Windows Event Log. win32-file (0.5.3) Extra or redefined methods for the File class on Windows. win32-file-stat (1.2.3) A File::Stat class tailored to MS Windows win32-process (0.5.1) Adds fork, wait, wait2, waitpid, waitpid2 and a special kill method win32-sapi (0.1.3) An interface to the MS SAPI (Sound API) library. win32-sound (0.4.0) A package for playing with sound on Windows. win32console (1.0.8) A library giving the Win32 console ANSI escape sequence support. windows-pr (0.6.2) Windows functions and constants predefined via Win32API ---------------------------------------------------------------------- >Comment By: David Chelimsky (dchelimsky) Date: 2007-06-06 15:26 Message: Fixed in r2086. Re-instanted regexp matching (\|\/) to cover paths generated by the caller method on windows (which appears to generate paths that look like "./path\to\file.rb"). Apologies that this was sitting around. I don't have a winbox set up w/ all this stuff. Guess I need to :( ---------------------------------------------------------------------- Comment By: Larry Kluger (larrykluger) Date: 2007-06-06 14:51 Message: Hi, I hadn't heard back for several weeks so I let it go. (Not yet using rspec.) The path for the rspec file was rails_root/spec/controllers/session_controller_spec.rb (logically speaking) The actual filesystem path was rails_root\spec\controllers\session_controller_spec.rb Regards, Larry ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-06-06 13:16 Message: OK - looks like the problem is in caller providing a path w/ backslashes in windows. I'll bring back the test for (\/|\) in the regexp and that should fix this. ---------------------------------------------------------------------- Comment By: Dominic Sisneros (dsisnero) Date: 2007-06-06 05:30 Message: I am getting similar errors on Windows. running ruby-debug 29 elsif opts[:behaviour_type] 30 behaviour_type = opts[:behaviour_type] 31 elsif opts[:spec_path] =~ /spec\/(#{BEHAVIOUR_CLASSES.keys.join('|')})/ 32 behaviour_type = $1.to_sym 33 else 34 behaviour_type = :default 35 end 36 return BEHAVIOUR_CLASSES[behaviour_type].new(*args, &block) 37 end 38 and (rdb:1) eval opts {:spec_path=>"./spec\controllers\cart_controller_spec.rb:30"} so the behaviour_type gets set to :default ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-06-05 22:49 Message: And what's the file path of the spec? ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-06-05 12:52 Message: Larry - things have moved around a bit since this was raised. Are you still experiencing the same thing with 1.0.x? ---------------------------------------------------------------------- Comment By: Larry Kluger (larrykluger) Date: 2007-05-10 01:20 Message: Hi David, nil seems a bit boring. Please let me know how I can further help track this down. I'm at your service. Larry Source: def create(*args, &block) opts = Hash === args.last ? args.last : {} require 'pp' puts pp(opts) if opts[:shared] key = :default .... result: C:\instant_rails_1.7\InstantRails\rails_apps\am2>ruby script/spec spec/controllers/session_controlle r_spec.rb /config/../vendor/plugins/acts_as_wizard/lib/wizard_setup_filter.rb:2) {} nil C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec/lib/spec/dsl/behaviour_eval.rb:95:in `method_missing': undefined method `controller_name' for # (NoMethodError) from ./spec/controllers/session_controller_spec.rb:6 from C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec/lib/spec/dsl/behaviour.rb:47:in `class_eval' .... ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-05-09 22:44 Message: Hi Larry - what I'm looking for is not the args, but the options: puts opts.inspect or puts pp(opts) Thanks ---------------------------------------------------------------------- Comment By: Larry Kluger (larrykluger) Date: 2007-05-06 20:22 Message: Hi, I changed behaviour_factory.rb to be: def create(*args, &block) opts = Hash === args.last ? args.last : {} require 'pp' puts pp(args) if opts[:shared] .... Here is the output: ["/session/new GET"] nil C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec/lib/spec/dsl/behaviour_eval.rb :95:in `method_missing': undefined method `controller_name' for # ( NoMethodError) .... Larry ---------------------------------------------------------------------- Comment By: Larry Kluger (larrykluger) Date: 2007-05-06 20:13 Message: Hi David, I've deleted the rspec gem and plugin. I then installed ver 0.9.3 as plugins per the installation instructions. I added the puts as requested the result was nil, see trace. Aslak, where do I put the lines describe MyController, :behaviour_type => :controller do end ? I tried describe "SessionController", :behaviour_type => :controller do end just after the require statement in my session_controller_spec.rb but received the same problem. Thank you for your help and time on this puzzler. Larry C:\instant_rails_1.7\InstantRails\rails_apps\am2>ruby script/spec spec/controllers/session_controller_spec.rb nil C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec/lib/spec/dsl/behaviour_eval.rb:95:in `method_missing': undefined method `controller_name' for # (NoMethodError) from ./spec/controllers/session_controller_spec.rb:4 from C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec/lib/spec/dsl/behaviour.rb:47:in `class_eval' from C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec/lib/spec/dsl/behaviour.rb:47:in `eval_behaviour' from C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec/lib/spec/dsl/behaviour.rb:29:in `initialize' from C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec_on_rails/lib/spec/dsl/behaviour_factory.rb:44:in `new' from C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec_on_rails/lib/spec/dsl/behaviour_factory.rb:44:in `create' from C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec/lib/spec/runner/extensions/kernel.rb:4:in `context' from ./spec/controllers/session_controller_spec.rb:3 from C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec/lib/spec/runner/behaviour_runner.rb:85:in `load' from C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec/lib/spec/runner/behaviour_runner.rb:85:in `load_specs' from C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec/lib/spec/runner/behaviour_runner.rb:84:in `each' from C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec/lib/spec/runner/behaviour_runner.rb:84:in `load_specs' from C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec/lib/spec/runner/behaviour_runner.rb:22:in `run' from C:/instant_rails_1.7/InstantRails/rails_apps/am2/vendor/plugins/rspec/lib/spec/runner/command_line.rb:17:in `run' from script/spec:4 C:\instant_rails_1.7\InstantRails\rails_apps\am2> ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-05-06 11:52 Message: "However, I think maybe the call to caller might yield slightly different values on Windows and Linux/OS X." Now THAT would make sense. Larry, would you kindly apply the patch below, run `script/spec spec/controllers/session_controller_spec.rb` and show us the output? Thanks Index: rspec_on_rails/lib/spec/dsl/behaviour_factory.rb =================================================================== --- rspec_on_rails/lib/spec/dsl/behaviour_factory.rb (revision 1893) +++ rspec_on_rails/lib/spec/dsl/behaviour_factory.rb (working copy) @@ -31,6 +31,7 @@ # describe "name", :behaviour_type => :view ... def create(*args, &block) opts = Hash === args.last ? args.last : {} + puts opts[:spec_path] if opts[:shared] key = :default elsif opts[:behaviour_type] ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-05-06 11:44 Message: There shouldn't be any need to support Windows style paths with \. Ruby will always report forward slashes for paths, even on Windows. I don't think Regexp support is different on Windows either, that would never slip through the Ruby community. However, I think maybe the call to caller might yield slightly different values on Windows and Linux/OS X. ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-05-06 11:12 Message: Here's the regexp used to determine the path: /spec(\/|\)+(view|helper|controller|model)s/ The (\/|\) is there to support /unix/style and \windows\style paths. This used be to expressed in 4 separate regexps and this release merged them into one. The specs that describe windows style paths still pass, but I'm running them on *nix. Could there be a difference in the way windows is handling regexps? Also, please try this one windows as well: script/spec spec/controllers/session_controller_spec.rb and let us know if you get the same result. Thanks, David ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-05-06 10:24 Message: I think the source of this bug is in rspec_on_rails/lib/spec/rails/extensions/kernel.rb This is where Spec::Rails tries to guess what kind of spec this is. Perhaps this behaves differently on windows? Could you investigate this please? ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-05-06 10:10 Message: Hint: Spec::Rails mixes in different modules for specs depending on whether it thinks it is a model spec, controller spec, view spec or helper spec. Your error tells me that the controller mixin wasn't included. RSpec decides what to mix in by looking at the folder of your spec. If it's under spec/controllers this should happen automatically (and apparently this is buggy on windows). Just to verify this theory (and work around it until a fix has been committed), you could try to be explicit about it: describe MyController, :behaviour_type => :controller do end ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=10534&group_id=797 From noreply at rubyforge.org Thu Jun 7 12:24:48 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Thu, 7 Jun 2007 12:24:48 -0400 (EDT) Subject: [rspec-devel] [ rspec-Feature Requests-11415 ] rake tasks to run a specific spec Message-ID: <20070607162448.7D8915240AB8@rubyforge.org> Feature Requests item #11415, was opened at 2007-06-07 11:24 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3152&aid=11415&group_id=797 Category: rails plugin Group: None Status: Open Priority: 3 Submitted By: Will Gray (graywh) Assigned to: Nobody (None) Summary: rake tasks to run a specific spec Initial Comment: Currently, 'rake spec:models' runs all the 'spec/models/*_spec.rb' specs. I think it would be grand to be able to run a single spec using rake so I don't have to use the spec command and specify the paths to both the spec and options files. It might look something like 'rake spec:models:user' (or 'model' singular for readability) for the spec in 'spec/models/user_spec.rb'. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3152&aid=11415&group_id=797 From noreply at rubyforge.org Thu Jun 7 18:04:57 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Thu, 7 Jun 2007 18:04:57 -0400 (EDT) Subject: [rspec-devel] [ rspec-Feature Requests-11415 ] rake tasks to run a specific spec Message-ID: <20070607220457.38DF85240ACC@rubyforge.org> Feature Requests item #11415, was opened at 2007-06-07 12:24 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3152&aid=11415&group_id=797 >Category: Rake Group: None >Status: Closed Priority: 3 Submitted By: Will Gray (graywh) >Assigned to: Aslak Helles?y (aslak_hellesoy) Summary: rake tasks to run a specific spec Initial Comment: Currently, 'rake spec:models' runs all the 'spec/models/*_spec.rb' specs. I think it would be grand to be able to run a single spec using rake so I don't have to use the spec command and specify the paths to both the spec and options files. It might look something like 'rake spec:models:user' (or 'model' singular for readability) for the spec in 'spec/models/user_spec.rb'. ---------------------------------------------------------------------- >Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-06-07 18:04 Message: This is possible - we just forgot to document it. Just pass SPEC=path/to/my_spec.rb on the commandline. Example: rake spec SPEC=spec/models/bacon_spec.rb The next release will document this in RSpec core's RDoc (Spec::Rake::SpecTask) ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3152&aid=11415&group_id=797 From aslak.hellesoy at gmail.com Thu Jun 7 18:26:22 2007 From: aslak.hellesoy at gmail.com (aslak hellesoy) Date: Fri, 8 Jun 2007 00:26:22 +0200 Subject: [rspec-devel] RSpec inside JRuby In-Reply-To: References: <8d961d900705230601q6dd50dbdt348e97bcd4a4e7cc@mail.gmail.com> <57c63afe0705230940j36b85a09ge526a9eb46ff7325@mail.gmail.com> <46548BD5.1020007@sun.com> <57c63afe0705231158q18f73831y6d4f4d8747ba86fe@mail.gmail.com> <8d961d900705231220p78934828y3a469aab2431f43c@mail.gmail.com> <57c63afe0705271544l4ab64174i92e870cdcd471ddb@mail.gmail.com> Message-ID: <8d961d900706071526q45ae41b7i86c7b6f622b00ffb@mail.gmail.com> On 5/31/07, Nick Sieger wrote: > On 5/27/07, David Chelimsky wrote: > > All - I need to reiterate Aslak's initial plea. I am guilty of not > > heeding it myself and just decided to check back to make sure jruby > > was still happy and it wasn't. After a not very short time, I found > > the offending commit which changed the html formatting but didn't also > > update the html_formatted-1.8.5-jruby.html file. I've now updated the > > file and made sure everything's cool w/ JRuby, but we have to treat > > this a bit more seriously until they release JRuby 1.0, which is > > soon!!!!!! > > We now have a bit more backup! Finally successful builds in our CI! Woot! > > Now, only issue is that our build isn't triggered by changes to RSpec. > If anyone on the RSpec team is interested in an account on our build > server that would allow you to manually trigger a build, let me know. > > http://jruby.thresher.com/browse/RSPEC-TRUNK-66 > Hi Nick, Can you set me up with an account so I can trigger? Cheers, Aslak > /Nick > _______________________________________________ > rspec-devel mailing list > rspec-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-devel > From noreply at rubyforge.org Fri Jun 8 02:45:04 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Fri, 8 Jun 2007 02:45:04 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11427 ] autotest plugin should be added to category Message-ID: <20070608064504.ADDA15240C46@rubyforge.org> Bugs item #11427, was opened at 2007-06-08 06:45 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11427&group_id=797 Category: None Group: None Status: Open Resolution: None Priority: 3 Submitted By: Scott Taylor (smtlaissezfaire) Assigned to: Nobody (None) Summary: autotest plugin should be added to category Initial Comment: The Autotest::Rspec plugin should be added to the category listing ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11427&group_id=797 From noreply at rubyforge.org Fri Jun 8 02:46:16 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Fri, 8 Jun 2007 02:46:16 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11428 ] autotest with --drb and --color Message-ID: <20070608064616.9209E5240C46@rubyforge.org> Bugs item #11428, was opened at 2007-06-08 06:46 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11428&group_id=797 Category: None Group: None Status: Open Resolution: None Priority: 3 Submitted By: Scott Taylor (smtlaissezfaire) Assigned to: Nobody (None) Summary: autotest with --drb and --color Initial Comment: No color is seen when using autotest with an options file that contains both --drb and --color ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11428&group_id=797 From noreply at rubyforge.org Fri Jun 8 05:14:15 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Fri, 8 Jun 2007 05:14:15 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11427 ] autotest plugin should be added to category Message-ID: <20070608091415.D4F17524098A@rubyforge.org> Bugs item #11427, was opened at 2007-06-08 02:45 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11427&group_id=797 >Category: Autotest Group: None >Status: Closed >Resolution: Accepted Priority: 3 Submitted By: Scott Taylor (smtlaissezfaire) >Assigned to: Aslak Helles?y (aslak_hellesoy) Summary: autotest plugin should be added to category Initial Comment: The Autotest::Rspec plugin should be added to the category listing ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11427&group_id=797 From noreply at rubyforge.org Fri Jun 8 05:14:45 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Fri, 8 Jun 2007 05:14:45 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11428 ] autotest with --drb and --color Message-ID: <20070608091445.BF83F524098A@rubyforge.org> Bugs item #11428, was opened at 2007-06-08 02:46 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11428&group_id=797 Category: None Group: None Status: Open Resolution: None Priority: 3 Submitted By: Scott Taylor (smtlaissezfaire) Assigned to: Nobody (None) Summary: autotest with --drb and --color Initial Comment: No color is seen when using autotest with an options file that contains both --drb and --color ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-06-08 05:14 Message: Before investigating this we need to know the versions of all relevant software you are using, for example: * OS X 10.4.9 * Ruby 1.8.6 * RSpec 1.8.2 or RSpec trunk r1643 * Spec::Rails 1.8.2 or Spec::Rails tag r1234... * Rails 1.2.3 or Rails edge r5645 * Whatever other relevant software. Without this information it's like solving 1 equation (your question) with 5 unknown variables (the versions). We strongly recommend that you use the latest released version of RSpec, alternatively the subversion trunk (if you're the bleeding edge kind of person). ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11428&group_id=797 From noreply at rubyforge.org Fri Jun 8 06:55:45 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Fri, 8 Jun 2007 06:55:45 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11428 ] autotest with --drb and --color Message-ID: <20070608105545.5BBD252409E9@rubyforge.org> Bugs item #11428, was opened at 2007-06-08 06:46 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11428&group_id=797 Category: None Group: None Status: Open Resolution: None Priority: 3 Submitted By: Scott Taylor (smtlaissezfaire) Assigned to: Nobody (None) Summary: autotest with --drb and --color Initial Comment: No color is seen when using autotest with an options file that contains both --drb and --color ---------------------------------------------------------------------- >Comment By: Scott Taylor (smtlaissezfaire) Date: 2007-06-08 10:55 Message: OS X.4.9 Ruby 1.8.6 rspec trunk (@ rev. 2087) rspec_on_rails trunk autotest 3.6.0 This bug has been around since Nick Seiger's original plugin. David C. and I have talked about it before on the mailing list. I would have written a spec, but I got intimidated by the idea of mocking DRB, Autotest, and color values given by the terminal. Sorry that you had to drop in that boilerplate message. I'm sorry that it's even a boiler plate message. ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-06-08 09:14 Message: Before investigating this we need to know the versions of all relevant software you are using, for example: * OS X 10.4.9 * Ruby 1.8.6 * RSpec 1.8.2 or RSpec trunk r1643 * Spec::Rails 1.8.2 or Spec::Rails tag r1234... * Rails 1.2.3 or Rails edge r5645 * Whatever other relevant software. Without this information it's like solving 1 equation (your question) with 5 unknown variables (the versions). We strongly recommend that you use the latest released version of RSpec, alternatively the subversion trunk (if you're the bleeding edge kind of person). ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11428&group_id=797 From noreply at rubyforge.org Fri Jun 8 17:12:22 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Fri, 8 Jun 2007 17:12:22 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11467 ] rake aborted! Message-ID: <20070608211222.29F185240AB9@rubyforge.org> Bugs item #11467, was opened at 2007-06-08 16:12 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11467&group_id=797 Category: rails plugin Group: None Status: Open Resolution: None Priority: 3 Submitted By: Will Gray (graywh) Assigned to: Nobody (None) Summary: rake aborted! Initial Comment: The specs run fine, but rake gives an error message after "X examples, N failure". 10 examples, 1 failure rake aborted! Command ruby -I"/home/graywh/src/rails/project/vendor/plugins/rspec/lib" "/home/graywh/src/rails/project/vendor/plugins/rspec/bin/spec" "spec/models/person_spec.rb" --options "/home/graywh/src/rails/project/config/../spec/spec.opts" failed /home/graywh/src/rails/project/vendor/plugins/rspec/lib/spec/rake/spectask.rb:132:in `define' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:823:in `verbose' /home/graywh/src/rails/project/vendor/plugins/rspec/lib/spec/rake/spectask.rb:106:in `define' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:392:in `call' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:392:in `execute' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:392:in `each' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:392:in `execute' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:362:in `invoke' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:355:in `synchronize' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:355:in `invoke' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1739:in `top_level' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1739:in `each' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1739:in `top_level' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1761:in `standard_exception_handling' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1733:in `top_level' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1711:in `run' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1761:in `standard_exception_handling' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1708:in `run' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/bin/rake:7 /usr/bin/rake:16:in `load' /usr/bin/rake:16 ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11467&group_id=797 From noreply at rubyforge.org Fri Jun 8 17:27:23 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Fri, 8 Jun 2007 17:27:23 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11467 ] rake aborted! Message-ID: <20070608212723.C8C3E5240B06@rubyforge.org> Bugs item #11467, was opened at 2007-06-08 21:12 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11467&group_id=797 Category: rails plugin Group: None >Status: Closed >Resolution: Rejected Priority: 3 Submitted By: Will Gray (graywh) Assigned to: Nobody (None) Summary: rake aborted! Initial Comment: The specs run fine, but rake gives an error message after "X examples, N failure". 10 examples, 1 failure rake aborted! Command ruby -I"/home/graywh/src/rails/project/vendor/plugins/rspec/lib" "/home/graywh/src/rails/project/vendor/plugins/rspec/bin/spec" "spec/models/person_spec.rb" --options "/home/graywh/src/rails/project/config/../spec/spec.opts" failed /home/graywh/src/rails/project/vendor/plugins/rspec/lib/spec/rake/spectask.rb:132:in `define' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:823:in `verbose' /home/graywh/src/rails/project/vendor/plugins/rspec/lib/spec/rake/spectask.rb:106:in `define' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:392:in `call' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:392:in `execute' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:392:in `each' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:392:in `execute' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:362:in `invoke' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:355:in `synchronize' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:355:in `invoke' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1739:in `top_level' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1739:in `each' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1739:in `top_level' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1761:in `standard_exception_handling' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1733:in `top_level' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1711:in `run' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1761:in `standard_exception_handling' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1708:in `run' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/bin/rake:7 /usr/bin/rake:16:in `load' /usr/bin/rake:16 ---------------------------------------------------------------------- >Comment By: David Chelimsky (dchelimsky) Date: 2007-06-08 21:27 Message: Closing this because there is no information here that we can use to help you. Please feel free to re-open with version information plus some indication that it's an rspec problem. For example, if you do this: script/spec spec Do you get any weird errors? ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11467&group_id=797 From briandg at gmail.com Fri Jun 8 20:08:59 2007 From: briandg at gmail.com (Brian) Date: Fri, 8 Jun 2007 17:08:59 -0700 Subject: [rspec-devel] mock_model with inheritance (patch) Message-ID: I'm new to mocking and stubbing, and I'm still learning about good test/spec design, so my problem and solution might seem naive for any number of reasons. My solution was to modify mock_model so that mocked ActiveRecord objects could pretend to be part of inheritance hierarchies. Here's what the problem was. I have two ActiveRecord models associated through a join model. Let's say they are Party and ContactMethod, and ContactMethod has subclasses like PostalAddress, EmailAddress, PhoneNumber, etc. Let's say I've defined some convenience methods to access a Party's specific kinds of contact_methods.... class Party < ActiveRecord::Base # ... has_many :contact_methods, :through => :join_model def postal_addresses contact_methods.select { |cm| cm.is_a?(PostalAddress) } end # etc ... end (There may be a problem with my OO design here, but whatever.) Originally I wrote my specs using all real ActiveRecord objects, which worked okay until I had > 350 examples in spec/models that took > 20 seconds to run. I knew I'd eventually have to figure out what mocks were all about before I started working on controllers, and the speed issue finally galvanized me. I started with something like this: describe "Party with contact methods" do before do @jane = Party.create :first_name => "Jane", :last_name => "Doe" @postal = mock_model(PostalAddress) @jane.contact_methods << @postal end end Right away that raises ActiveRecord::AssociationTypeMismatch, because the collection expects ContactMethod objects, and the mock object doesn't know that a PostalAddress is also a kind of ContactMethod. Nor will this work: describe "Party with contact methods" do before do @jane = Party.create :first_name => "Jane", :last_name => "Doe" @postal = mock_model(ContactMethod) @jane.contact_methods << @postal end it "should be able to return specific kinds of contact methods" do @jane.should have(1).postal_addresses end end The example fails, obviously, because @postal thinks it's just a ContactMethod. Hmm, how can a mocked model say "Yes, I am a ContactMethod" and also "Yes, I am a PostalAddress"? I suppose I could do it "should be able to return specific kinds of contact methods" do @postal.stub!(:is_a?).and_return(true) @jane.should have(1).postal_addresses end but that seems like cheating, or something, and it also seems too drastic. The mock at that point would say yes to anything--"Yes, I am a Hamburger, a Frankfurter, and a Donut." I looked up the definition of mock_model and saw.... def mock_model(model_class, stubs = {}) # ... m.send(:__mock_proxy).instance_eval <<-CODE def @target.is_a?(other) other == #{model_class} end # ... end That definition of #is_a? seemed more like #instance_of?. I tried this instead: def mock_model(model_class, *args) stubs = args.last.is_a?(Hash) ? args.pop : {} class_hierarchy = [model_class] + args # ... as before ... m.send(:__mock_proxy).instance_eval <<-CODE def @target.is_a?(other) #{class_hierarchy.inspect}.include?(other) end # ... end And then I wrote my spec like this: describe "Party with contact methods" do before do @jane = Party.create :first_name => "Jane", :last_name => "Doe" @postal = mock_model(PostalAddress, ContactMethod) @jane.contact_methods << @postal end it "should be able to return specific kinds of contact methods" do @jane.should have(1).postal_addresses end end And it worked. So if this seems good, I've attached a patch. If it seems horribly wrong, can someone tell me why? Thanks, Brian -------------- next part -------------- A non-text attachment was scrubbed... Name: mock_model_with_inheritance.patch Type: application/octet-stream Size: 1645 bytes Desc: not available Url : http://rubyforge.org/pipermail/rspec-devel/attachments/20070608/b0d13379/attachment-0001.obj From noreply at rubyforge.org Sat Jun 9 20:54:05 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Sat, 9 Jun 2007 20:54:05 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11428 ] autotest with --drb and --color Message-ID: <20070610005405.198F4A970004@rubyforge.org> Bugs item #11428, was opened at 2007-06-08 06:46 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11428&group_id=797 Category: None Group: None Status: Open Resolution: None Priority: 3 Submitted By: Scott Taylor (smtlaissezfaire) Assigned to: Nobody (None) Summary: autotest with --drb and --color Initial Comment: No color is seen when using autotest with an options file that contains both --drb and --color ---------------------------------------------------------------------- >Comment By: Scott Taylor (smtlaissezfaire) Date: 2007-06-10 00:54 Message: OS X.4.9 Ruby 1.8.6 rspec trunk (@ rev. 2087) rspec_on_rails trunk autotest 3.6.0 This bug has been around since Nick Seiger's original plugin. David C. and I have talked about it before on the mailing list. I would have written a spec, but I got intimidated by the idea of mocking DRB, Autotest, and color values given by the terminal. Sorry that you had to drop in that boilerplate message. I'm sorry that it's even a boiler plate message. ---------------------------------------------------------------------- Comment By: Scott Taylor (smtlaissezfaire) Date: 2007-06-08 10:55 Message: OS X.4.9 Ruby 1.8.6 rspec trunk (@ rev. 2087) rspec_on_rails trunk autotest 3.6.0 This bug has been around since Nick Seiger's original plugin. David C. and I have talked about it before on the mailing list. I would have written a spec, but I got intimidated by the idea of mocking DRB, Autotest, and color values given by the terminal. Sorry that you had to drop in that boilerplate message. I'm sorry that it's even a boiler plate message. ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-06-08 09:14 Message: Before investigating this we need to know the versions of all relevant software you are using, for example: * OS X 10.4.9 * Ruby 1.8.6 * RSpec 1.8.2 or RSpec trunk r1643 * Spec::Rails 1.8.2 or Spec::Rails tag r1234... * Rails 1.2.3 or Rails edge r5645 * Whatever other relevant software. Without this information it's like solving 1 equation (your question) with 5 unknown variables (the versions). We strongly recommend that you use the latest released version of RSpec, alternatively the subversion trunk (if you're the bleeding edge kind of person). ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11428&group_id=797 From noreply at rubyforge.org Sun Jun 10 09:52:07 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Sun, 10 Jun 2007 09:52:07 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11488 ] rspec-1.0.5.tgz is broken Message-ID: <20070610135207.B8B945240ACA@rubyforge.org> Bugs item #11488, was opened at 2007-06-10 13:52 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11488&group_id=797 Category: None Group: None Status: Open Resolution: None Priority: 3 Submitted By: David Chelimsky (dchelimsky) Assigned to: Nobody (None) Summary: rspec-1.0.5.tgz is broken Initial Comment: >From email on the rspec-devel list: I noticed that rspec-1.0.5.tgz is broken: $ wget -O http://rubyforge.org/frs/download.php/21457/rspec-1.0.5.tgz ... 12:24:11 (7.21 KB/s) - `rspec-1.0.5.tgz' saved [115639/115639] $ md5sum rspec-1.0.5.tgz 1851730ca994cc31fd865f8894a2510e rspec-1.0.5.tgz $ tar xzf rspec-1.0.5.tgz gzip: stdin: decompression OK, trailing garbage ignored tar: Child returned status 2 tar: Error exit delayed from previous errors Please provide a gzipped tarball that unpacks cleanly. The same problem exists with older tgz's, btw. Thanks, Tilman ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11488&group_id=797 From tilman2 at googlemail.com Sun Jun 10 06:28:50 2007 From: tilman2 at googlemail.com (Tilman Sauerbeck) Date: Sun, 10 Jun 2007 12:28:50 +0200 Subject: [rspec-devel] rspec-1.0.5.tgz is broken Message-ID: <29271b340706100328w1ae6e3c0lbece6665f58035b1@mail.gmail.com> Hi, I noticed that rspec-1.0.5.tgz is broken: $ wget -O http://rubyforge.org/frs/download.php/21457/rspec-1.0.5.tgz ... 12:24:11 (7.21 KB/s) - `rspec-1.0.5.tgz' saved [115639/115639] $ md5sum rspec-1.0.5.tgz 1851730ca994cc31fd865f8894a2510e rspec-1.0.5.tgz $ tar xzf rspec-1.0.5.tgz gzip: stdin: decompression OK, trailing garbage ignored tar: Child returned status 2 tar: Error exit delayed from previous errors Please provide a gzipped tarball that unpacks cleanly. The same problem exists with older tgz's, btw. Thanks, Tilman From dchelimsky at gmail.com Sun Jun 10 09:55:31 2007 From: dchelimsky at gmail.com (David Chelimsky) Date: Sun, 10 Jun 2007 08:55:31 -0500 Subject: [rspec-devel] rspec-1.0.5.tgz is broken In-Reply-To: <29271b340706100328w1ae6e3c0lbece6665f58035b1@mail.gmail.com> References: <29271b340706100328w1ae6e3c0lbece6665f58035b1@mail.gmail.com> Message-ID: <57c63afe0706100655v244c4a7cwae46bb7205b04042@mail.gmail.com> On 6/10/07, Tilman Sauerbeck wrote: > Hi, > I noticed that rspec-1.0.5.tgz is broken: > > $ wget -O http://rubyforge.org/frs/download.php/21457/rspec-1.0.5.tgz > ... > 12:24:11 (7.21 KB/s) - `rspec-1.0.5.tgz' saved [115639/115639] > > $ md5sum rspec-1.0.5.tgz > 1851730ca994cc31fd865f8894a2510e rspec-1.0.5.tgz > > $ tar xzf rspec-1.0.5.tgz > gzip: stdin: decompression OK, trailing garbage ignored > tar: Child returned status 2 > tar: Error exit delayed from previous errors > > Please provide a gzipped tarball that unpacks cleanly. > The same problem exists with older tgz's, btw. > > Thanks, > Tilman I added this to the tracker: http://rubyforge.org/tracker/index.php?func=detail&aid=11488&group_id=797&atid=3149 In the future, please put bug reports in the tracker instead of this list as that is the best way to ensure that they get on and stays on the radar. Thanks, David From noreply at rubyforge.org Sun Jun 10 10:22:02 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Sun, 10 Jun 2007 10:22:02 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11488 ] rspec-1.0.5.tgz is broken Message-ID: <20070610142203.1CA1A5240B18@rubyforge.org> Bugs item #11488, was opened at 2007-06-10 13:52 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11488&group_id=797 Category: None Group: None Status: Open Resolution: None Priority: 3 Submitted By: David Chelimsky (dchelimsky) Assigned to: Nobody (None) Summary: rspec-1.0.5.tgz is broken Initial Comment: >From email on the rspec-devel list: I noticed that rspec-1.0.5.tgz is broken: $ wget -O http://rubyforge.org/frs/download.php/21457/rspec-1.0.5.tgz ... 12:24:11 (7.21 KB/s) - `rspec-1.0.5.tgz' saved [115639/115639] $ md5sum rspec-1.0.5.tgz 1851730ca994cc31fd865f8894a2510e rspec-1.0.5.tgz $ tar xzf rspec-1.0.5.tgz gzip: stdin: decompression OK, trailing garbage ignored tar: Child returned status 2 tar: Error exit delayed from previous errors Please provide a gzipped tarball that unpacks cleanly. The same problem exists with older tgz's, btw. Thanks, Tilman ---------------------------------------------------------------------- >Comment By: David Chelimsky (dchelimsky) Date: 2007-06-10 14:22 Message: I get the same problem with the tgz's up on rubyforge, but when I create them locally they unpack fine. Not sure where things are getting corrupted yet, but looking into it. If anybody has similar experience (i.e. packing/unpacking locally is fine but problems occur once uploaded and downloaded), please advise. Thanks, David ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11488&group_id=797 From noreply at rubyforge.org Mon Jun 11 04:01:30 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Mon, 11 Jun 2007 04:01:30 -0400 (EDT) Subject: [rspec-devel] [ rspec-Patches-11500 ] Documentation: no rails integration specs in 1.0 Message-ID: <20070611080130.EB9395240BE4@rubyforge.org> Patches item #11500, was opened at 2007-06-11 10:01 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3151&aid=11500&group_id=797 Category: None Group: None Status: Open Resolution: None Priority: 3 Submitted By: Antti Tarvainen (tarvaina) Assigned to: Nobody (None) Summary: Documentation: no rails integration specs in 1.0 Initial Comment: This is a tiny documentation patch. The page http://rspec.rubyforge.org/documentation/rails/writing/integration.html erroneously says that integration specs are being planned for 1.0 release. This patch fixes that. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3151&aid=11500&group_id=797 From noreply at rubyforge.org Mon Jun 11 07:15:49 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Mon, 11 Jun 2007 07:15:49 -0400 (EDT) Subject: [rspec-devel] [ rspec-Patches-11500 ] Documentation: no rails integration specs in 1.0 Message-ID: <20070611111549.F38455240A35@rubyforge.org> Patches item #11500, was opened at 2007-06-11 08:01 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3151&aid=11500&group_id=797 Category: None Group: None >Status: Closed >Resolution: Accepted Priority: 3 Submitted By: Antti Tarvainen (tarvaina) >Assigned to: David Chelimsky (dchelimsky) Summary: Documentation: no rails integration specs in 1.0 Initial Comment: This is a tiny documentation patch. The page http://rspec.rubyforge.org/documentation/rails/writing/integration.html erroneously says that integration specs are being planned for 1.0 release. This patch fixes that. ---------------------------------------------------------------------- >Comment By: David Chelimsky (dchelimsky) Date: 2007-06-11 11:15 Message: Applied in r2088. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3151&aid=11500&group_id=797 From noreply at rubyforge.org Mon Jun 11 10:18:01 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Mon, 11 Jun 2007 10:18:01 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11467 ] rake aborted! Message-ID: <20070611141801.354D45240A73@rubyforge.org> Bugs item #11467, was opened at 2007-06-08 16:12 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11467&group_id=797 Category: rails plugin Group: None Status: Closed Resolution: Rejected Priority: 3 Submitted By: Will Gray (graywh) Assigned to: Nobody (None) Summary: rake aborted! Initial Comment: The specs run fine, but rake gives an error message after "X examples, N failure". 10 examples, 1 failure rake aborted! Command ruby -I"/home/graywh/src/rails/project/vendor/plugins/rspec/lib" "/home/graywh/src/rails/project/vendor/plugins/rspec/bin/spec" "spec/models/person_spec.rb" --options "/home/graywh/src/rails/project/config/../spec/spec.opts" failed /home/graywh/src/rails/project/vendor/plugins/rspec/lib/spec/rake/spectask.rb:132:in `define' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:823:in `verbose' /home/graywh/src/rails/project/vendor/plugins/rspec/lib/spec/rake/spectask.rb:106:in `define' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:392:in `call' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:392:in `execute' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:392:in `each' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:392:in `execute' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:362:in `invoke' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:355:in `synchronize' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:355:in `invoke' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1739:in `top_level' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1739:in `each' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1739:in `top_level' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1761:in `standard_exception_handling' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1733:in `top_level' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1711:in `run' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1761:in `standard_exception_handling' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1708:in `run' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/bin/rake:7 /usr/bin/rake:16:in `load' /usr/bin/rake:16 ---------------------------------------------------------------------- >Comment By: Will Gray (graywh) Date: 2007-06-11 09:18 Message: I'm using the latest version from svn://rubyforge.org/var/svn/rspec/tags/CURRENT/rspec_on_rails. The problem only occurs when there is at least one failing example. It doesn't matter if I use 'rake spec', 'rake spec:models', or 'rake spec SPEC=spec/models/my_model_spec.rb'. Using 'script/spec' gives no errors. My spec/spec.opts file contains the following options: --colour --format specdoc --loadby mtime ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-06-08 16:27 Message: Closing this because there is no information here that we can use to help you. Please feel free to re-open with version information plus some indication that it's an rspec problem. For example, if you do this: script/spec spec Do you get any weird errors? ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11467&group_id=797 From noreply at rubyforge.org Mon Jun 11 13:42:43 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Mon, 11 Jun 2007 13:42:43 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11467 ] rake aborted! Message-ID: <20070611174243.EFFE05240CA0@rubyforge.org> Bugs item #11467, was opened at 2007-06-08 16:12 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11467&group_id=797 Category: rails plugin Group: None >Status: Open Resolution: Rejected Priority: 3 Submitted By: Will Gray (graywh) Assigned to: Nobody (None) Summary: rake aborted! Initial Comment: The specs run fine, but rake gives an error message after "X examples, N failure". 10 examples, 1 failure rake aborted! Command ruby -I"/home/graywh/src/rails/project/vendor/plugins/rspec/lib" "/home/graywh/src/rails/project/vendor/plugins/rspec/bin/spec" "spec/models/person_spec.rb" --options "/home/graywh/src/rails/project/config/../spec/spec.opts" failed /home/graywh/src/rails/project/vendor/plugins/rspec/lib/spec/rake/spectask.rb:132:in `define' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:823:in `verbose' /home/graywh/src/rails/project/vendor/plugins/rspec/lib/spec/rake/spectask.rb:106:in `define' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:392:in `call' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:392:in `execute' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:392:in `each' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:392:in `execute' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:362:in `invoke' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:355:in `synchronize' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:355:in `invoke' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1739:in `top_level' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1739:in `each' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1739:in `top_level' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1761:in `standard_exception_handling' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1733:in `top_level' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1711:in `run' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1761:in `standard_exception_handling' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1708:in `run' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/bin/rake:7 /usr/bin/rake:16:in `load' /usr/bin/rake:16 ---------------------------------------------------------------------- >Comment By: Will Gray (graywh) Date: 2007-06-11 12:42 Message: When there is at least one failure, spec's exit status is 1. That causes system() to throw an exception at rspec/lib/spec/rake/spectasks.rb:130 even though nothing actually went wrong. ---------------------------------------------------------------------- Comment By: Will Gray (graywh) Date: 2007-06-11 09:18 Message: I'm using the latest version from svn://rubyforge.org/var/svn/rspec/tags/CURRENT/rspec_on_rails. The problem only occurs when there is at least one failing example. It doesn't matter if I use 'rake spec', 'rake spec:models', or 'rake spec SPEC=spec/models/my_model_spec.rb'. Using 'script/spec' gives no errors. My spec/spec.opts file contains the following options: --colour --format specdoc --loadby mtime ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-06-08 16:27 Message: Closing this because there is no information here that we can use to help you. Please feel free to re-open with version information plus some indication that it's an rspec problem. For example, if you do this: script/spec spec Do you get any weird errors? ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11467&group_id=797 From noreply at rubyforge.org Mon Jun 11 16:06:37 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Mon, 11 Jun 2007 16:06:37 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11508 ] Exceptions are not raised for Controller Specs Message-ID: <20070611200638.018A75240CAC@rubyforge.org> Bugs item #11508, was opened at 2007-06-11 13:06 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11508&group_id=797 Category: rails plugin Group: None Status: Open Resolution: None Priority: 3 Submitted By: Brian Takita (btakita) Assigned to: Nobody (None) Summary: Exceptions are not raised for Controller Specs Initial Comment: The issue is old_rescue_action is called if the exception is not a MockExpectationError. This makes it hard to find exceptions in controllers. The standard Rails test behaviour is to always raise an exception. It used to work in 0.9.4. module ActionController module Rescue protected alias old_rescue_action rescue_action def rescue_action(exception) raise exception if exception.is_a?(Spec::Mocks::MockExpectationError) old_rescue_action(exception) end end end ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11508&group_id=797 From noreply at rubyforge.org Mon Jun 11 16:17:01 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Mon, 11 Jun 2007 16:17:01 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11508 ] Exceptions are not raised for Controller Specs Message-ID: <20070611201701.4655B5240CB5@rubyforge.org> Bugs item #11508, was opened at 2007-06-11 20:06 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11508&group_id=797 Category: rails plugin Group: None Status: Open Resolution: None Priority: 3 Submitted By: Brian Takita (btakita) Assigned to: Nobody (None) Summary: Exceptions are not raised for Controller Specs Initial Comment: The issue is old_rescue_action is called if the exception is not a MockExpectationError. This makes it hard to find exceptions in controllers. The standard Rails test behaviour is to always raise an exception. It used to work in 0.9.4. module ActionController module Rescue protected alias old_rescue_action rescue_action def rescue_action(exception) raise exception if exception.is_a?(Spec::Mocks::MockExpectationError) old_rescue_action(exception) end end end ---------------------------------------------------------------------- >Comment By: David Chelimsky (dchelimsky) Date: 2007-06-11 20:17 Message: If you run script/generate rspec you'll see the following in spec_helper.rb: config.before(:each, :behaviour_type => :controller) do raise_controller_errors end That makes things work as you suspect, and allows you use your own rescue_action if you want to. This is a bit experimental and hence not very well doc'd, so I'll leave this open. But you can use that for now. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11508&group_id=797 From noreply at rubyforge.org Mon Jun 11 16:18:59 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Mon, 11 Jun 2007 16:18:59 -0400 (EDT) Subject: [rspec-devel] [ rspec-Patches-11509 ] Documentation - RSpec requires hpricot Message-ID: <20070611201859.986E65240CB5@rubyforge.org> Patches item #11509, was opened at 2007-06-11 20:18 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3151&aid=11509&group_id=797 Category: None Group: None Status: Open Resolution: None Priority: 3 Submitted By: Scott Taylor (smtlaissezfaire) Assigned to: Nobody (None) Summary: Documentation - RSpec requires hpricot Initial Comment: RSpec requires hpricot. This adds a note to rspec/README. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3151&aid=11509&group_id=797 From noreply at rubyforge.org Mon Jun 11 16:36:29 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Mon, 11 Jun 2007 16:36:29 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11467 ] rake aborted! Message-ID: <20070611203629.4B5175240CB8@rubyforge.org> Bugs item #11467, was opened at 2007-06-08 17:12 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11467&group_id=797 Category: rails plugin Group: None Status: Open Resolution: Rejected Priority: 3 Submitted By: Will Gray (graywh) Assigned to: Nobody (None) Summary: rake aborted! Initial Comment: The specs run fine, but rake gives an error message after "X examples, N failure". 10 examples, 1 failure rake aborted! Command ruby -I"/home/graywh/src/rails/project/vendor/plugins/rspec/lib" "/home/graywh/src/rails/project/vendor/plugins/rspec/bin/spec" "spec/models/person_spec.rb" --options "/home/graywh/src/rails/project/config/../spec/spec.opts" failed /home/graywh/src/rails/project/vendor/plugins/rspec/lib/spec/rake/spectask.rb:132:in `define' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:823:in `verbose' /home/graywh/src/rails/project/vendor/plugins/rspec/lib/spec/rake/spectask.rb:106:in `define' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:392:in `call' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:392:in `execute' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:392:in `each' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:392:in `execute' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:362:in `invoke' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:355:in `synchronize' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:355:in `invoke' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1739:in `top_level' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1739:in `each' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1739:in `top_level' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1761:in `standard_exception_handling' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1733:in `top_level' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1711:in `run' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1761:in `standard_exception_handling' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1708:in `run' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/bin/rake:7 /usr/bin/rake:16:in `load' /usr/bin/rake:16 ---------------------------------------------------------------------- >Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-06-11 16:36 Message: "When there is at least one failure, spec's exit status is 1. That causes system() to throw an exception at rspec/lib/spec/rake/spectasks.rb:130 even though nothing actually went wrong." But something *did* go wrong. There was a failure in your specs, and that is wrong. Are you saying that you want Rake to always execute successfully, even when there are spec failures? How are we supposed to detect errors? You can always set the fail_on_error flag if you want Rake to continue despite spec errors. Or am I completely misunderstanding you? ---------------------------------------------------------------------- Comment By: Will Gray (graywh) Date: 2007-06-11 13:42 Message: When there is at least one failure, spec's exit status is 1. That causes system() to throw an exception at rspec/lib/spec/rake/spectasks.rb:130 even though nothing actually went wrong. ---------------------------------------------------------------------- Comment By: Will Gray (graywh) Date: 2007-06-11 10:18 Message: I'm using the latest version from svn://rubyforge.org/var/svn/rspec/tags/CURRENT/rspec_on_rails. The problem only occurs when there is at least one failing example. It doesn't matter if I use 'rake spec', 'rake spec:models', or 'rake spec SPEC=spec/models/my_model_spec.rb'. Using 'script/spec' gives no errors. My spec/spec.opts file contains the following options: --colour --format specdoc --loadby mtime ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-06-08 17:27 Message: Closing this because there is no information here that we can use to help you. Please feel free to re-open with version information plus some indication that it's an rspec problem. For example, if you do this: script/spec spec Do you get any weird errors? ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11467&group_id=797 From noreply at rubyforge.org Mon Jun 11 16:52:30 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Mon, 11 Jun 2007 16:52:30 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11488 ] rspec-1.0.5.tgz is broken Message-ID: <20070611205230.AF5A25240CB7@rubyforge.org> Bugs item #11488, was opened at 2007-06-10 09:52 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11488&group_id=797 Category: None Group: None Status: Open Resolution: None Priority: 3 Submitted By: David Chelimsky (dchelimsky) >Assigned to: Aslak Helles?y (aslak_hellesoy) Summary: rspec-1.0.5.tgz is broken Initial Comment: >From email on the rspec-devel list: I noticed that rspec-1.0.5.tgz is broken: $ wget -O http://rubyforge.org/frs/download.php/21457/rspec-1.0.5.tgz ... 12:24:11 (7.21 KB/s) - `rspec-1.0.5.tgz' saved [115639/115639] $ md5sum rspec-1.0.5.tgz 1851730ca994cc31fd865f8894a2510e rspec-1.0.5.tgz $ tar xzf rspec-1.0.5.tgz gzip: stdin: decompression OK, trailing garbage ignored tar: Child returned status 2 tar: Error exit delayed from previous errors Please provide a gzipped tarball that unpacks cleanly. The same problem exists with older tgz's, btw. Thanks, Tilman ---------------------------------------------------------------------- >Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-06-11 16:52 Message: It looks like all the .tgz files are broken: rspec-1.0.5.tgz RSpec-1.0.5.tmbundle.tgz rspec_on_rails-1.0.5.tgz The other files are fine, even the bigger rspec-1.0.5.zip. I therefore don't hink it has to do with size. Something isn't handling the tgz *type* properly. It could be the MetaProject upload logic or something at Rubyforge. Rake seems to build things ok locally. Maybe we changing it to tar.gz and/or using the "Source.gz" RubyForge type will change things? ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-06-10 10:22 Message: I get the same problem with the tgz's up on rubyforge, but when I create them locally they unpack fine. Not sure where things are getting corrupted yet, but looking into it. If anybody has similar experience (i.e. packing/unpacking locally is fine but problems occur once uploaded and downloaded), please advise. Thanks, David ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11488&group_id=797 From noreply at rubyforge.org Mon Jun 11 17:36:15 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Mon, 11 Jun 2007 17:36:15 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11467 ] rake aborted! Message-ID: <20070611213615.6F9695240CBC@rubyforge.org> Bugs item #11467, was opened at 2007-06-08 16:12 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11467&group_id=797 Category: rails plugin Group: None Status: Open Resolution: Rejected Priority: 3 Submitted By: Will Gray (graywh) Assigned to: Nobody (None) Summary: rake aborted! Initial Comment: The specs run fine, but rake gives an error message after "X examples, N failure". 10 examples, 1 failure rake aborted! Command ruby -I"/home/graywh/src/rails/project/vendor/plugins/rspec/lib" "/home/graywh/src/rails/project/vendor/plugins/rspec/bin/spec" "spec/models/person_spec.rb" --options "/home/graywh/src/rails/project/config/../spec/spec.opts" failed /home/graywh/src/rails/project/vendor/plugins/rspec/lib/spec/rake/spectask.rb:132:in `define' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:823:in `verbose' /home/graywh/src/rails/project/vendor/plugins/rspec/lib/spec/rake/spectask.rb:106:in `define' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:392:in `call' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:392:in `execute' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:392:in `each' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:392:in `execute' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:362:in `invoke' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:355:in `synchronize' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:355:in `invoke' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1739:in `top_level' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1739:in `each' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1739:in `top_level' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1761:in `standard_exception_handling' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1733:in `top_level' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1711:in `run' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1761:in `standard_exception_handling' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1708:in `run' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/bin/rake:7 /usr/bin/rake:16:in `load' /usr/bin/rake:16 ---------------------------------------------------------------------- >Comment By: Will Gray (graywh) Date: 2007-06-11 16:36 Message: Then I find the double-reporting of failed specs confusing. Printing a message to stdout such as "109 examples, 2 failures" already tells me a spec failed. Following that with "rake aborted! Command ... failed" made me think something [other than a failed spec] went wrong. How can I use the fail_on_error flag? ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-06-11 15:36 Message: "When there is at least one failure, spec's exit status is 1. That causes system() to throw an exception at rspec/lib/spec/rake/spectasks.rb:130 even though nothing actually went wrong." But something *did* go wrong. There was a failure in your specs, and that is wrong. Are you saying that you want Rake to always execute successfully, even when there are spec failures? How are we supposed to detect errors? You can always set the fail_on_error flag if you want Rake to continue despite spec errors. Or am I completely misunderstanding you? ---------------------------------------------------------------------- Comment By: Will Gray (graywh) Date: 2007-06-11 12:42 Message: When there is at least one failure, spec's exit status is 1. That causes system() to throw an exception at rspec/lib/spec/rake/spectasks.rb:130 even though nothing actually went wrong. ---------------------------------------------------------------------- Comment By: Will Gray (graywh) Date: 2007-06-11 09:18 Message: I'm using the latest version from svn://rubyforge.org/var/svn/rspec/tags/CURRENT/rspec_on_rails. The problem only occurs when there is at least one failing example. It doesn't matter if I use 'rake spec', 'rake spec:models', or 'rake spec SPEC=spec/models/my_model_spec.rb'. Using 'script/spec' gives no errors. My spec/spec.opts file contains the following options: --colour --format specdoc --loadby mtime ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-06-08 16:27 Message: Closing this because there is no information here that we can use to help you. Please feel free to re-open with version information plus some indication that it's an rspec problem. For example, if you do this: script/spec spec Do you get any weird errors? ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11467&group_id=797 From noreply at rubyforge.org Mon Jun 11 18:38:45 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Mon, 11 Jun 2007 18:38:45 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11467 ] rake aborted! Message-ID: <20070611223845.F2D3C5240A63@rubyforge.org> Bugs item #11467, was opened at 2007-06-08 17:12 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11467&group_id=797 >Category: None Group: None >Status: Closed Resolution: Rejected Priority: 3 Submitted By: Will Gray (graywh) >Assigned to: Aslak Helles?y (aslak_hellesoy) Summary: rake aborted! Initial Comment: The specs run fine, but rake gives an error message after "X examples, N failure". 10 examples, 1 failure rake aborted! Command ruby -I"/home/graywh/src/rails/project/vendor/plugins/rspec/lib" "/home/graywh/src/rails/project/vendor/plugins/rspec/bin/spec" "spec/models/person_spec.rb" --options "/home/graywh/src/rails/project/config/../spec/spec.opts" failed /home/graywh/src/rails/project/vendor/plugins/rspec/lib/spec/rake/spectask.rb:132:in `define' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:823:in `verbose' /home/graywh/src/rails/project/vendor/plugins/rspec/lib/spec/rake/spectask.rb:106:in `define' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:392:in `call' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:392:in `execute' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:392:in `each' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:392:in `execute' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:362:in `invoke' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:355:in `synchronize' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:355:in `invoke' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1739:in `top_level' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1739:in `each' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1739:in `top_level' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1761:in `standard_exception_handling' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1733:in `top_level' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1711:in `run' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1761:in `standard_exception_handling' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1708:in `run' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/bin/rake:7 /usr/bin/rake:16:in `load' /usr/bin/rake:16 ---------------------------------------------------------------------- >Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-06-11 18:38 Message: The purpose of reporting is for you to see *what* went wrong. There are several reasons for aborting rake (by raising an error, which in turn causes rake to exit with a non-0 exit code): 1) Without an immediate failure, Rake might continue doing other things, outputting more text, and you might miss it unless you stare at the screen while Rake is running. 2) Automated tools (continuous integration etc) now have a way of knowing that something went wrong. 3) It's a mechanism to prevent more things from happening in Rake after the specs fail - there are several things that you might want *not* want to do when specs fail - such as tagging and releasing your product. Aborting the build tool on one or more failures is standard practice in all build tools I've used: Make/gcc, Ant/JUnit, Ant/javac, Rake/test::unit etc... The fail_on_error flag is documented in the Rake task's RDoc, which should be easy to find from RSpec's home page, http://rspec.rubyforge.org/ -> Documentation -> RDoc: http://rspec.rubyforge.org/rdoc/index.html http://rspec.rubyforge.org/rdoc/classes/Spec/Rake/SpecTask.html ---------------------------------------------------------------------- Comment By: Will Gray (graywh) Date: 2007-06-11 17:36 Message: Then I find the double-reporting of failed specs confusing. Printing a message to stdout such as "109 examples, 2 failures" already tells me a spec failed. Following that with "rake aborted! Command ... failed" made me think something [other than a failed spec] went wrong. How can I use the fail_on_error flag? ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-06-11 16:36 Message: "When there is at least one failure, spec's exit status is 1. That causes system() to throw an exception at rspec/lib/spec/rake/spectasks.rb:130 even though nothing actually went wrong." But something *did* go wrong. There was a failure in your specs, and that is wrong. Are you saying that you want Rake to always execute successfully, even when there are spec failures? How are we supposed to detect errors? You can always set the fail_on_error flag if you want Rake to continue despite spec errors. Or am I completely misunderstanding you? ---------------------------------------------------------------------- Comment By: Will Gray (graywh) Date: 2007-06-11 13:42 Message: When there is at least one failure, spec's exit status is 1. That causes system() to throw an exception at rspec/lib/spec/rake/spectasks.rb:130 even though nothing actually went wrong. ---------------------------------------------------------------------- Comment By: Will Gray (graywh) Date: 2007-06-11 10:18 Message: I'm using the latest version from svn://rubyforge.org/var/svn/rspec/tags/CURRENT/rspec_on_rails. The problem only occurs when there is at least one failing example. It doesn't matter if I use 'rake spec', 'rake spec:models', or 'rake spec SPEC=spec/models/my_model_spec.rb'. Using 'script/spec' gives no errors. My spec/spec.opts file contains the following options: --colour --format specdoc --loadby mtime ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-06-08 17:27 Message: Closing this because there is no information here that we can use to help you. Please feel free to re-open with version information plus some indication that it's an rspec problem. For example, if you do this: script/spec spec Do you get any weird errors? ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11467&group_id=797 From noreply at rubyforge.org Mon Jun 11 22:02:12 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Mon, 11 Jun 2007 22:02:12 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11514 ] configuration.use_transactional_fixtures is ALWAYS true, regardless of assignment Message-ID: <20070612020213.7EDDD5240C63@rubyforge.org> Bugs item #11514, was opened at 2007-06-12 02:02 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11514&group_id=797 Category: None Group: None Status: Open Resolution: None Priority: 3 Submitted By: Nathan Sobo (nathansobo) Assigned to: Nobody (None) Summary: configuration.use_transactional_fixtures is ALWAYS true, regardless of assignment Initial Comment: Check out line 7 of configuration.rb. @use_transactional_fixtures ||= true That works with all kinds of instance variables, but not boolean ones. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11514&group_id=797 From noreply at rubyforge.org Mon Jun 11 22:47:14 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Mon, 11 Jun 2007 22:47:14 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11514 ] configuration.use_transactional_fixtures is ALWAYS true, regardless of assignment Message-ID: <20070612024714.F334E5240CC7@rubyforge.org> Bugs item #11514, was opened at 2007-06-12 02:02 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11514&group_id=797 >Category: rails plugin Group: None >Status: Closed >Resolution: Accepted Priority: 3 Submitted By: Nathan Sobo (nathansobo) >Assigned to: David Chelimsky (dchelimsky) Summary: configuration.use_transactional_fixtures is ALWAYS true, regardless of assignment Initial Comment: Check out line 7 of configuration.rb. @use_transactional_fixtures ||= true That works with all kinds of instance variables, but not boolean ones. ---------------------------------------------------------------------- >Comment By: David Chelimsky (dchelimsky) Date: 2007-06-12 02:47 Message: fixed in r2094 ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11514&group_id=797 From noreply at rubyforge.org Tue Jun 12 11:55:30 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Tue, 12 Jun 2007 11:55:30 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11526 ] rspec fails to dynamically bind DelegateClass methods Message-ID: <20070612155530.B9C3C5240B2A@rubyforge.org> Bugs item #11526, was opened at 2007-06-12 10:55 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11526&group_id=797 Category: None Group: None Status: Open Resolution: None Priority: 3 Submitted By: John Prince (jtprince) Assigned to: Nobody (None) Summary: rspec fails to dynamically bind DelegateClass methods Initial Comment: DelegateClass fails with rspec when methods are defined in the the delegating class. I'm using a delegate class right now and I'm having to write spaghetti code to get things to work properly. Here's code that demonstrates the problem: --- require 'delegate' gem 'rspec' # Version 1.0.5 ############################################################ # CONTROL EXAMPLE: Works FINE. ############################################################ class InheritedClass < Array def large? self.size >= 5 end end describe InheritedClass, "normal inheriting class is OK" do it 'works just fine' do myclass = InheritedClass.new([1,2,3,4,5,6]) myclass.should be_large end end ############################################################ # rspec should work on DelegateClasses. Not sure how... ############################################################ class DelegateKlass < DelegateClass(Array) def initialize(array) @internal_array = array super(@internal_array) end def large? @internal_array.size >= 5 end end =begin # will work if this code is available. class Array def large? self.size >= 5 end end =end describe DelegateKlass, "delegate class fails" do it 'does not work on methods defined within the delegating class' do myclass = DelegateKlass.new([1,2,3,4,5,6]) myclass.should be_large end end --- ############################################# # OUTPUT: ############################################# .F 1) NoMethodError in 'DelegateKlass delegate class fails does not work on delegate class' undefined method `large?' for [1, 2, 3, 4, 5, 6]:Array ./spec_delegate.rb:53: Finished in 0.007365 seconds 2 examples, 1 failure ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11526&group_id=797 From noreply at rubyforge.org Tue Jun 12 18:25:20 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Tue, 12 Jun 2007 18:25:20 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11536 ] controller.should render_template must be defined after the action Message-ID: <20070612222520.9F0965240CFA@rubyforge.org> Bugs item #11536, was opened at 2007-06-12 22:25 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11536&group_id=797 Category: rails plugin Group: None Status: Open Resolution: None Priority: 3 Submitted By: courtenay 3 (court3nay) Assigned to: Nobody (None) Summary: controller.should render_template must be defined after the action Initial Comment: this fails: it "should render index.rhtml" do response.should render_template(:index) do_get end this works: it "should render index.rhtml" do do_get response.should render_template(:index) end Here's my patch; it doesn't "feel" right to me, since there's no other error handling in that file. Index: lib/spec/rails/matchers/render_template.rb =================================================================== --- lib/spec/rails/matchers/render_template.rb (revision 1429) +++ lib/spec/rails/matchers/render_template.rb (working copy) @@ -9,6 +9,9 @@ end def matches?(response) + unless response.respond_to?:rendered_file + raise "The response has not yet rendered or is not a Response object. This matcher (render_template) must be defined after the controller action is called." + end @actual = response.rendered_file(!expected.include?('/')) actual == expected end ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11536&group_id=797 From noreply at rubyforge.org Tue Jun 12 18:34:07 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Tue, 12 Jun 2007 18:34:07 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11536 ] controller.should render_template must be defined after the action Message-ID: <20070612223407.1E60C5240CFA@rubyforge.org> Bugs item #11536, was opened at 2007-06-12 22:25 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11536&group_id=797 Category: rails plugin Group: None Status: Open Resolution: None Priority: 3 Submitted By: courtenay 3 (court3nay) Assigned to: Nobody (None) Summary: controller.should render_template must be defined after the action Initial Comment: this fails: it "should render index.rhtml" do response.should render_template(:index) do_get end this works: it "should render index.rhtml" do do_get response.should render_template(:index) end Here's my patch; it doesn't "feel" right to me, since there's no other error handling in that file. Index: lib/spec/rails/matchers/render_template.rb =================================================================== --- lib/spec/rails/matchers/render_template.rb (revision 1429) +++ lib/spec/rails/matchers/render_template.rb (working copy) @@ -9,6 +9,9 @@ end def matches?(response) + unless response.respond_to?:rendered_file + raise "The response has not yet rendered or is not a Response object. This matcher (render_template) must be defined after the controller action is called." + end @actual = response.rendered_file(!expected.include?('/')) actual == expected end ---------------------------------------------------------------------- >Comment By: courtenay 3 (court3nay) Date: 2007-06-12 22:34 Message: the patch doesn't actually work like I intended, but I can't see a way of checking that the order is correct ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11536&group_id=797 From noreply at rubyforge.org Wed Jun 13 06:00:55 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Wed, 13 Jun 2007 06:00:55 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11545 ] Rspec doesn't handle should_receive on ActiveRecord associations (r2094) Message-ID: <20070613100055.8E16A5240AD9@rubyforge.org> Bugs item #11545, was opened at 2007-06-13 10:00 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11545&group_id=797 Category: mock module Group: None Status: Open Resolution: None Priority: 3 Submitted By: Ian White (ianwhite) Assigned to: Nobody (None) Summary: Rspec doesn't handle should_receive on ActiveRecord associations (r2094) Initial Comment: The attached (standalone) spec should work, but fails on my machine (Mac OS X 10.4.9, rspec(_on_rails) r2094, rails r7006) The spec: class User < ActiveRecord::Base has_one :address, :as => :addressable delegate :postcode, :postcode=, :to => :address end class Address < ActiveRecord::Base belongs_to :addressable, :polymorphic => true end describe 'User with has_one :address' do before do @user = User.new @address = Address.new @user.address = @address end it { @user.should respond_to(:postcode=)} it 'address should repsond to :postcode=' do @address.should respond_to(:postcode=) end it 'should delegate :postcode to :address' do @address.should_receive(:postcode).with('foo').once @user.postcode = 'foo' end it { @user.should respond_to(:postcode=)} # same spec as above it 'address should repsond to :postcode=' do # same spec as above @address.should respond_to(:postcode=) end end produces: ..FFF 1) NameError in 'User with has_one :address should delegate :postcode to :address (using should_receive)' undefined method `postcode' for class `Address' spec/specs/assoc_spec.rb:37: spec/specs/assoc_spec.rb:23: 2) NameError in 'User with has_one :address should respond to #postcode=' undefined method `proxied_by_rspec__postcode' for class `Address' spec/specs/assoc_spec.rb:23: 3) NameError in 'User with has_one :address address should repsond to :postcode=' undefined method `proxied_by_rspec__postcode' for class `Address' spec/specs/assoc_spec.rb:23: ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11545&group_id=797 From noreply at rubyforge.org Wed Jun 13 06:50:34 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Wed, 13 Jun 2007 06:50:34 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11545 ] Rspec doesn't handle should_receive on ActiveRecord associations (r2094) Message-ID: <20070613105034.5B9405240AD9@rubyforge.org> Bugs item #11545, was opened at 2007-06-13 06:00 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11545&group_id=797 Category: mock module Group: None Status: Open Resolution: None Priority: 3 Submitted By: Ian White (ianwhite) Assigned to: Nobody (None) Summary: Rspec doesn't handle should_receive on ActiveRecord associations (r2094) Initial Comment: The attached (standalone) spec should work, but fails on my machine (Mac OS X 10.4.9, rspec(_on_rails) r2094, rails r7006) The spec: class User < ActiveRecord::Base has_one :address, :as => :addressable delegate :postcode, :postcode=, :to => :address end class Address < ActiveRecord::Base belongs_to :addressable, :polymorphic => true end describe 'User with has_one :address' do before do @user = User.new @address = Address.new @user.address = @address end it { @user.should respond_to(:postcode=)} it 'address should repsond to :postcode=' do @address.should respond_to(:postcode=) end it 'should delegate :postcode to :address' do @address.should_receive(:postcode).with('foo').once @user.postcode = 'foo' end it { @user.should respond_to(:postcode=)} # same spec as above it 'address should repsond to :postcode=' do # same spec as above @address.should respond_to(:postcode=) end end produces: ..FFF 1) NameError in 'User with has_one :address should delegate :postcode to :address (using should_receive)' undefined method `postcode' for class `Address' spec/specs/assoc_spec.rb:37: spec/specs/assoc_spec.rb:23: 2) NameError in 'User with has_one :address should respond to #postcode=' undefined method `proxied_by_rspec__postcode' for class `Address' spec/specs/assoc_spec.rb:23: 3) NameError in 'User with has_one :address address should repsond to :postcode=' undefined method `proxied_by_rspec__postcode' for class `Address' spec/specs/assoc_spec.rb:23: ---------------------------------------------------------------------- >Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-06-13 06:50 Message: First, there is a bug in your 3rd spec's should_receive. It should use should_receive(:postcode=) instead of should_receive(:postcode) I was able to reproduce your problem. I can confirm it's due to a bug in RSpec's mock framework and I don't have a fix for it now. I tried to use mocha instead (just use expects instead of should_receive), and all specs passed. I recommend you use mocha until this is fixed. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11545&group_id=797 From noreply at rubyforge.org Wed Jun 13 07:29:50 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Wed, 13 Jun 2007 07:29:50 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11545 ] Rspec doesn't handle should_receive on ActiveRecord associations (r2094) Message-ID: <20070613112950.DA2FD5240B9D@rubyforge.org> Bugs item #11545, was opened at 2007-06-13 10:00 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11545&group_id=797 Category: mock module Group: None Status: Open Resolution: None Priority: 3 Submitted By: Ian White (ianwhite) Assigned to: Nobody (None) Summary: Rspec doesn't handle should_receive on ActiveRecord associations (r2094) Initial Comment: The attached (standalone) spec should work, but fails on my machine (Mac OS X 10.4.9, rspec(_on_rails) r2094, rails r7006) The spec: class User < ActiveRecord::Base has_one :address, :as => :addressable delegate :postcode, :postcode=, :to => :address end class Address < ActiveRecord::Base belongs_to :addressable, :polymorphic => true end describe 'User with has_one :address' do before do @user = User.new @address = Address.new @user.address = @address end it { @user.should respond_to(:postcode=)} it 'address should repsond to :postcode=' do @address.should respond_to(:postcode=) end it 'should delegate :postcode to :address' do @address.should_receive(:postcode).with('foo').once @user.postcode = 'foo' end it { @user.should respond_to(:postcode=)} # same spec as above it 'address should repsond to :postcode=' do # same spec as above @address.should respond_to(:postcode=) end end produces: ..FFF 1) NameError in 'User with has_one :address should delegate :postcode to :address (using should_receive)' undefined method `postcode' for class `Address' spec/specs/assoc_spec.rb:37: spec/specs/assoc_spec.rb:23: 2) NameError in 'User with has_one :address should respond to #postcode=' undefined method `proxied_by_rspec__postcode' for class `Address' spec/specs/assoc_spec.rb:23: 3) NameError in 'User with has_one :address address should repsond to :postcode=' undefined method `proxied_by_rspec__postcode' for class `Address' spec/specs/assoc_spec.rb:23: ---------------------------------------------------------------------- >Comment By: Ian White (ianwhite) Date: 2007-06-13 11:29 Message: Thanks for the quick response. Can you confirm that fixing this is on the agenda? Or should I be moving to mocha for everything? ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-06-13 10:50 Message: First, there is a bug in your 3rd spec's should_receive. It should use should_receive(:postcode=) instead of should_receive(:postcode) I was able to reproduce your problem. I can confirm it's due to a bug in RSpec's mock framework and I don't have a fix for it now. I tried to use mocha instead (just use expects instead of should_receive), and all specs passed. I recommend you use mocha until this is fixed. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11545&group_id=797 From noreply at rubyforge.org Wed Jun 13 08:31:49 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Wed, 13 Jun 2007 08:31:49 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11545 ] Rspec doesn't handle should_receive on ActiveRecord associations (r2094) Message-ID: <20070613123149.862FB5240BB0@rubyforge.org> Bugs item #11545, was opened at 2007-06-13 06:00 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11545&group_id=797 Category: mock module Group: None Status: Open Resolution: None Priority: 3 Submitted By: Ian White (ianwhite) Assigned to: Nobody (None) Summary: Rspec doesn't handle should_receive on ActiveRecord associations (r2094) Initial Comment: The attached (standalone) spec should work, but fails on my machine (Mac OS X 10.4.9, rspec(_on_rails) r2094, rails r7006) The spec: class User < ActiveRecord::Base has_one :address, :as => :addressable delegate :postcode, :postcode=, :to => :address end class Address < ActiveRecord::Base belongs_to :addressable, :polymorphic => true end describe 'User with has_one :address' do before do @user = User.new @address = Address.new @user.address = @address end it { @user.should respond_to(:postcode=)} it 'address should repsond to :postcode=' do @address.should respond_to(:postcode=) end it 'should delegate :postcode to :address' do @address.should_receive(:postcode).with('foo').once @user.postcode = 'foo' end it { @user.should respond_to(:postcode=)} # same spec as above it 'address should repsond to :postcode=' do # same spec as above @address.should respond_to(:postcode=) end end produces: ..FFF 1) NameError in 'User with has_one :address should delegate :postcode to :address (using should_receive)' undefined method `postcode' for class `Address' spec/specs/assoc_spec.rb:37: spec/specs/assoc_spec.rb:23: 2) NameError in 'User with has_one :address should respond to #postcode=' undefined method `proxied_by_rspec__postcode' for class `Address' spec/specs/assoc_spec.rb:23: 3) NameError in 'User with has_one :address address should repsond to :postcode=' undefined method `proxied_by_rspec__postcode' for class `Address' spec/specs/assoc_spec.rb:23: ---------------------------------------------------------------------- >Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-06-13 08:31 Message: It depends what you mean by "on the agenda". There are several other issues in the tracker and I cannot give you an ETC for this one. If you want this fixed quickly I encourage you to submit a patch. ---------------------------------------------------------------------- Comment By: Ian White (ianwhite) Date: 2007-06-13 07:29 Message: Thanks for the quick response. Can you confirm that fixing this is on the agenda? Or should I be moving to mocha for everything? ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-06-13 06:50 Message: First, there is a bug in your 3rd spec's should_receive. It should use should_receive(:postcode=) instead of should_receive(:postcode) I was able to reproduce your problem. I can confirm it's due to a bug in RSpec's mock framework and I don't have a fix for it now. I tried to use mocha instead (just use expects instead of should_receive), and all specs passed. I recommend you use mocha until this is fixed. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11545&group_id=797 From noreply at rubyforge.org Wed Jun 13 09:16:21 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Wed, 13 Jun 2007 09:16:21 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11545 ] Rspec doesn't handle should_receive on ActiveRecord associations (r2094) Message-ID: <20070613131621.346595240BEF@rubyforge.org> Bugs item #11545, was opened at 2007-06-13 10:00 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11545&group_id=797 Category: mock module Group: None Status: Open Resolution: None Priority: 3 Submitted By: Ian White (ianwhite) Assigned to: Nobody (None) Summary: Rspec doesn't handle should_receive on ActiveRecord associations (r2094) Initial Comment: The attached (standalone) spec should work, but fails on my machine (Mac OS X 10.4.9, rspec(_on_rails) r2094, rails r7006) The spec: class User < ActiveRecord::Base has_one :address, :as => :addressable delegate :postcode, :postcode=, :to => :address end class Address < ActiveRecord::Base belongs_to :addressable, :polymorphic => true end describe 'User with has_one :address' do before do @user = User.new @address = Address.new @user.address = @address end it { @user.should respond_to(:postcode=)} it 'address should repsond to :postcode=' do @address.should respond_to(:postcode=) end it 'should delegate :postcode to :address' do @address.should_receive(:postcode).with('foo').once @user.postcode = 'foo' end it { @user.should respond_to(:postcode=)} # same spec as above it 'address should repsond to :postcode=' do # same spec as above @address.should respond_to(:postcode=) end end produces: ..FFF 1) NameError in 'User with has_one :address should delegate :postcode to :address (using should_receive)' undefined method `postcode' for class `Address' spec/specs/assoc_spec.rb:37: spec/specs/assoc_spec.rb:23: 2) NameError in 'User with has_one :address should respond to #postcode=' undefined method `proxied_by_rspec__postcode' for class `Address' spec/specs/assoc_spec.rb:23: 3) NameError in 'User with has_one :address address should repsond to :postcode=' undefined method `proxied_by_rspec__postcode' for class `Address' spec/specs/assoc_spec.rb:23: ---------------------------------------------------------------------- >Comment By: Ian White (ianwhite) Date: 2007-06-13 13:16 Message: That's fair enough. I'll start digging. I'm guessing it has something to do with the Rails Association Proxy getting in the way of the RSpec Mock proxy (if you know that's not it - let me know). ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-06-13 12:31 Message: It depends what you mean by "on the agenda". There are several other issues in the tracker and I cannot give you an ETC for this one. If you want this fixed quickly I encourage you to submit a patch. ---------------------------------------------------------------------- Comment By: Ian White (ianwhite) Date: 2007-06-13 11:29 Message: Thanks for the quick response. Can you confirm that fixing this is on the agenda? Or should I be moving to mocha for everything? ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-06-13 10:50 Message: First, there is a bug in your 3rd spec's should_receive. It should use should_receive(:postcode=) instead of should_receive(:postcode) I was able to reproduce your problem. I can confirm it's due to a bug in RSpec's mock framework and I don't have a fix for it now. I tried to use mocha instead (just use expects instead of should_receive), and all specs passed. I recommend you use mocha until this is fixed. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11545&group_id=797 From noreply at rubyforge.org Wed Jun 13 09:23:46 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Wed, 13 Jun 2007 09:23:46 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11545 ] Rspec doesn't handle should_receive on ActiveRecord associations (r2094) Message-ID: <20070613132347.047BF5240BEF@rubyforge.org> Bugs item #11545, was opened at 2007-06-13 10:00 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11545&group_id=797 Category: mock module Group: None Status: Open Resolution: None Priority: 3 Submitted By: Ian White (ianwhite) Assigned to: Nobody (None) Summary: Rspec doesn't handle should_receive on ActiveRecord associations (r2094) Initial Comment: The attached (standalone) spec should work, but fails on my machine (Mac OS X 10.4.9, rspec(_on_rails) r2094, rails r7006) The spec: class User < ActiveRecord::Base has_one :address, :as => :addressable delegate :postcode, :postcode=, :to => :address end class Address < ActiveRecord::Base belongs_to :addressable, :polymorphic => true end describe 'User with has_one :address' do before do @user = User.new @address = Address.new @user.address = @address end it { @user.should respond_to(:postcode=)} it 'address should repsond to :postcode=' do @address.should respond_to(:postcode=) end it 'should delegate :postcode to :address' do @address.should_receive(:postcode).with('foo').once @user.postcode = 'foo' end it { @user.should respond_to(:postcode=)} # same spec as above it 'address should repsond to :postcode=' do # same spec as above @address.should respond_to(:postcode=) end end produces: ..FFF 1) NameError in 'User with has_one :address should delegate :postcode to :address (using should_receive)' undefined method `postcode' for class `Address' spec/specs/assoc_spec.rb:37: spec/specs/assoc_spec.rb:23: 2) NameError in 'User with has_one :address should respond to #postcode=' undefined method `proxied_by_rspec__postcode' for class `Address' spec/specs/assoc_spec.rb:23: 3) NameError in 'User with has_one :address address should repsond to :postcode=' undefined method `proxied_by_rspec__postcode' for class `Address' spec/specs/assoc_spec.rb:23: ---------------------------------------------------------------------- >Comment By: David Chelimsky (dchelimsky) Date: 2007-06-13 13:23 Message: I've found the problem. RSpec asks the object if it responds_to?(:postcode=), to which AR says "yes", at which point RSpec tries to proxy the method by aliasing it and redefining the original. The problem is that there is no original at that point. AR is telling the truth, in that the object will respond_to(:postcode=), but it does it by implementing the method the first time it gets called. Looking into a fix. ---------------------------------------------------------------------- Comment By: Ian White (ianwhite) Date: 2007-06-13 13:16 Message: That's fair enough. I'll start digging. I'm guessing it has something to do with the Rails Association Proxy getting in the way of the RSpec Mock proxy (if you know that's not it - let me know). ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-06-13 12:31 Message: It depends what you mean by "on the agenda". There are several other issues in the tracker and I cannot give you an ETC for this one. If you want this fixed quickly I encourage you to submit a patch. ---------------------------------------------------------------------- Comment By: Ian White (ianwhite) Date: 2007-06-13 11:29 Message: Thanks for the quick response. Can you confirm that fixing this is on the agenda? Or should I be moving to mocha for everything? ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-06-13 10:50 Message: First, there is a bug in your 3rd spec's should_receive. It should use should_receive(:postcode=) instead of should_receive(:postcode) I was able to reproduce your problem. I can confirm it's due to a bug in RSpec's mock framework and I don't have a fix for it now. I tried to use mocha instead (just use expects instead of should_receive), and all specs passed. I recommend you use mocha until this is fixed. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11545&group_id=797 From noreply at rubyforge.org Wed Jun 13 09:50:29 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Wed, 13 Jun 2007 09:50:29 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11545 ] Rspec doesn't handle should_receive on ActiveRecord associations (r2094) Message-ID: <20070613135029.692995240B64@rubyforge.org> Bugs item #11545, was opened at 2007-06-13 10:00 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11545&group_id=797 Category: mock module Group: None Status: Open Resolution: None Priority: 3 Submitted By: Ian White (ianwhite) Assigned to: Nobody (None) Summary: Rspec doesn't handle should_receive on ActiveRecord associations (r2094) Initial Comment: The attached (standalone) spec should work, but fails on my machine (Mac OS X 10.4.9, rspec(_on_rails) r2094, rails r7006) The spec: class User < ActiveRecord::Base has_one :address, :as => :addressable delegate :postcode, :postcode=, :to => :address end class Address < ActiveRecord::Base belongs_to :addressable, :polymorphic => true end describe 'User with has_one :address' do before do @user = User.new @address = Address.new @user.address = @address end it { @user.should respond_to(:postcode=)} it 'address should repsond to :postcode=' do @address.should respond_to(:postcode=) end it 'should delegate :postcode to :address' do @address.should_receive(:postcode).with('foo').once @user.postcode = 'foo' end it { @user.should respond_to(:postcode=)} # same spec as above it 'address should repsond to :postcode=' do # same spec as above @address.should respond_to(:postcode=) end end produces: ..FFF 1) NameError in 'User with has_one :address should delegate :postcode to :address (using should_receive)' undefined method `postcode' for class `Address' spec/specs/assoc_spec.rb:37: spec/specs/assoc_spec.rb:23: 2) NameError in 'User with has_one :address should respond to #postcode=' undefined method `proxied_by_rspec__postcode' for class `Address' spec/specs/assoc_spec.rb:23: 3) NameError in 'User with has_one :address address should repsond to :postcode=' undefined method `proxied_by_rspec__postcode' for class `Address' spec/specs/assoc_spec.rb:23: ---------------------------------------------------------------------- >Comment By: Ian White (ianwhite) Date: 2007-06-13 13:50 Message: Wow, that was quick! I had just started to go down that path - attached is a diff that makes the spec pass - I've not yet tested the entire rspec suite, doing that next ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-06-13 13:23 Message: I've found the problem. RSpec asks the object if it responds_to?(:postcode=), to which AR says "yes", at which point RSpec tries to proxy the method by aliasing it and redefining the original. The problem is that there is no original at that point. AR is telling the truth, in that the object will respond_to(:postcode=), but it does it by implementing the method the first time it gets called. Looking into a fix. ---------------------------------------------------------------------- Comment By: Ian White (ianwhite) Date: 2007-06-13 13:16 Message: That's fair enough. I'll start digging. I'm guessing it has something to do with the Rails Association Proxy getting in the way of the RSpec Mock proxy (if you know that's not it - let me know). ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-06-13 12:31 Message: It depends what you mean by "on the agenda". There are several other issues in the tracker and I cannot give you an ETC for this one. If you want this fixed quickly I encourage you to submit a patch. ---------------------------------------------------------------------- Comment By: Ian White (ianwhite) Date: 2007-06-13 11:29 Message: Thanks for the quick response. Can you confirm that fixing this is on the agenda? Or should I be moving to mocha for everything? ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-06-13 10:50 Message: First, there is a bug in your 3rd spec's should_receive. It should use should_receive(:postcode=) instead of should_receive(:postcode) I was able to reproduce your problem. I can confirm it's due to a bug in RSpec's mock framework and I don't have a fix for it now. I tried to use mocha instead (just use expects instead of should_receive), and all specs passed. I recommend you use mocha until this is fixed. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11545&group_id=797 From noreply at rubyforge.org Wed Jun 13 09:51:10 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Wed, 13 Jun 2007 09:51:10 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11545 ] Rspec doesn't handle should_receive on ActiveRecord associations (r2094) Message-ID: <20070613135110.851AC5240BA0@rubyforge.org> Bugs item #11545, was opened at 2007-06-13 10:00 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11545&group_id=797 Category: mock module Group: None Status: Open Resolution: None Priority: 3 Submitted By: Ian White (ianwhite) Assigned to: Nobody (None) Summary: Rspec doesn't handle should_receive on ActiveRecord associations (r2094) Initial Comment: The attached (standalone) spec should work, but fails on my machine (Mac OS X 10.4.9, rspec(_on_rails) r2094, rails r7006) The spec: class User < ActiveRecord::Base has_one :address, :as => :addressable delegate :postcode, :postcode=, :to => :address end class Address < ActiveRecord::Base belongs_to :addressable, :polymorphic => true end describe 'User with has_one :address' do before do @user = User.new @address = Address.new @user.address = @address end it { @user.should respond_to(:postcode=)} it 'address should repsond to :postcode=' do @address.should respond_to(:postcode=) end it 'should delegate :postcode to :address' do @address.should_receive(:postcode).with('foo').once @user.postcode = 'foo' end it { @user.should respond_to(:postcode=)} # same spec as above it 'address should repsond to :postcode=' do # same spec as above @address.should respond_to(:postcode=) end end produces: ..FFF 1) NameError in 'User with has_one :address should delegate :postcode to :address (using should_receive)' undefined method `postcode' for class `Address' spec/specs/assoc_spec.rb:37: spec/specs/assoc_spec.rb:23: 2) NameError in 'User with has_one :address should respond to #postcode=' undefined method `proxied_by_rspec__postcode' for class `Address' spec/specs/assoc_spec.rb:23: 3) NameError in 'User with has_one :address address should repsond to :postcode=' undefined method `proxied_by_rspec__postcode' for class `Address' spec/specs/assoc_spec.rb:23: ---------------------------------------------------------------------- Comment By: Ian White (ianwhite) Date: 2007-06-13 13:50 Message: Wow, that was quick! I had just started to go down that path - attached is a diff that makes the spec pass - I've not yet tested the entire rspec suite, doing that next ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-06-13 13:23 Message: I've found the problem. RSpec asks the object if it responds_to?(:postcode=), to which AR says "yes", at which point RSpec tries to proxy the method by aliasing it and redefining the original. The problem is that there is no original at that point. AR is telling the truth, in that the object will respond_to(:postcode=), but it does it by implementing the method the first time it gets called. Looking into a fix. ---------------------------------------------------------------------- Comment By: Ian White (ianwhite) Date: 2007-06-13 13:16 Message: That's fair enough. I'll start digging. I'm guessing it has something to do with the Rails Association Proxy getting in the way of the RSpec Mock proxy (if you know that's not it - let me know). ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-06-13 12:31 Message: It depends what you mean by "on the agenda". There are several other issues in the tracker and I cannot give you an ETC for this one. If you want this fixed quickly I encourage you to submit a patch. ---------------------------------------------------------------------- Comment By: Ian White (ianwhite) Date: 2007-06-13 11:29 Message: Thanks for the quick response. Can you confirm that fixing this is on the agenda? Or should I be moving to mocha for everything? ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-06-13 10:50 Message: First, there is a bug in your 3rd spec's should_receive. It should use should_receive(:postcode=) instead of should_receive(:postcode) I was able to reproduce your problem. I can confirm it's due to a bug in RSpec's mock framework and I don't have a fix for it now. I tried to use mocha instead (just use expects instead of should_receive), and all specs passed. I recommend you use mocha until this is fixed. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11545&group_id=797 From noreply at rubyforge.org Wed Jun 13 10:10:00 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Wed, 13 Jun 2007 10:10:00 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11545 ] Rspec doesn't handle should_receive on ActiveRecord associations (r2094) Message-ID: <20070613141000.895265240BEF@rubyforge.org> Bugs item #11545, was opened at 2007-06-13 10:00 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11545&group_id=797 Category: mock module Group: None >Status: Closed >Resolution: Accepted Priority: 3 Submitted By: Ian White (ianwhite) >Assigned to: David Chelimsky (dchelimsky) Summary: Rspec doesn't handle should_receive on ActiveRecord associations (r2094) Initial Comment: The attached (standalone) spec should work, but fails on my machine (Mac OS X 10.4.9, rspec(_on_rails) r2094, rails r7006) The spec: class User < ActiveRecord::Base has_one :address, :as => :addressable delegate :postcode, :postcode=, :to => :address end class Address < ActiveRecord::Base belongs_to :addressable, :polymorphic => true end describe 'User with has_one :address' do before do @user = User.new @address = Address.new @user.address = @address end it { @user.should respond_to(:postcode=)} it 'address should repsond to :postcode=' do @address.should respond_to(:postcode=) end it 'should delegate :postcode to :address' do @address.should_receive(:postcode).with('foo').once @user.postcode = 'foo' end it { @user.should respond_to(:postcode=)} # same spec as above it 'address should repsond to :postcode=' do # same spec as above @address.should respond_to(:postcode=) end end produces: ..FFF 1) NameError in 'User with has_one :address should delegate :postcode to :address (using should_receive)' undefined method `postcode' for class `Address' spec/specs/assoc_spec.rb:37: spec/specs/assoc_spec.rb:23: 2) NameError in 'User with has_one :address should respond to #postcode=' undefined method `proxied_by_rspec__postcode' for class `Address' spec/specs/assoc_spec.rb:23: 3) NameError in 'User with has_one :address address should repsond to :postcode=' undefined method `proxied_by_rspec__postcode' for class `Address' spec/specs/assoc_spec.rb:23: ---------------------------------------------------------------------- >Comment By: David Chelimsky (dchelimsky) Date: 2007-06-13 14:10 Message: Fixed in r2095. ---------------------------------------------------------------------- Comment By: Ian White (ianwhite) Date: 2007-06-13 13:50 Message: Wow, that was quick! I had just started to go down that path - attached is a diff that makes the spec pass - I've not yet tested the entire rspec suite, doing that next ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-06-13 13:23 Message: I've found the problem. RSpec asks the object if it responds_to?(:postcode=), to which AR says "yes", at which point RSpec tries to proxy the method by aliasing it and redefining the original. The problem is that there is no original at that point. AR is telling the truth, in that the object will respond_to(:postcode=), but it does it by implementing the method the first time it gets called. Looking into a fix. ---------------------------------------------------------------------- Comment By: Ian White (ianwhite) Date: 2007-06-13 13:16 Message: That's fair enough. I'll start digging. I'm guessing it has something to do with the Rails Association Proxy getting in the way of the RSpec Mock proxy (if you know that's not it - let me know). ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-06-13 12:31 Message: It depends what you mean by "on the agenda". There are several other issues in the tracker and I cannot give you an ETC for this one. If you want this fixed quickly I encourage you to submit a patch. ---------------------------------------------------------------------- Comment By: Ian White (ianwhite) Date: 2007-06-13 11:29 Message: Thanks for the quick response. Can you confirm that fixing this is on the agenda? Or should I be moving to mocha for everything? ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-06-13 10:50 Message: First, there is a bug in your 3rd spec's should_receive. It should use should_receive(:postcode=) instead of should_receive(:postcode) I was able to reproduce your problem. I can confirm it's due to a bug in RSpec's mock framework and I don't have a fix for it now. I tried to use mocha instead (just use expects instead of should_receive), and all specs passed. I recommend you use mocha until this is fixed. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11545&group_id=797 From noreply at rubyforge.org Wed Jun 13 10:14:01 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Wed, 13 Jun 2007 10:14:01 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11545 ] Rspec doesn't handle should_receive on ActiveRecord associations (r2094) Message-ID: <20070613141401.B52C45240B64@rubyforge.org> Bugs item #11545, was opened at 2007-06-13 10:00 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11545&group_id=797 Category: mock module Group: None Status: Closed Resolution: Accepted Priority: 3 Submitted By: Ian White (ianwhite) Assigned to: David Chelimsky (dchelimsky) Summary: Rspec doesn't handle should_receive on ActiveRecord associations (r2094) Initial Comment: The attached (standalone) spec should work, but fails on my machine (Mac OS X 10.4.9, rspec(_on_rails) r2094, rails r7006) The spec: class User < ActiveRecord::Base has_one :address, :as => :addressable delegate :postcode, :postcode=, :to => :address end class Address < ActiveRecord::Base belongs_to :addressable, :polymorphic => true end describe 'User with has_one :address' do before do @user = User.new @address = Address.new @user.address = @address end it { @user.should respond_to(:postcode=)} it 'address should repsond to :postcode=' do @address.should respond_to(:postcode=) end it 'should delegate :postcode to :address' do @address.should_receive(:postcode).with('foo').once @user.postcode = 'foo' end it { @user.should respond_to(:postcode=)} # same spec as above it 'address should repsond to :postcode=' do # same spec as above @address.should respond_to(:postcode=) end end produces: ..FFF 1) NameError in 'User with has_one :address should delegate :postcode to :address (using should_receive)' undefined method `postcode' for class `Address' spec/specs/assoc_spec.rb:37: spec/specs/assoc_spec.rb:23: 2) NameError in 'User with has_one :address should respond to #postcode=' undefined method `proxied_by_rspec__postcode' for class `Address' spec/specs/assoc_spec.rb:23: 3) NameError in 'User with has_one :address address should repsond to :postcode=' undefined method `proxied_by_rspec__postcode' for class `Address' spec/specs/assoc_spec.rb:23: ---------------------------------------------------------------------- >Comment By: David Chelimsky (dchelimsky) Date: 2007-06-13 14:14 Message: Ian - I don't see the diff attached. Feel free to attach it - I'd like to see what you came up w/. Thx ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-06-13 14:10 Message: Fixed in r2095. ---------------------------------------------------------------------- Comment By: Ian White (ianwhite) Date: 2007-06-13 13:50 Message: Wow, that was quick! I had just started to go down that path - attached is a diff that makes the spec pass - I've not yet tested the entire rspec suite, doing that next ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-06-13 13:23 Message: I've found the problem. RSpec asks the object if it responds_to?(:postcode=), to which AR says "yes", at which point RSpec tries to proxy the method by aliasing it and redefining the original. The problem is that there is no original at that point. AR is telling the truth, in that the object will respond_to(:postcode=), but it does it by implementing the method the first time it gets called. Looking into a fix. ---------------------------------------------------------------------- Comment By: Ian White (ianwhite) Date: 2007-06-13 13:16 Message: That's fair enough. I'll start digging. I'm guessing it has something to do with the Rails Association Proxy getting in the way of the RSpec Mock proxy (if you know that's not it - let me know). ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-06-13 12:31 Message: It depends what you mean by "on the agenda". There are several other issues in the tracker and I cannot give you an ETC for this one. If you want this fixed quickly I encourage you to submit a patch. ---------------------------------------------------------------------- Comment By: Ian White (ianwhite) Date: 2007-06-13 11:29 Message: Thanks for the quick response. Can you confirm that fixing this is on the agenda? Or should I be moving to mocha for everything? ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-06-13 10:50 Message: First, there is a bug in your 3rd spec's should_receive. It should use should_receive(:postcode=) instead of should_receive(:postcode) I was able to reproduce your problem. I can confirm it's due to a bug in RSpec's mock framework and I don't have a fix for it now. I tried to use mocha instead (just use expects instead of should_receive), and all specs passed. I recommend you use mocha until this is fixed. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11545&group_id=797 From noreply at rubyforge.org Wed Jun 13 10:17:28 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Wed, 13 Jun 2007 10:17:28 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11545 ] Rspec doesn't handle should_receive on ActiveRecord associations (r2094) Message-ID: <20070613141728.E6B815240B64@rubyforge.org> Bugs item #11545, was opened at 2007-06-13 10:00 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11545&group_id=797 Category: mock module Group: None >Status: Open Resolution: Accepted Priority: 3 Submitted By: Ian White (ianwhite) >Assigned to: Nobody (None) Summary: Rspec doesn't handle should_receive on ActiveRecord associations (r2094) Initial Comment: The attached (standalone) spec should work, but fails on my machine (Mac OS X 10.4.9, rspec(_on_rails) r2094, rails r7006) The spec: class User < ActiveRecord::Base has_one :address, :as => :addressable delegate :postcode, :postcode=, :to => :address end class Address < ActiveRecord::Base belongs_to :addressable, :polymorphic => true end describe 'User with has_one :address' do before do @user = User.new @address = Address.new @user.address = @address end it { @user.should respond_to(:postcode=)} it 'address should repsond to :postcode=' do @address.should respond_to(:postcode=) end it 'should delegate :postcode to :address' do @address.should_receive(:postcode).with('foo').once @user.postcode = 'foo' end it { @user.should respond_to(:postcode=)} # same spec as above it 'address should repsond to :postcode=' do # same spec as above @address.should respond_to(:postcode=) end end produces: ..FFF 1) NameError in 'User with has_one :address should delegate :postcode to :address (using should_receive)' undefined method `postcode' for class `Address' spec/specs/assoc_spec.rb:37: spec/specs/assoc_spec.rb:23: 2) NameError in 'User with has_one :address should respond to #postcode=' undefined method `proxied_by_rspec__postcode' for class `Address' spec/specs/assoc_spec.rb:23: 3) NameError in 'User with has_one :address address should repsond to :postcode=' undefined method `proxied_by_rspec__postcode' for class `Address' spec/specs/assoc_spec.rb:23: ---------------------------------------------------------------------- >Comment By: Ian White (ianwhite) Date: 2007-06-13 14:17 Message: I see it at the bottom... the url is http://rubyforge.org/tracker/download.php/797/3149/11545/2095/proxy.diff Yours was cleaner - but I'm worried that yours won't undef method counting method in cleanup - I'm just writing a spec now to be sure. ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-06-13 14:14 Message: Ian - I don't see the diff attached. Feel free to attach it - I'd like to see what you came up w/. Thx ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-06-13 14:10 Message: Fixed in r2095. ---------------------------------------------------------------------- Comment By: Ian White (ianwhite) Date: 2007-06-13 13:50 Message: Wow, that was quick! I had just started to go down that path - attached is a diff that makes the spec pass - I've not yet tested the entire rspec suite, doing that next ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-06-13 13:23 Message: I've found the problem. RSpec asks the object if it responds_to?(:postcode=), to which AR says "yes", at which point RSpec tries to proxy the method by aliasing it and redefining the original. The problem is that there is no original at that point. AR is telling the truth, in that the object will respond_to(:postcode=), but it does it by implementing the method the first time it gets called. Looking into a fix. ---------------------------------------------------------------------- Comment By: Ian White (ianwhite) Date: 2007-06-13 13:16 Message: That's fair enough. I'll start digging. I'm guessing it has something to do with the Rails Association Proxy getting in the way of the RSpec Mock proxy (if you know that's not it - let me know). ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-06-13 12:31 Message: It depends what you mean by "on the agenda". There are several other issues in the tracker and I cannot give you an ETC for this one. If you want this fixed quickly I encourage you to submit a patch. ---------------------------------------------------------------------- Comment By: Ian White (ianwhite) Date: 2007-06-13 11:29 Message: Thanks for the quick response. Can you confirm that fixing this is on the agenda? Or should I be moving to mocha for everything? ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-06-13 10:50 Message: First, there is a bug in your 3rd spec's should_receive. It should use should_receive(:postcode=) instead of should_receive(:postcode) I was able to reproduce your problem. I can confirm it's due to a bug in RSpec's mock framework and I don't have a fix for it now. I tried to use mocha instead (just use expects instead of should_receive), and all specs passed. I recommend you use mocha until this is fixed. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11545&group_id=797 From noreply at rubyforge.org Wed Jun 13 10:23:07 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Wed, 13 Jun 2007 10:23:07 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11545 ] Rspec doesn't handle should_receive on ActiveRecord associations (r2094) Message-ID: <20070613142308.214A35240B45@rubyforge.org> Bugs item #11545, was opened at 2007-06-13 10:00 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11545&group_id=797 Category: mock module Group: None Status: Open Resolution: Accepted Priority: 3 Submitted By: Ian White (ianwhite) Assigned to: Nobody (None) Summary: Rspec doesn't handle should_receive on ActiveRecord associations (r2094) Initial Comment: The attached (standalone) spec should work, but fails on my machine (Mac OS X 10.4.9, rspec(_on_rails) r2094, rails r7006) The spec: class User < ActiveRecord::Base has_one :address, :as => :addressable delegate :postcode, :postcode=, :to => :address end class Address < ActiveRecord::Base belongs_to :addressable, :polymorphic => true end describe 'User with has_one :address' do before do @user = User.new @address = Address.new @user.address = @address end it { @user.should respond_to(:postcode=)} it 'address should repsond to :postcode=' do @address.should respond_to(:postcode=) end it 'should delegate :postcode to :address' do @address.should_receive(:postcode).with('foo').once @user.postcode = 'foo' end it { @user.should respond_to(:postcode=)} # same spec as above it 'address should repsond to :postcode=' do # same spec as above @address.should respond_to(:postcode=) end end produces: ..FFF 1) NameError in 'User with has_one :address should delegate :postcode to :address (using should_receive)' undefined method `postcode' for class `Address' spec/specs/assoc_spec.rb:37: spec/specs/assoc_spec.rb:23: 2) NameError in 'User with has_one :address should respond to #postcode=' undefined method `proxied_by_rspec__postcode' for class `Address' spec/specs/assoc_spec.rb:23: 3) NameError in 'User with has_one :address address should repsond to :postcode=' undefined method `proxied_by_rspec__postcode' for class `Address' spec/specs/assoc_spec.rb:23: ---------------------------------------------------------------------- >Comment By: David Chelimsky (dchelimsky) Date: 2007-06-13 14:23 Message: Mine was less code. Not necessarily cleaner. If you want, please re-submit diff against the new trunk (2095). The spec I added is in rspec/spec/mocks/bug_report_11545.rb. Please add your additional examples (dealing w/ method count) there. Thx ---------------------------------------------------------------------- Comment By: Ian White (ianwhite) Date: 2007-06-13 14:17 Message: I see it at the bottom... the url is http://rubyforge.org/tracker/download.php/797/3149/11545/2095/proxy.diff Yours was cleaner - but I'm worried that yours won't undef method counting method in cleanup - I'm just writing a spec now to be sure. ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-06-13 14:14 Message: Ian - I don't see the diff attached. Feel free to attach it - I'd like to see what you came up w/. Thx ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-06-13 14:10 Message: Fixed in r2095. ---------------------------------------------------------------------- Comment By: Ian White (ianwhite) Date: 2007-06-13 13:50 Message: Wow, that was quick! I had just started to go down that path - attached is a diff that makes the spec pass - I've not yet tested the entire rspec suite, doing that next ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-06-13 13:23 Message: I've found the problem. RSpec asks the object if it responds_to?(:postcode=), to which AR says "yes", at which point RSpec tries to proxy the method by aliasing it and redefining the original. The problem is that there is no original at that point. AR is telling the truth, in that the object will respond_to(:postcode=), but it does it by implementing the method the first time it gets called. Looking into a fix. ---------------------------------------------------------------------- Comment By: Ian White (ianwhite) Date: 2007-06-13 13:16 Message: That's fair enough. I'll start digging. I'm guessing it has something to do with the Rails Association Proxy getting in the way of the RSpec Mock proxy (if you know that's not it - let me know). ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-06-13 12:31 Message: It depends what you mean by "on the agenda". There are several other issues in the tracker and I cannot give you an ETC for this one. If you want this fixed quickly I encourage you to submit a patch. ---------------------------------------------------------------------- Comment By: Ian White (ianwhite) Date: 2007-06-13 11:29 Message: Thanks for the quick response. Can you confirm that fixing this is on the agenda? Or should I be moving to mocha for everything? ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-06-13 10:50 Message: First, there is a bug in your 3rd spec's should_receive. It should use should_receive(:postcode=) instead of should_receive(:postcode) I was able to reproduce your problem. I can confirm it's due to a bug in RSpec's mock framework and I don't have a fix for it now. I tried to use mocha instead (just use expects instead of should_receive), and all specs passed. I recommend you use mocha until this is fixed. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11545&group_id=797 From noreply at rubyforge.org Wed Jun 13 10:51:07 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Wed, 13 Jun 2007 10:51:07 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11545 ] Rspec doesn't handle should_receive on ActiveRecord associations (r2094) Message-ID: <20070613145107.456A15240BEF@rubyforge.org> Bugs item #11545, was opened at 2007-06-13 10:00 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11545&group_id=797 Category: mock module Group: None Status: Open Resolution: Accepted Priority: 3 Submitted By: Ian White (ianwhite) Assigned to: Nobody (None) Summary: Rspec doesn't handle should_receive on ActiveRecord associations (r2094) Initial Comment: The attached (standalone) spec should work, but fails on my machine (Mac OS X 10.4.9, rspec(_on_rails) r2094, rails r7006) The spec: class User < ActiveRecord::Base has_one :address, :as => :addressable delegate :postcode, :postcode=, :to => :address end class Address < ActiveRecord::Base belongs_to :addressable, :polymorphic => true end describe 'User with has_one :address' do before do @user = User.new @address = Address.new @user.address = @address end it { @user.should respond_to(:postcode=)} it 'address should repsond to :postcode=' do @address.should respond_to(:postcode=) end it 'should delegate :postcode to :address' do @address.should_receive(:postcode).with('foo').once @user.postcode = 'foo' end it { @user.should respond_to(:postcode=)} # same spec as above it 'address should repsond to :postcode=' do # same spec as above @address.should respond_to(:postcode=) end end produces: ..FFF 1) NameError in 'User with has_one :address should delegate :postcode to :address (using should_receive)' undefined method `postcode' for class `Address' spec/specs/assoc_spec.rb:37: spec/specs/assoc_spec.rb:23: 2) NameError in 'User with has_one :address should respond to #postcode=' undefined method `proxied_by_rspec__postcode' for class `Address' spec/specs/assoc_spec.rb:23: 3) NameError in 'User with has_one :address address should repsond to :postcode=' undefined method `proxied_by_rspec__postcode' for class `Address' spec/specs/assoc_spec.rb:23: ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-06-13 14:23 Message: Mine was less code. Not necessarily cleaner. If you want, please re-submit diff against the new trunk (2095). The spec I added is in rspec/spec/mocks/bug_report_11545.rb. Please add your additional examples (dealing w/ method count) there. Thx ---------------------------------------------------------------------- Comment By: Ian White (ianwhite) Date: 2007-06-13 14:17 Message: I see it at the bottom... the url is http://rubyforge.org/tracker/download.php/797/3149/11545/2095/proxy.diff Yours was cleaner - but I'm worried that yours won't undef method counting method in cleanup - I'm just writing a spec now to be sure. ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-06-13 14:14 Message: Ian - I don't see the diff attached. Feel free to attach it - I'd like to see what you came up w/. Thx ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-06-13 14:10 Message: Fixed in r2095. ---------------------------------------------------------------------- Comment By: Ian White (ianwhite) Date: 2007-06-13 13:50 Message: Wow, that was quick! I had just started to go down that path - attached is a diff that makes the spec pass - I've not yet tested the entire rspec suite, doing that next ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-06-13 13:23 Message: I've found the problem. RSpec asks the object if it responds_to?(:postcode=), to which AR says "yes", at which point RSpec tries to proxy the method by aliasing it and redefining the original. The problem is that there is no original at that point. AR is telling the truth, in that the object will respond_to(:postcode=), but it does it by implementing the method the first time it gets called. Looking into a fix. ---------------------------------------------------------------------- Comment By: Ian White (ianwhite) Date: 2007-06-13 13:16 Message: That's fair enough. I'll start digging. I'm guessing it has something to do with the Rails Association Proxy getting in the way of the RSpec Mock proxy (if you know that's not it - let me know). ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-06-13 12:31 Message: It depends what you mean by "on the agenda". There are several other issues in the tracker and I cannot give you an ETC for this one. If you want this fixed quickly I encourage you to submit a patch. ---------------------------------------------------------------------- Comment By: Ian White (ianwhite) Date: 2007-06-13 11:29 Message: Thanks for the quick response. Can you confirm that fixing this is on the agenda? Or should I be moving to mocha for everything? ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-06-13 10:50 Message: First, there is a bug in your 3rd spec's should_receive. It should use should_receive(:postcode=) instead of should_receive(:postcode) I was able to reproduce your problem. I can confirm it's due to a bug in RSpec's mock framework and I don't have a fix for it now. I tried to use mocha instead (just use expects instead of should_receive), and all specs passed. I recommend you use mocha until this is fixed. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11545&group_id=797 From noreply at rubyforge.org Wed Jun 13 10:53:18 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Wed, 13 Jun 2007 10:53:18 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11545 ] Rspec doesn't handle should_receive on ActiveRecord associations (r2094) Message-ID: <20070613145318.C13295240C27@rubyforge.org> Bugs item #11545, was opened at 2007-06-13 10:00 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11545&group_id=797 Category: mock module Group: None Status: Open Resolution: Accepted Priority: 3 Submitted By: Ian White (ianwhite) Assigned to: Nobody (None) Summary: Rspec doesn't handle should_receive on ActiveRecord associations (r2094) Initial Comment: The attached (standalone) spec should work, but fails on my machine (Mac OS X 10.4.9, rspec(_on_rails) r2094, rails r7006) The spec: class User < ActiveRecord::Base has_one :address, :as => :addressable delegate :postcode, :postcode=, :to => :address end class Address < ActiveRecord::Base belongs_to :addressable, :polymorphic => true end describe 'User with has_one :address' do before do @user = User.new @address = Address.new @user.address = @address end it { @user.should respond_to(:postcode=)} it 'address should repsond to :postcode=' do @address.should respond_to(:postcode=) end it 'should delegate :postcode to :address' do @address.should_receive(:postcode).with('foo').once @user.postcode = 'foo' end it { @user.should respond_to(:postcode=)} # same spec as above it 'address should repsond to :postcode=' do # same spec as above @address.should respond_to(:postcode=) end end produces: ..FFF 1) NameError in 'User with has_one :address should delegate :postcode to :address (using should_receive)' undefined method `postcode' for class `Address' spec/specs/assoc_spec.rb:37: spec/specs/assoc_spec.rb:23: 2) NameError in 'User with has_one :address should respond to #postcode=' undefined method `proxied_by_rspec__postcode' for class `Address' spec/specs/assoc_spec.rb:23: 3) NameError in 'User with has_one :address address should repsond to :postcode=' undefined method `proxied_by_rspec__postcode' for class `Address' spec/specs/assoc_spec.rb:23: ---------------------------------------------------------------------- >Comment By: Ian White (ianwhite) Date: 2007-06-13 14:53 Message: Hi David, Attached is diff which specs the problem (methods don't get cleaned up on classes because their metaclass sticks around) in the diff is the fix. This is my first rspec patch - not sure if that random token stuff is supposed to be there. Awesomely comprehensive pre_commit script by the way! ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-06-13 14:23 Message: Mine was less code. Not necessarily cleaner. If you want, please re-submit diff against the new trunk (2095). The spec I added is in rspec/spec/mocks/bug_report_11545.rb. Please add your additional examples (dealing w/ method count) there. Thx ---------------------------------------------------------------------- Comment By: Ian White (ianwhite) Date: 2007-06-13 14:17 Message: I see it at the bottom... the url is http://rubyforge.org/tracker/download.php/797/3149/11545/2095/proxy.diff Yours was cleaner - but I'm worried that yours won't undef method counting method in cleanup - I'm just writing a spec now to be sure. ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-06-13 14:14 Message: Ian - I don't see the diff attached. Feel free to attach it - I'd like to see what you came up w/. Thx ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-06-13 14:10 Message: Fixed in r2095. ---------------------------------------------------------------------- Comment By: Ian White (ianwhite) Date: 2007-06-13 13:50 Message: Wow, that was quick! I had just started to go down that path - attached is a diff that makes the spec pass - I've not yet tested the entire rspec suite, doing that next ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-06-13 13:23 Message: I've found the problem. RSpec asks the object if it responds_to?(:postcode=), to which AR says "yes", at which point RSpec tries to proxy the method by aliasing it and redefining the original. The problem is that there is no original at that point. AR is telling the truth, in that the object will respond_to(:postcode=), but it does it by implementing the method the first time it gets called. Looking into a fix. ---------------------------------------------------------------------- Comment By: Ian White (ianwhite) Date: 2007-06-13 13:16 Message: That's fair enough. I'll start digging. I'm guessing it has something to do with the Rails Association Proxy getting in the way of the RSpec Mock proxy (if you know that's not it - let me know). ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-06-13 12:31 Message: It depends what you mean by "on the agenda". There are several other issues in the tracker and I cannot give you an ETC for this one. If you want this fixed quickly I encourage you to submit a patch. ---------------------------------------------------------------------- Comment By: Ian White (ianwhite) Date: 2007-06-13 11:29 Message: Thanks for the quick response. Can you confirm that fixing this is on the agenda? Or should I be moving to mocha for everything? ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-06-13 10:50 Message: First, there is a bug in your 3rd spec's should_receive. It should use should_receive(:postcode=) instead of should_receive(:postcode) I was able to reproduce your problem. I can confirm it's due to a bug in RSpec's mock framework and I don't have a fix for it now. I tried to use mocha instead (just use expects instead of should_receive), and all specs passed. I recommend you use mocha until this is fixed. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11545&group_id=797 From noreply at rubyforge.org Wed Jun 13 10:58:02 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Wed, 13 Jun 2007 10:58:02 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11545 ] Rspec doesn't handle should_receive on ActiveRecord associations (r2094) Message-ID: <20070613145802.DECA45240BEF@rubyforge.org> Bugs item #11545, was opened at 2007-06-13 10:00 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11545&group_id=797 Category: mock module Group: None Status: Open Resolution: Accepted Priority: 3 Submitted By: Ian White (ianwhite) Assigned to: Nobody (None) Summary: Rspec doesn't handle should_receive on ActiveRecord associations (r2094) Initial Comment: The attached (standalone) spec should work, but fails on my machine (Mac OS X 10.4.9, rspec(_on_rails) r2094, rails r7006) The spec: class User < ActiveRecord::Base has_one :address, :as => :addressable delegate :postcode, :postcode=, :to => :address end class Address < ActiveRecord::Base belongs_to :addressable, :polymorphic => true end describe 'User with has_one :address' do before do @user = User.new @address = Address.new @user.address = @address end it { @user.should respond_to(:postcode=)} it 'address should repsond to :postcode=' do @address.should respond_to(:postcode=) end it 'should delegate :postcode to :address' do @address.should_receive(:postcode).with('foo').once @user.postcode = 'foo' end it { @user.should respond_to(:postcode=)} # same spec as above it 'address should repsond to :postcode=' do # same spec as above @address.should respond_to(:postcode=) end end produces: ..FFF 1) NameError in 'User with has_one :address should delegate :postcode to :address (using should_receive)' undefined method `postcode' for class `Address' spec/specs/assoc_spec.rb:37: spec/specs/assoc_spec.rb:23: 2) NameError in 'User with has_one :address should respond to #postcode=' undefined method `proxied_by_rspec__postcode' for class `Address' spec/specs/assoc_spec.rb:23: 3) NameError in 'User with has_one :address address should repsond to :postcode=' undefined method `proxied_by_rspec__postcode' for class `Address' spec/specs/assoc_spec.rb:23: ---------------------------------------------------------------------- >Comment By: Ian White (ianwhite) Date: 2007-06-13 14:58 Message: Bugger - I misspelt receive ("i after e except before c" - it just didn't stick in spelling class...) in the spec ---------------------------------------------------------------------- Comment By: Ian White (ianwhite) Date: 2007-06-13 14:53 Message: Hi David, Attached is diff which specs the problem (methods don't get cleaned up on classes because their metaclass sticks around) in the diff is the fix. This is my first rspec patch - not sure if that random token stuff is supposed to be there. Awesomely comprehensive pre_commit script by the way! ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-06-13 14:23 Message: Mine was less code. Not necessarily cleaner. If you want, please re-submit diff against the new trunk (2095). The spec I added is in rspec/spec/mocks/bug_report_11545.rb. Please add your additional examples (dealing w/ method count) there. Thx ---------------------------------------------------------------------- Comment By: Ian White (ianwhite) Date: 2007-06-13 14:17 Message: I see it at the bottom... the url is http://rubyforge.org/tracker/download.php/797/3149/11545/2095/proxy.diff Yours was cleaner - but I'm worried that yours won't undef method counting method in cleanup - I'm just writing a spec now to be sure. ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-06-13 14:14 Message: Ian - I don't see the diff attached. Feel free to attach it - I'd like to see what you came up w/. Thx ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-06-13 14:10 Message: Fixed in r2095. ---------------------------------------------------------------------- Comment By: Ian White (ianwhite) Date: 2007-06-13 13:50 Message: Wow, that was quick! I had just started to go down that path - attached is a diff that makes the spec pass - I've not yet tested the entire rspec suite, doing that next ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-06-13 13:23 Message: I've found the problem. RSpec asks the object if it responds_to?(:postcode=), to which AR says "yes", at which point RSpec tries to proxy the method by aliasing it and redefining the original. The problem is that there is no original at that point. AR is telling the truth, in that the object will respond_to(:postcode=), but it does it by implementing the method the first time it gets called. Looking into a fix. ---------------------------------------------------------------------- Comment By: Ian White (ianwhite) Date: 2007-06-13 13:16 Message: That's fair enough. I'll start digging. I'm guessing it has something to do with the Rails Association Proxy getting in the way of the RSpec Mock proxy (if you know that's not it - let me know). ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-06-13 12:31 Message: It depends what you mean by "on the agenda". There are several other issues in the tracker and I cannot give you an ETC for this one. If you want this fixed quickly I encourage you to submit a patch. ---------------------------------------------------------------------- Comment By: Ian White (ianwhite) Date: 2007-06-13 11:29 Message: Thanks for the quick response. Can you confirm that fixing this is on the agenda? Or should I be moving to mocha for everything? ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-06-13 10:50 Message: First, there is a bug in your 3rd spec's should_receive. It should use should_receive(:postcode=) instead of should_receive(:postcode) I was able to reproduce your problem. I can confirm it's due to a bug in RSpec's mock framework and I don't have a fix for it now. I tried to use mocha instead (just use expects instead of should_receive), and all specs passed. I recommend you use mocha until this is fixed. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11545&group_id=797 From noreply at rubyforge.org Wed Jun 13 10:58:39 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Wed, 13 Jun 2007 10:58:39 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11545 ] Rspec doesn't handle should_receive on ActiveRecord associations (r2094) Message-ID: <20070613145839.CFF005240BEF@rubyforge.org> Bugs item #11545, was opened at 2007-06-13 10:00 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11545&group_id=797 Category: mock module Group: None Status: Open Resolution: Accepted Priority: 3 Submitted By: Ian White (ianwhite) Assigned to: Nobody (None) Summary: Rspec doesn't handle should_receive on ActiveRecord associations (r2094) Initial Comment: The attached (standalone) spec should work, but fails on my machine (Mac OS X 10.4.9, rspec(_on_rails) r2094, rails r7006) The spec: class User < ActiveRecord::Base has_one :address, :as => :addressable delegate :postcode, :postcode=, :to => :address end class Address < ActiveRecord::Base belongs_to :addressable, :polymorphic => true end describe 'User with has_one :address' do before do @user = User.new @address = Address.new @user.address = @address end it { @user.should respond_to(:postcode=)} it 'address should repsond to :postcode=' do @address.should respond_to(:postcode=) end it 'should delegate :postcode to :address' do @address.should_receive(:postcode).with('foo').once @user.postcode = 'foo' end it { @user.should respond_to(:postcode=)} # same spec as above it 'address should repsond to :postcode=' do # same spec as above @address.should respond_to(:postcode=) end end produces: ..FFF 1) NameError in 'User with has_one :address should delegate :postcode to :address (using should_receive)' undefined method `postcode' for class `Address' spec/specs/assoc_spec.rb:37: spec/specs/assoc_spec.rb:23: 2) NameError in 'User with has_one :address should respond to #postcode=' undefined method `proxied_by_rspec__postcode' for class `Address' spec/specs/assoc_spec.rb:23: 3) NameError in 'User with has_one :address address should repsond to :postcode=' undefined method `proxied_by_rspec__postcode' for class `Address' spec/specs/assoc_spec.rb:23: ---------------------------------------------------------------------- >Comment By: Ian White (ianwhite) Date: 2007-06-13 14:58 Message: the resubmitted patch is a little cleaner (the top one in the list at the bottom) ---------------------------------------------------------------------- Comment By: Ian White (ianwhite) Date: 2007-06-13 14:58 Message: Bugger - I misspelt receive ("i after e except before c" - it just didn't stick in spelling class...) in the spec ---------------------------------------------------------------------- Comment By: Ian White (ianwhite) Date: 2007-06-13 14:53 Message: Hi David, Attached is diff which specs the problem (methods don't get cleaned up on classes because their metaclass sticks around) in the diff is the fix. This is my first rspec patch - not sure if that random token stuff is supposed to be there. Awesomely comprehensive pre_commit script by the way! ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-06-13 14:23 Message: Mine was less code. Not necessarily cleaner. If you want, please re-submit diff against the new trunk (2095). The spec I added is in rspec/spec/mocks/bug_report_11545.rb. Please add your additional examples (dealing w/ method count) there. Thx ---------------------------------------------------------------------- Comment By: Ian White (ianwhite) Date: 2007-06-13 14:17 Message: I see it at the bottom... the url is http://rubyforge.org/tracker/download.php/797/3149/11545/2095/proxy.diff Yours was cleaner - but I'm worried that yours won't undef method counting method in cleanup - I'm just writing a spec now to be sure. ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-06-13 14:14 Message: Ian - I don't see the diff attached. Feel free to attach it - I'd like to see what you came up w/. Thx ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-06-13 14:10 Message: Fixed in r2095. ---------------------------------------------------------------------- Comment By: Ian White (ianwhite) Date: 2007-06-13 13:50 Message: Wow, that was quick! I had just started to go down that path - attached is a diff that makes the spec pass - I've not yet tested the entire rspec suite, doing that next ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-06-13 13:23 Message: I've found the problem. RSpec asks the object if it responds_to?(:postcode=), to which AR says "yes", at which point RSpec tries to proxy the method by aliasing it and redefining the original. The problem is that there is no original at that point. AR is telling the truth, in that the object will respond_to(:postcode=), but it does it by implementing the method the first time it gets called. Looking into a fix. ---------------------------------------------------------------------- Comment By: Ian White (ianwhite) Date: 2007-06-13 13:16 Message: That's fair enough. I'll start digging. I'm guessing it has something to do with the Rails Association Proxy getting in the way of the RSpec Mock proxy (if you know that's not it - let me know). ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-06-13 12:31 Message: It depends what you mean by "on the agenda". There are several other issues in the tracker and I cannot give you an ETC for this one. If you want this fixed quickly I encourage you to submit a patch. ---------------------------------------------------------------------- Comment By: Ian White (ianwhite) Date: 2007-06-13 11:29 Message: Thanks for the quick response. Can you confirm that fixing this is on the agenda? Or should I be moving to mocha for everything? ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-06-13 10:50 Message: First, there is a bug in your 3rd spec's should_receive. It should use should_receive(:postcode=) instead of should_receive(:postcode) I was able to reproduce your problem. I can confirm it's due to a bug in RSpec's mock framework and I don't have a fix for it now. I tried to use mocha instead (just use expects instead of should_receive), and all specs passed. I recommend you use mocha until this is fixed. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11545&group_id=797 From noreply at rubyforge.org Wed Jun 13 11:13:35 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Wed, 13 Jun 2007 11:13:35 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11545 ] Rspec doesn't handle should_receive on ActiveRecord associations (r2094) Message-ID: <20070613151335.B9FF85240C27@rubyforge.org> Bugs item #11545, was opened at 2007-06-13 10:00 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11545&group_id=797 Category: mock module Group: None >Status: Closed Resolution: Accepted Priority: 3 Submitted By: Ian White (ianwhite) >Assigned to: David Chelimsky (dchelimsky) Summary: Rspec doesn't handle should_receive on ActiveRecord associations (r2094) Initial Comment: The attached (standalone) spec should work, but fails on my machine (Mac OS X 10.4.9, rspec(_on_rails) r2094, rails r7006) The spec: class User < ActiveRecord::Base has_one :address, :as => :addressable delegate :postcode, :postcode=, :to => :address end class Address < ActiveRecord::Base belongs_to :addressable, :polymorphic => true end describe 'User with has_one :address' do before do @user = User.new @address = Address.new @user.address = @address end it { @user.should respond_to(:postcode=)} it 'address should repsond to :postcode=' do @address.should respond_to(:postcode=) end it 'should delegate :postcode to :address' do @address.should_receive(:postcode).with('foo').once @user.postcode = 'foo' end it { @user.should respond_to(:postcode=)} # same spec as above it 'address should repsond to :postcode=' do # same spec as above @address.should respond_to(:postcode=) end end produces: ..FFF 1) NameError in 'User with has_one :address should delegate :postcode to :address (using should_receive)' undefined method `postcode' for class `Address' spec/specs/assoc_spec.rb:37: spec/specs/assoc_spec.rb:23: 2) NameError in 'User with has_one :address should respond to #postcode=' undefined method `proxied_by_rspec__postcode' for class `Address' spec/specs/assoc_spec.rb:23: 3) NameError in 'User with has_one :address address should repsond to :postcode=' undefined method `proxied_by_rspec__postcode' for class `Address' spec/specs/assoc_spec.rb:23: ---------------------------------------------------------------------- >Comment By: David Chelimsky (dchelimsky) Date: 2007-06-13 15:13 Message: Latest patch applied to r2096. Nicely done. Thanks! ---------------------------------------------------------------------- Comment By: Ian White (ianwhite) Date: 2007-06-13 14:58 Message: the resubmitted patch is a little cleaner (the top one in the list at the bottom) ---------------------------------------------------------------------- Comment By: Ian White (ianwhite) Date: 2007-06-13 14:58 Message: Bugger - I misspelt receive ("i after e except before c" - it just didn't stick in spelling class...) in the spec ---------------------------------------------------------------------- Comment By: Ian White (ianwhite) Date: 2007-06-13 14:53 Message: Hi David, Attached is diff which specs the problem (methods don't get cleaned up on classes because their metaclass sticks around) in the diff is the fix. This is my first rspec patch - not sure if that random token stuff is supposed to be there. Awesomely comprehensive pre_commit script by the way! ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-06-13 14:23 Message: Mine was less code. Not necessarily cleaner. If you want, please re-submit diff against the new trunk (2095). The spec I added is in rspec/spec/mocks/bug_report_11545.rb. Please add your additional examples (dealing w/ method count) there. Thx ---------------------------------------------------------------------- Comment By: Ian White (ianwhite) Date: 2007-06-13 14:17 Message: I see it at the bottom... the url is http://rubyforge.org/tracker/download.php/797/3149/11545/2095/proxy.diff Yours was cleaner - but I'm worried that yours won't undef method counting method in cleanup - I'm just writing a spec now to be sure. ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-06-13 14:14 Message: Ian - I don't see the diff attached. Feel free to attach it - I'd like to see what you came up w/. Thx ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-06-13 14:10 Message: Fixed in r2095. ---------------------------------------------------------------------- Comment By: Ian White (ianwhite) Date: 2007-06-13 13:50 Message: Wow, that was quick! I had just started to go down that path - attached is a diff that makes the spec pass - I've not yet tested the entire rspec suite, doing that next ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-06-13 13:23 Message: I've found the problem. RSpec asks the object if it responds_to?(:postcode=), to which AR says "yes", at which point RSpec tries to proxy the method by aliasing it and redefining the original. The problem is that there is no original at that point. AR is telling the truth, in that the object will respond_to(:postcode=), but it does it by implementing the method the first time it gets called. Looking into a fix. ---------------------------------------------------------------------- Comment By: Ian White (ianwhite) Date: 2007-06-13 13:16 Message: That's fair enough. I'll start digging. I'm guessing it has something to do with the Rails Association Proxy getting in the way of the RSpec Mock proxy (if you know that's not it - let me know). ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-06-13 12:31 Message: It depends what you mean by "on the agenda". There are several other issues in the tracker and I cannot give you an ETC for this one. If you want this fixed quickly I encourage you to submit a patch. ---------------------------------------------------------------------- Comment By: Ian White (ianwhite) Date: 2007-06-13 11:29 Message: Thanks for the quick response. Can you confirm that fixing this is on the agenda? Or should I be moving to mocha for everything? ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-06-13 10:50 Message: First, there is a bug in your 3rd spec's should_receive. It should use should_receive(:postcode=) instead of should_receive(:postcode) I was able to reproduce your problem. I can confirm it's due to a bug in RSpec's mock framework and I don't have a fix for it now. I tried to use mocha instead (just use expects instead of should_receive), and all specs passed. I recommend you use mocha until this is fixed. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11545&group_id=797 From noreply at rubyforge.org Wed Jun 13 11:14:42 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Wed, 13 Jun 2007 11:14:42 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11545 ] Rspec doesn't handle should_receive on ActiveRecord associations (r2094) Message-ID: <20070613151442.744665240B64@rubyforge.org> Bugs item #11545, was opened at 2007-06-13 10:00 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11545&group_id=797 Category: mock module Group: None >Status: Open Resolution: Accepted Priority: 3 Submitted By: Ian White (ianwhite) >Assigned to: Nobody (None) Summary: Rspec doesn't handle should_receive on ActiveRecord associations (r2094) Initial Comment: The attached (standalone) spec should work, but fails on my machine (Mac OS X 10.4.9, rspec(_on_rails) r2094, rails r7006) The spec: class User < ActiveRecord::Base has_one :address, :as => :addressable delegate :postcode, :postcode=, :to => :address end class Address < ActiveRecord::Base belongs_to :addressable, :polymorphic => true end describe 'User with has_one :address' do before do @user = User.new @address = Address.new @user.address = @address end it { @user.should respond_to(:postcode=)} it 'address should repsond to :postcode=' do @address.should respond_to(:postcode=) end it 'should delegate :postcode to :address' do @address.should_receive(:postcode).with('foo').once @user.postcode = 'foo' end it { @user.should respond_to(:postcode=)} # same spec as above it 'address should repsond to :postcode=' do # same spec as above @address.should respond_to(:postcode=) end end produces: ..FFF 1) NameError in 'User with has_one :address should delegate :postcode to :address (using should_receive)' undefined method `postcode' for class `Address' spec/specs/assoc_spec.rb:37: spec/specs/assoc_spec.rb:23: 2) NameError in 'User with has_one :address should respond to #postcode=' undefined method `proxied_by_rspec__postcode' for class `Address' spec/specs/assoc_spec.rb:23: 3) NameError in 'User with has_one :address address should repsond to :postcode=' undefined method `proxied_by_rspec__postcode' for class `Address' spec/specs/assoc_spec.rb:23: ---------------------------------------------------------------------- >Comment By: Ian White (ianwhite) Date: 2007-06-13 15:14 Message: No worries, glad to help. Thanks for rspec! ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-06-13 15:13 Message: Latest patch applied to r2096. Nicely done. Thanks! ---------------------------------------------------------------------- Comment By: Ian White (ianwhite) Date: 2007-06-13 14:58 Message: the resubmitted patch is a little cleaner (the top one in the list at the bottom) ---------------------------------------------------------------------- Comment By: Ian White (ianwhite) Date: 2007-06-13 14:58 Message: Bugger - I misspelt receive ("i after e except before c" - it just didn't stick in spelling class...) in the spec ---------------------------------------------------------------------- Comment By: Ian White (ianwhite) Date: 2007-06-13 14:53 Message: Hi David, Attached is diff which specs the problem (methods don't get cleaned up on classes because their metaclass sticks around) in the diff is the fix. This is my first rspec patch - not sure if that random token stuff is supposed to be there. Awesomely comprehensive pre_commit script by the way! ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-06-13 14:23 Message: Mine was less code. Not necessarily cleaner. If you want, please re-submit diff against the new trunk (2095). The spec I added is in rspec/spec/mocks/bug_report_11545.rb. Please add your additional examples (dealing w/ method count) there. Thx ---------------------------------------------------------------------- Comment By: Ian White (ianwhite) Date: 2007-06-13 14:17 Message: I see it at the bottom... the url is http://rubyforge.org/tracker/download.php/797/3149/11545/2095/proxy.diff Yours was cleaner - but I'm worried that yours won't undef method counting method in cleanup - I'm just writing a spec now to be sure. ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-06-13 14:14 Message: Ian - I don't see the diff attached. Feel free to attach it - I'd like to see what you came up w/. Thx ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-06-13 14:10 Message: Fixed in r2095. ---------------------------------------------------------------------- Comment By: Ian White (ianwhite) Date: 2007-06-13 13:50 Message: Wow, that was quick! I had just started to go down that path - attached is a diff that makes the spec pass - I've not yet tested the entire rspec suite, doing that next ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-06-13 13:23 Message: I've found the problem. RSpec asks the object if it responds_to?(:postcode=), to which AR says "yes", at which point RSpec tries to proxy the method by aliasing it and redefining the original. The problem is that there is no original at that point. AR is telling the truth, in that the object will respond_to(:postcode=), but it does it by implementing the method the first time it gets called. Looking into a fix. ---------------------------------------------------------------------- Comment By: Ian White (ianwhite) Date: 2007-06-13 13:16 Message: That's fair enough. I'll start digging. I'm guessing it has something to do with the Rails Association Proxy getting in the way of the RSpec Mock proxy (if you know that's not it - let me know). ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-06-13 12:31 Message: It depends what you mean by "on the agenda". There are several other issues in the tracker and I cannot give you an ETC for this one. If you want this fixed quickly I encourage you to submit a patch. ---------------------------------------------------------------------- Comment By: Ian White (ianwhite) Date: 2007-06-13 11:29 Message: Thanks for the quick response. Can you confirm that fixing this is on the agenda? Or should I be moving to mocha for everything? ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-06-13 10:50 Message: First, there is a bug in your 3rd spec's should_receive. It should use should_receive(:postcode=) instead of should_receive(:postcode) I was able to reproduce your problem. I can confirm it's due to a bug in RSpec's mock framework and I don't have a fix for it now. I tried to use mocha instead (just use expects instead of should_receive), and all specs passed. I recommend you use mocha until this is fixed. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11545&group_id=797 From noreply at rubyforge.org Wed Jun 13 15:37:44 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Wed, 13 Jun 2007 15:37:44 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11545 ] Rspec doesn't handle should_receive on ActiveRecord associations (r2094) Message-ID: <20070613193744.DB9705240C10@rubyforge.org> Bugs item #11545, was opened at 2007-06-13 10:00 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11545&group_id=797 Category: mock module Group: None >Status: Closed Resolution: Accepted Priority: 3 Submitted By: Ian White (ianwhite) Assigned to: Nobody (None) Summary: Rspec doesn't handle should_receive on ActiveRecord associations (r2094) Initial Comment: The attached (standalone) spec should work, but fails on my machine (Mac OS X 10.4.9, rspec(_on_rails) r2094, rails r7006) The spec: class User < ActiveRecord::Base has_one :address, :as => :addressable delegate :postcode, :postcode=, :to => :address end class Address < ActiveRecord::Base belongs_to :addressable, :polymorphic => true end describe 'User with has_one :address' do before do @user = User.new @address = Address.new @user.address = @address end it { @user.should respond_to(:postcode=)} it 'address should repsond to :postcode=' do @address.should respond_to(:postcode=) end it 'should delegate :postcode to :address' do @address.should_receive(:postcode).with('foo').once @user.postcode = 'foo' end it { @user.should respond_to(:postcode=)} # same spec as above it 'address should repsond to :postcode=' do # same spec as above @address.should respond_to(:postcode=) end end produces: ..FFF 1) NameError in 'User with has_one :address should delegate :postcode to :address (using should_receive)' undefined method `postcode' for class `Address' spec/specs/assoc_spec.rb:37: spec/specs/assoc_spec.rb:23: 2) NameError in 'User with has_one :address should respond to #postcode=' undefined method `proxied_by_rspec__postcode' for class `Address' spec/specs/assoc_spec.rb:23: 3) NameError in 'User with has_one :address address should repsond to :postcode=' undefined method `proxied_by_rspec__postcode' for class `Address' spec/specs/assoc_spec.rb:23: ---------------------------------------------------------------------- Comment By: Ian White (ianwhite) Date: 2007-06-13 15:14 Message: No worries, glad to help. Thanks for rspec! ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-06-13 15:13 Message: Latest patch applied to r2096. Nicely done. Thanks! ---------------------------------------------------------------------- Comment By: Ian White (ianwhite) Date: 2007-06-13 14:58 Message: the resubmitted patch is a little cleaner (the top one in the list at the bottom) ---------------------------------------------------------------------- Comment By: Ian White (ianwhite) Date: 2007-06-13 14:58 Message: Bugger - I misspelt receive ("i after e except before c" - it just didn't stick in spelling class...) in the spec ---------------------------------------------------------------------- Comment By: Ian White (ianwhite) Date: 2007-06-13 14:53 Message: Hi David, Attached is diff which specs the problem (methods don't get cleaned up on classes because their metaclass sticks around) in the diff is the fix. This is my first rspec patch - not sure if that random token stuff is supposed to be there. Awesomely comprehensive pre_commit script by the way! ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-06-13 14:23 Message: Mine was less code. Not necessarily cleaner. If you want, please re-submit diff against the new trunk (2095). The spec I added is in rspec/spec/mocks/bug_report_11545.rb. Please add your additional examples (dealing w/ method count) there. Thx ---------------------------------------------------------------------- Comment By: Ian White (ianwhite) Date: 2007-06-13 14:17 Message: I see it at the bottom... the url is http://rubyforge.org/tracker/download.php/797/3149/11545/2095/proxy.diff Yours was cleaner - but I'm worried that yours won't undef method counting method in cleanup - I'm just writing a spec now to be sure. ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-06-13 14:14 Message: Ian - I don't see the diff attached. Feel free to attach it - I'd like to see what you came up w/. Thx ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-06-13 14:10 Message: Fixed in r2095. ---------------------------------------------------------------------- Comment By: Ian White (ianwhite) Date: 2007-06-13 13:50 Message: Wow, that was quick! I had just started to go down that path - attached is a diff that makes the spec pass - I've not yet tested the entire rspec suite, doing that next ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-06-13 13:23 Message: I've found the problem. RSpec asks the object if it responds_to?(:postcode=), to which AR says "yes", at which point RSpec tries to proxy the method by aliasing it and redefining the original. The problem is that there is no original at that point. AR is telling the truth, in that the object will respond_to(:postcode=), but it does it by implementing the method the first time it gets called. Looking into a fix. ---------------------------------------------------------------------- Comment By: Ian White (ianwhite) Date: 2007-06-13 13:16 Message: That's fair enough. I'll start digging. I'm guessing it has something to do with the Rails Association Proxy getting in the way of the RSpec Mock proxy (if you know that's not it - let me know). ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-06-13 12:31 Message: It depends what you mean by "on the agenda". There are several other issues in the tracker and I cannot give you an ETC for this one. If you want this fixed quickly I encourage you to submit a patch. ---------------------------------------------------------------------- Comment By: Ian White (ianwhite) Date: 2007-06-13 11:29 Message: Thanks for the quick response. Can you confirm that fixing this is on the agenda? Or should I be moving to mocha for everything? ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-06-13 10:50 Message: First, there is a bug in your 3rd spec's should_receive. It should use should_receive(:postcode=) instead of should_receive(:postcode) I was able to reproduce your problem. I can confirm it's due to a bug in RSpec's mock framework and I don't have a fix for it now. I tried to use mocha instead (just use expects instead of should_receive), and all specs passed. I recommend you use mocha until this is fixed. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11545&group_id=797 From noreply at rubyforge.org Wed Jun 13 19:26:53 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Wed, 13 Jun 2007 19:26:53 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11562 ] Rake RCov task should work out of the box with --drb in spec.opts Message-ID: <20070613232653.824AB5240C39@rubyforge.org> Bugs item #11562, was opened at 2007-06-13 23:26 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11562&group_id=797 Category: None Group: None Status: Open Resolution: None Priority: 3 Submitted By: Scott Taylor (smtlaissezfaire) Assigned to: Nobody (None) Summary: Rake RCov task should work out of the box with --drb in spec.opts Initial Comment: The rake task spec:rcov does not work if --drb is specified in spec.opts (in a rails project). Here is the output: euclid% rake spec:rcov (in /Users/smtlaissezfaire/Sites/rails/changelog) ................................*..*..*...................*............. ................................... Finished in 5.751487 seconds 107 examples, 0 failures, 4 not implemented No file to analyze was found. All the files loaded by rcov matched one of the following expressions, and were thus ignored: [/\A\/opt\/local\/lib/, /\btc_[^.]*.rb/, /_test\.rb\z/, /\btest\//, /\bvendor\//, /\A\/opt\/local\/lib\/ruby\/gems\/1\.8\/gems\/rcov\-0\.8\.0\.2\/lib\/ rcov\/report\.rb\z/, /spec/, /\bvendor\//, /\bconfig\//, /\benvironment\//] You can solve this by doing one or more of the following: * rename the files not to be ignored so they don't match the above regexps * use --include-file to give a list of patterns for files not to be ignored * use --exclude-only to give the new list of regexps to match against * structure your code as follows: test/test_*.rb for the test cases lib/**/*.rb for the target source code whose coverage you want making sure that the test/test_*.rb files are loading from lib/, e.g. by using the -Ilib command-line argument, adding $:.unshift File.join(File.dirname(__FILE__), "..", "lib") to test/test_*.rb, or running rcov via a Rakefile (read the RDoc documentation or README.rake in the source distribution). But without --drb in spec.opts it works just fine. Here is my setup: Mac OS X.4.9 Fetching external item into 'vendor/rails' External at revision 7014. Fetching external item into 'vendor/plugins/rspec' External at revision 2098. Fetching external item into 'vendor/plugins/rspec_on_rails' External at revision 2098. Fetching external item into 'vendor/plugins/rails_rcov' External at revision 12. rcov gem @version 0.8.0.2 If you have some tips on how to write a spec for this, I'd be glad to write a patch. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11562&group_id=797 From mailing_lists at railsnewbie.com Thu Jun 14 03:27:43 2007 From: mailing_lists at railsnewbie.com (Scott Taylor) Date: Thu, 14 Jun 2007 03:27:43 -0400 Subject: [rspec-devel] Running the rspec_on_rails specs Message-ID: <67E29855-D862-41DA-A228-05480A66C395@railsnewbie.com> It seems that rake pre_commit_rails only runs the specs given for the example rails app, and not the specs under rspec_on_rails/spec/... Or am I wrong? Under what directory should I be running the specs under rspec_on_rails/spec/...? Best, Scott Taylor From antti.tarvainen at iki.fi Thu Jun 14 04:50:25 2007 From: antti.tarvainen at iki.fi (Antti Tarvainen) Date: Thu, 14 Jun 2007 10:50:25 +0200 Subject: [rspec-devel] Running the rspec_on_rails specs In-Reply-To: <67E29855-D862-41DA-A228-05480A66C395@railsnewbie.com> References: <67E29855-D862-41DA-A228-05480A66C395@railsnewbie.com> Message-ID: <5b89e3bd0706140150k3799aee1s78fa9709166924cd@mail.gmail.com> > It seems that rake pre_commit_rails only runs the specs given for the > example rails app, and not the specs under rspec_on_rails/spec/... > Or am I wrong? Under what directory should I be running the specs > under rspec_on_rails/spec/...? It does also run the specs under rspec_on_rails/spec/ . It does this by first copying the rspec_on_rails directory to example_rails_app/vendor/plugins and then running "rake spec:plugins" in example_rails_app directory. If you want to run only the rspec_on_rails specs, you can do it from the root directory with "rake pre_commit_rails" or from example_rails_app with "rake -f Multirails.rake pre_commit". Antti T. From noreply at rubyforge.org Thu Jun 14 18:05:09 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Thu, 14 Jun 2007 18:05:09 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11584 ] Different results for 'rspec' and 'rcov' task in handling hashes. Message-ID: <20070614220509.77ABB5240D2E@rubyforge.org> Bugs item #11584, was opened at 2007-06-14 17:05 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11584&group_id=797 Category: expectation module Group: None Status: Open Resolution: None Priority: 3 Submitted By: Christian Kebekus (ckatorial) Assigned to: Nobody (None) Summary: Different results for 'rspec' and 'rcov' task in handling hashes. Initial Comment: There seems to be a difference between running the spec and the rcov task. As much as I can figure, the access to a hash is not consistent. The spec task returns/iterates through the hash the expected way, while the rcov task does not. = Example See attached file for example. $ rake spec (in /Temp) . Finished in 0.019277 seconds 1 example, 0 failures $ rake rcov (in /Temp) F 1) Spec::Mocks::MockExpectationError in 'The Business Unit Filter with Single Filter Condition should not filter patient with matching only partial fields of business unit' Mock 'patient business unit' expected :key with (any args) once, but received it 0 times ./spec/filters/business_unit_filter_spec.rb:8: Finished in 0.008152 seconds 1 example, 1 failure = Environment $ ruby --version ruby 1.8.6 (2007-03-13 patchlevel 0) [i686-darwin8.9.1] $ gem -v 0.9.4 $ rake --version rake, version 0.7.3 $ gem list | grep rspec rspec (1.0.5) RSpec-1.0.5 (r2081) - BDD for Ruby http://rspec.rubyforge.org/ $ gem list | grep rcov rcov (0.8.0.2) ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11584&group_id=797 From noreply at rubyforge.org Fri Jun 15 17:28:54 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Fri, 15 Jun 2007 17:28:54 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11602 ] Nested #have_tag specifications fails on the wrong line number Message-ID: <20070615212854.4D3CA5240B50@rubyforge.org> Bugs item #11602, was opened at 2007-06-15 17:28 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11602&group_id=797 Category: rails plugin Group: None Status: Open Resolution: None Priority: 3 Submitted By: Fran?ois Beausoleil (fbos) Assigned to: Nobody (None) Summary: Nested #have_tag specifications fails on the wrong line number Initial Comment: Ouch... I just spent two hours on this, to finally find that the bug wasn't what I thought at all... I had the following specification (Rails View): response.should have_tag("a[href$=?]", download_asset_path(@asset)) do with_tag "img[src=?]", download_asset_path(@asset) with_tag "img[width=200]" with_tag "img[height=212]" with_tag "img[alt=?]", @asset.title end RSpec was reporting a spec failure on the first line above. After 2 hours of investigation, test reformulating and all, I finally found that the correction was this: response.should have_tag("a[href$=?]", download_asset_path(@asset)) do with_tag "img[src=?]", download_asset_path(@asset) with_tag "img[width=?]", @asset.height with_tag "img[height=?]", @asset.height with_tag "img[alt=?]", @asset.title end No more errors. And sure enough: with_tag "img[width=?]", @asset.height again reports the failure against the "response.should have_tag" line. This is with RSpec 1.0.4. Bye ! Fran?ois ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11602&group_id=797 From noreply at rubyforge.org Sat Jun 16 00:32:56 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Sat, 16 Jun 2007 00:32:56 -0400 (EDT) Subject: [rspec-devel] [ rspec-Patches-11608 ] Exclude rspec_on_rails from plugin spec runs Message-ID: <20070616043256.94A405240C50@rubyforge.org> Patches item #11608, was opened at 2007-06-16 04:32 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3151&aid=11608&group_id=797 Category: rails plugin Group: None Status: Open Resolution: None Priority: 3 Submitted By: Kyle Hargraves (philodespotos) Assigned to: Nobody (None) Summary: Exclude rspec_on_rails from plugin spec runs Initial Comment: Simple patch to exclude rspec_on_rails' plugin specs from the spec:plugins and :plugin_doc tasks. rspec_on_rails' specs largely fail for me, anyhow, so this seems like the best way to go. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3151&aid=11608&group_id=797 From noreply at rubyforge.org Sat Jun 16 07:41:24 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Sat, 16 Jun 2007 07:41:24 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11602 ] Nested #have_tag specifications fails on the wrong line number Message-ID: <20070616114124.883305240995@rubyforge.org> Bugs item #11602, was opened at 2007-06-15 17:28 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11602&group_id=797 Category: rails plugin Group: None Status: Open Resolution: None Priority: 3 Submitted By: Fran?ois Beausoleil (fbos) Assigned to: Nobody (None) Summary: Nested #have_tag specifications fails on the wrong line number Initial Comment: Ouch... I just spent two hours on this, to finally find that the bug wasn't what I thought at all... I had the following specification (Rails View): response.should have_tag("a[href$=?]", download_asset_path(@asset)) do with_tag "img[src=?]", download_asset_path(@asset) with_tag "img[width=200]" with_tag "img[height=212]" with_tag "img[alt=?]", @asset.title end RSpec was reporting a spec failure on the first line above. After 2 hours of investigation, test reformulating and all, I finally found that the correction was this: response.should have_tag("a[href$=?]", download_asset_path(@asset)) do with_tag "img[src=?]", download_asset_path(@asset) with_tag "img[width=?]", @asset.height with_tag "img[height=?]", @asset.height with_tag "img[alt=?]", @asset.title end No more errors. And sure enough: with_tag "img[width=?]", @asset.height again reports the failure against the "response.should have_tag" line. This is with RSpec 1.0.4. Bye ! Fran?ois ---------------------------------------------------------------------- >Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-06-16 07:41 Message: Please attach the whole stack trace, both with and without -b. Also, please attach the files so we can see the line numbers. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11602&group_id=797 From noreply at rubyforge.org Sat Jun 16 08:32:19 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Sat, 16 Jun 2007 08:32:19 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11615 ] Partial mock methods give ambiguous failures when given a method name as a String Message-ID: <20070616123220.18A40524099A@rubyforge.org> Bugs item #11615, was opened at 2007-06-16 07:32 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11615&group_id=797 Category: mock module Group: None Status: Open Resolution: None Priority: 3 Submitted By: Jay Phillips (jicksta) Assigned to: Nobody (None) Summary: Partial mock methods give ambiguous failures when given a method name as a String Initial Comment: Included is a patch to a bug I was experiencing when mocking out methods. Since Ruby allows either Strings or Symbols to be passed to methods such as send() or respond_to?(), I assumed a String could be given to obj.should_receive() and obj.should_not_receive(). Doing this resulted in a good 30 minutes loss of my time because of an ambiguous error message. It seemed to make the method simply unavailable to the other objects calling the mock but not being picked up by the proxy as called. No harm done! Hope this helps. :) Jay Phillips Adhearsion Project Manager http://jicksta.com ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11615&group_id=797 From noreply at rubyforge.org Sat Jun 16 17:42:45 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Sat, 16 Jun 2007 17:42:45 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11615 ] Partial mock methods give ambiguous failures when given a method name as a String Message-ID: <20070616214245.52CF65240B56@rubyforge.org> Bugs item #11615, was opened at 2007-06-16 12:32 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11615&group_id=797 Category: mock module Group: None >Status: Closed >Resolution: Accepted Priority: 3 Submitted By: Jay Phillips (jicksta) >Assigned to: David Chelimsky (dchelimsky) Summary: Partial mock methods give ambiguous failures when given a method name as a String Initial Comment: Included is a patch to a bug I was experiencing when mocking out methods. Since Ruby allows either Strings or Symbols to be passed to methods such as send() or respond_to?(), I assumed a String could be given to obj.should_receive() and obj.should_not_receive(). Doing this resulted in a good 30 minutes loss of my time because of an ambiguous error message. It seemed to make the method simply unavailable to the other objects calling the mock but not being picked up by the proxy as called. No harm done! Hope this helps. :) Jay Phillips Adhearsion Project Manager http://jicksta.com ---------------------------------------------------------------------- >Comment By: David Chelimsky (dchelimsky) Date: 2007-06-16 21:42 Message: Applied to r2099 ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11615&group_id=797 From noreply at rubyforge.org Sun Jun 17 06:22:06 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Sun, 17 Jun 2007 06:22:06 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11628 ] error mocking partial page variable only after partial has already been rendered Message-ID: <20070617102206.E95FA5240A8A@rubyforge.org> Bugs item #11628, was opened at 2007-06-17 10:22 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11628&group_id=797 Category: rails plugin Group: None Status: Open Resolution: None Priority: 3 Submitted By: David Chelimsky (dchelimsky) Assigned to: Nobody (None) Summary: error mocking partial page variable only after partial has already been rendered Initial Comment: Steps to reproduce: Apply the attached patch (which adds an example file w/ 2 examples) cd example_rails_app rake rspec:install_plugin script/spec spec/views/person/_person.rhtml_spec.rb You should see an error. If, however, you apply --reverse, you should not: script/spec spec/views/person/_person.rhtml_spec.rb --reverse ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11628&group_id=797 From noreply at rubyforge.org Sun Jun 17 06:23:06 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Sun, 17 Jun 2007 06:23:06 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11628 ] error mocking partial page variable only after partial has already been rendered Message-ID: <20070617102306.394A85240A9B@rubyforge.org> Bugs item #11628, was opened at 2007-06-17 10:22 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11628&group_id=797 Category: rails plugin Group: None Status: Open Resolution: None Priority: 3 Submitted By: David Chelimsky (dchelimsky) Assigned to: Nobody (None) Summary: error mocking partial page variable only after partial has already been rendered Initial Comment: Steps to reproduce: Apply the attached patch (which adds an example file w/ 2 examples) cd example_rails_app rake rspec:install_plugin script/spec spec/views/person/_person.rhtml_spec.rb You should see an error. If, however, you apply --reverse, you should not: script/spec spec/views/person/_person.rhtml_spec.rb --reverse ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11628&group_id=797 From noreply at rubyforge.org Sun Jun 17 06:23:21 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Sun, 17 Jun 2007 06:23:21 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11628 ] error mocking partial page variable only after partial has already been rendered Message-ID: <20070617102321.213CA5240AAA@rubyforge.org> Bugs item #11628, was opened at 2007-06-17 10:22 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11628&group_id=797 Category: rails plugin Group: None Status: Open Resolution: None Priority: 3 Submitted By: David Chelimsky (dchelimsky) Assigned to: Nobody (None) Summary: error mocking partial page variable only after partial has already been rendered Initial Comment: Steps to reproduce: Apply the attached patch (which adds an example file w/ 2 examples) cd example_rails_app rake rspec:install_plugin script/spec spec/views/person/_person.rhtml_spec.rb You should see an error. If, however, you apply --reverse, you should not: script/spec spec/views/person/_person.rhtml_spec.rb --reverse ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11628&group_id=797 From noreply at rubyforge.org Mon Jun 18 11:20:57 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Mon, 18 Jun 2007 11:20:57 -0400 (EDT) Subject: [rspec-devel] [ rspec-Patches-11658 ] Removal of duplicated spec in OptionParser Message-ID: <20070618152057.69BC75240B67@rubyforge.org> Patches item #11658, was opened at 2007-06-18 15:20 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3151&aid=11658&group_id=797 Category: runner module Group: None Status: Open Resolution: None Priority: 3 Submitted By: Scott Taylor (smtlaissezfaire) Assigned to: Nobody (None) Summary: Removal of duplicated spec in OptionParser Initial Comment: A spec used in the option parser spec is duplicated in the option spec. It appears as though the option parser should only used to parse command line options, while the Option class is used to provide the behavior for those options given on the command line. The spec which should remain in the code base is the specification "parse_example sets examples to contents of file" in rspec/spec/spec/runner/options_spec.rb ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3151&aid=11658&group_id=797 From noreply at rubyforge.org Mon Jun 18 11:22:58 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Mon, 18 Jun 2007 11:22:58 -0400 (EDT) Subject: [rspec-devel] [ rspec-Patches-10645 ] removal of --examples when appropriate Message-ID: <20070618152258.7CF045240B68@rubyforge.org> Patches item #10645, was opened at 2007-05-07 05:13 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3151&aid=10645&group_id=797 Category: runner module Group: None Status: Open Resolution: None Priority: 3 Submitted By: Scott Taylor (smtlaissezfaire) Assigned to: Nobody (None) Summary: removal of --examples when appropriate Initial Comment: See ticket: #10545 "Removal of --options when appropriate" http://rubyforge.org/tracker/index.php?func=detail&aid=10545&group_id=797&atid=3151 David/Aslak: I added a an attribute reader for @where in the base text formatter, and called the method output. Feel free to change this as you wish. It is only referenced in the Options class, under the method I've added: remove_extraneous_examples! ---------------------------------------------------------------------- >Comment By: Scott Taylor (smtlaissezfaire) Date: 2007-06-18 15:22 Message: Here is the simple solution you were looking for, Aslak. I've attached it as patch3.diff ---------------------------------------------------------------------- Comment By: Scott Taylor (smtlaissezfaire) Date: 2007-05-27 04:55 Message: Feel free to close this one. The last patch doesn't do what I thought it did (Obviously I should have included specs). I don't know a good way to get around the problem except by implementing some logic similar to what I have done in the first patch. It can be cleaned up a bit, but otherwise I don't see a way to do it simply & cleanly. Let me know if you have any other ideas. Otherwise, reject it. ---------------------------------------------------------------------- Comment By: Scott Taylor (smtlaissezfaire) Date: 2007-05-11 22:31 Message: Well, now that I look at it, it appears as though it isn't that simple, because if you want the example switch to touch the file, it *needs to know* that it is a file, and not a simple example (this is why there was the complicated logic in my patch). On the other hand, the --formatter switch does touch the file. So the bug looks like it only occurs when you specify --examples before --formatter, because ::OptionParser parses options sequentially, as they are given on the command line. I've opted for a low-tech solution (in this version of the patch), so that --help will specify that --examples should come after the corresponding formatter. Another low-tech solution exists, of course, and that would be to have an --example switch which only processes named examples, and an --example-file switch which would process a formatted file. ---------------------------------------------------------------------- Comment By: Scott Taylor (smtlaissezfaire) Date: 2007-05-10 20:01 Message: I agree, Aslak. Although I don't think touch would be the appropriate thing to use here, because it modifies the mtimes, and that would be a problem for autotest. I'll rework the code. btw: thanks for applying the other patch ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-05-10 13:41 Message: I'm not so keen on applying this. It seems like a complicated solution to a simple problem. An easier solution is this: $ touch previous_failures.txt ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3151&aid=10645&group_id=797 From noreply at rubyforge.org Tue Jun 19 14:58:23 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Tue, 19 Jun 2007 14:58:23 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11508 ] Exceptions are not raised for Controller Specs Message-ID: <20070619185824.057035240B19@rubyforge.org> Bugs item #11508, was opened at 2007-06-11 13:06 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11508&group_id=797 Category: rails plugin Group: None Status: Open Resolution: None Priority: 3 Submitted By: Brian Takita (btakita) Assigned to: Nobody (None) Summary: Exceptions are not raised for Controller Specs Initial Comment: The issue is old_rescue_action is called if the exception is not a MockExpectationError. This makes it hard to find exceptions in controllers. The standard Rails test behaviour is to always raise an exception. It used to work in 0.9.4. module ActionController module Rescue protected alias old_rescue_action rescue_action def rescue_action(exception) raise exception if exception.is_a?(Spec::Mocks::MockExpectationError) old_rescue_action(exception) end end end ---------------------------------------------------------------------- >Comment By: Brian Takita (btakita) Date: 2007-06-19 11:58 Message: Can we raise errors by default? This is what most people expect. ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-06-11 13:17 Message: If you run script/generate rspec you'll see the following in spec_helper.rb: config.before(:each, :behaviour_type => :controller) do raise_controller_errors end That makes things work as you suspect, and allows you use your own rescue_action if you want to. This is a bit experimental and hence not very well doc'd, so I'll leave this open. But you can use that for now. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11508&group_id=797 From noreply at rubyforge.org Tue Jun 19 15:03:00 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Tue, 19 Jun 2007 15:03:00 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11508 ] Exceptions are not raised for Controller Specs Message-ID: <20070619190301.286035240AA3@rubyforge.org> Bugs item #11508, was opened at 2007-06-11 13:06 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11508&group_id=797 Category: rails plugin Group: None Status: Open Resolution: None Priority: 3 Submitted By: Brian Takita (btakita) Assigned to: Nobody (None) Summary: Exceptions are not raised for Controller Specs Initial Comment: The issue is old_rescue_action is called if the exception is not a MockExpectationError. This makes it hard to find exceptions in controllers. The standard Rails test behaviour is to always raise an exception. It used to work in 0.9.4. module ActionController module Rescue protected alias old_rescue_action rescue_action def rescue_action(exception) raise exception if exception.is_a?(Spec::Mocks::MockExpectationError) old_rescue_action(exception) end end end ---------------------------------------------------------------------- >Comment By: Brian Takita (btakita) Date: 2007-06-19 12:03 Message: Maybe have the inverse of raise_controller_errors to deviate from the default (e.g. raise_only_mock_controller_errors)? ---------------------------------------------------------------------- Comment By: Brian Takita (btakita) Date: 2007-06-19 11:58 Message: Can we raise errors by default? This is what most people expect. ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-06-11 13:17 Message: If you run script/generate rspec you'll see the following in spec_helper.rb: config.before(:each, :behaviour_type => :controller) do raise_controller_errors end That makes things work as you suspect, and allows you use your own rescue_action if you want to. This is a bit experimental and hence not very well doc'd, so I'll leave this open. But you can use that for now. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11508&group_id=797 From bob.cotton at rallydev.com Tue Jun 19 18:14:56 2007 From: bob.cotton at rallydev.com (Bob Cotton) Date: Tue, 19 Jun 2007 16:14:56 -0600 Subject: [rspec-devel] Feedback on spec_ui and screenshots Message-ID: Having just implemented a screenshot capability into Selenium RC (which, BTW is cross platform and uses Java's Robot class), I have some feedback on the implementation in spec_ui Because the selenium server is doing the screenshot, then encoding the data and returning it over the wire to the test driver, taking a screenshot for after(:each) seems run a bit slow. It would be nice if it only took screenshots when there was a failure. Unfortunately there are no hooks to configure formatters other than the command line, or are there? Also, we tend to run both GUI specs and non-gui specs in the same run, so hooking up the screenshot in Spec::Runner.configure is cumbersome. Sort of a variant on not being able to configure the reporter. I could always subclass the Screenshot formatter. Is there a better way? -Bob From aslak.hellesoy at gmail.com Wed Jun 20 03:13:52 2007 From: aslak.hellesoy at gmail.com (aslak hellesoy) Date: Wed, 20 Jun 2007 09:13:52 +0200 Subject: [rspec-devel] Feedback on spec_ui and screenshots In-Reply-To: References: Message-ID: <8d961d900706200013s7717578br37791621e40b95ae@mail.gmail.com> On 6/20/07, Bob Cotton wrote: > > Having just implemented a screenshot capability into Selenium RC > (which, BTW is cross platform and uses Java's Robot class), I have > some feedback on the implementation in spec_ui > > Because the selenium server is doing the screenshot, then encoding the > data and returning it over the wire to the test driver, taking a > screenshot for after(:each) seems run a bit slow. > I agree. The encoding feature is experimental, and I think I'll turn it off by default, with an option to turn it on. > It would be nice if it only took screenshots when there was a > failure. Unfortunately there are no hooks to configure formatters > other than the command line, or are there? > We don't have any other hooks than the standard options on the commandline. I realise there is a need for more fine grained options. Do you have any suggestions about how to implement it without coupling RSpec to Spec::Ui? > Also, we tend to run both GUI specs and non-gui specs in the same run, > so hooking up the screenshot in Spec::Runner.configure is cumbersome. > Sort of a variant on not being able to configure the reporter. > You should be able to use: config.after(:each, :behaviour_type => 'selenium') {} And describe "Rally rocks", :behaviour_type => 'selenium' {} to filter it out. I haven't tried this particular case, but it *should* work. Holler if it doesn't. > I could always subclass the Screenshot formatter. Is there a better > way? > Not for now, but I'm looking for one. > -Bob > _______________________________________________ > rspec-devel mailing list > rspec-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-devel > From noreply at rubyforge.org Wed Jun 20 06:19:17 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Wed, 20 Jun 2007 06:19:17 -0400 (EDT) Subject: [rspec-devel] [ rspec-Feature Requests-11707 ] paramters for shared behaviours Message-ID: <20070620101917.BDB9D52409B4@rubyforge.org> Feature Requests item #11707, was opened at 2007-06-20 10:19 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3152&aid=11707&group_id=797 Category: None Group: None Status: Open Priority: 3 Submitted By: David Green (david_green) Assigned to: Nobody (None) Summary: paramters for shared behaviours Initial Comment: It would be useful if shared behaviours could accept parameters. this thread on the rspec users mailing list is a good example of when such a feature is needed: http://www.nabble.com/dynamic-specs-tf3927280.html ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3152&aid=11707&group_id=797 From noreply at rubyforge.org Wed Jun 20 07:35:33 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Wed, 20 Jun 2007 07:35:33 -0400 (EDT) Subject: [rspec-devel] [ rspec-Feature Requests-11707 ] paramters for shared behaviours Message-ID: <20070620113533.6A8495240A30@rubyforge.org> Feature Requests item #11707, was opened at 2007-06-20 10:19 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3152&aid=11707&group_id=797 Category: None Group: None Status: Open Priority: 3 Submitted By: David Green (david_green) Assigned to: Nobody (None) Summary: paramters for shared behaviours Initial Comment: It would be useful if shared behaviours could accept parameters. this thread on the rspec users mailing list is a good example of when such a feature is needed: http://www.nabble.com/dynamic-specs-tf3927280.html ---------------------------------------------------------------------- >Comment By: David Chelimsky (dchelimsky) Date: 2007-06-20 11:35 Message: Giving this some more thought, this turns out to be rather problematic. Not only due to the re-design work but because of usage problems. Let's say you have the following setup: describe "All Accounts", :shared => true do |account| it "should let you withdraw less than it has" do account.deposit 50 account.withdraw 20 account.balance.should == 30 end it "should not let you withdraw more than it has" do account.deposit 20 account.withdraw 21 account.balance.should == 20 end ... end describe CheckingAccount do it_should_behave_like "All Accounts", CheckingAccount.new ... end This seems perfectly reasonable, right? Well the first problem is that the two examples in the shared behaviour don't have access to the account instance. You'd have to do this to your implementation: describe "All Accounts", :shared => true do |acc| def account acc end ... end Once that problem is solved, we would find that the second example would fail saying the balance is 29. Why? Because CheckingAccount.new would only be evaluated once, and the same instance would be used in both of the examples. We could solve by passing a block to it_should_behave_like: describe CheckingAccount do it_should_behave_like "All Accounts" {CheckingAccount.new} ... end Or passing method names: describe CheckingAccount do it_should_behave_like "All Accounts", :new_checking_account def new_checking_account CheckingAccount.new end ... end But now we're starting to loose the benefits to verbosity and confusion. Anybody see a simpler way? ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3152&aid=11707&group_id=797 From noreply at rubyforge.org Wed Jun 20 12:48:02 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Wed, 20 Jun 2007 12:48:02 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11508 ] Exceptions are not raised for Controller Specs Message-ID: <20070620164802.B774D5240BED@rubyforge.org> Bugs item #11508, was opened at 2007-06-11 13:06 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11508&group_id=797 Category: rails plugin Group: None Status: Open Resolution: None Priority: 3 Submitted By: Brian Takita (btakita) Assigned to: Nobody (None) Summary: Exceptions are not raised for Controller Specs Initial Comment: The issue is old_rescue_action is called if the exception is not a MockExpectationError. This makes it hard to find exceptions in controllers. The standard Rails test behaviour is to always raise an exception. It used to work in 0.9.4. module ActionController module Rescue protected alias old_rescue_action rescue_action def rescue_action(exception) raise exception if exception.is_a?(Spec::Mocks::MockExpectationError) old_rescue_action(exception) end end end ---------------------------------------------------------------------- >Comment By: Brian Takita (btakita) Date: 2007-06-20 09:48 Message: Unless you guys object, I'm going to fix this issue within the next few days. There have been some complaints, and considerable time spent debugging because of this issue. ---------------------------------------------------------------------- Comment By: Brian Takita (btakita) Date: 2007-06-19 12:03 Message: Maybe have the inverse of raise_controller_errors to deviate from the default (e.g. raise_only_mock_controller_errors)? ---------------------------------------------------------------------- Comment By: Brian Takita (btakita) Date: 2007-06-19 11:58 Message: Can we raise errors by default? This is what most people expect. ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-06-11 13:17 Message: If you run script/generate rspec you'll see the following in spec_helper.rb: config.before(:each, :behaviour_type => :controller) do raise_controller_errors end That makes things work as you suspect, and allows you use your own rescue_action if you want to. This is a bit experimental and hence not very well doc'd, so I'll leave this open. But you can use that for now. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11508&group_id=797 From noreply at rubyforge.org Wed Jun 20 12:54:20 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Wed, 20 Jun 2007 12:54:20 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11508 ] Exceptions are not raised for Controller Specs Message-ID: <20070620165420.21E425240B03@rubyforge.org> Bugs item #11508, was opened at 2007-06-11 20:06 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11508&group_id=797 Category: rails plugin Group: None Status: Open Resolution: None Priority: 3 Submitted By: Brian Takita (btakita) Assigned to: Nobody (None) Summary: Exceptions are not raised for Controller Specs Initial Comment: The issue is old_rescue_action is called if the exception is not a MockExpectationError. This makes it hard to find exceptions in controllers. The standard Rails test behaviour is to always raise an exception. It used to work in 0.9.4. module ActionController module Rescue protected alias old_rescue_action rescue_action def rescue_action(exception) raise exception if exception.is_a?(Spec::Mocks::MockExpectationError) old_rescue_action(exception) end end end ---------------------------------------------------------------------- >Comment By: David Chelimsky (dchelimsky) Date: 2007-06-20 16:54 Message: Please do. No objection. In fact, let's plan a 1.0.6 release after you get this done and we fix http://rubyforge.org/tracker/index.php?func=detail&aid=11628&group_id=797&atid=3149. Whatever the solution is, lets be noisy about it when we do the release. This thing has been happening under the radar and that's probably more frustrating than anything for people. Thanks Brian. David ---------------------------------------------------------------------- Comment By: Brian Takita (btakita) Date: 2007-06-20 16:48 Message: Unless you guys object, I'm going to fix this issue within the next few days. There have been some complaints, and considerable time spent debugging because of this issue. ---------------------------------------------------------------------- Comment By: Brian Takita (btakita) Date: 2007-06-19 19:03 Message: Maybe have the inverse of raise_controller_errors to deviate from the default (e.g. raise_only_mock_controller_errors)? ---------------------------------------------------------------------- Comment By: Brian Takita (btakita) Date: 2007-06-19 18:58 Message: Can we raise errors by default? This is what most people expect. ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-06-11 20:17 Message: If you run script/generate rspec you'll see the following in spec_helper.rb: config.before(:each, :behaviour_type => :controller) do raise_controller_errors end That makes things work as you suspect, and allows you use your own rescue_action if you want to. This is a bit experimental and hence not very well doc'd, so I'll leave this open. But you can use that for now. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11508&group_id=797 From noreply at rubyforge.org Wed Jun 20 18:43:07 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Wed, 20 Jun 2007 18:43:07 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11726 ] Rspec on Rails does not use Active Record's fixture optimization Message-ID: <20070620224308.0318D5240A51@rubyforge.org> Bugs item #11726, was opened at 2007-06-20 15:43 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11726&group_id=797 Category: rails plugin Group: None Status: Open Resolution: None Priority: 3 Submitted By: Brian Takita (btakita) Assigned to: Nobody (None) Summary: Rspec on Rails does not use Active Record's fixture optimization Initial Comment: Active Record fixtures are "cached" in a Hash based on the class. Since Rspec uses anonymous classes, there are no cache hits. See fixtures.rb in ActiveRecord line 537. If we can figure out how to utilize there cached fixtures, specs that use fixtures will be considerably faster. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11726&group_id=797 From noreply at rubyforge.org Wed Jun 20 19:02:45 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Wed, 20 Jun 2007 19:02:45 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11726 ] Rspec on Rails does not use Active Record's fixture optimization Message-ID: <20070620230245.3AC9A5240A2E@rubyforge.org> Bugs item #11726, was opened at 2007-06-20 15:43 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11726&group_id=797 Category: rails plugin Group: None Status: Open Resolution: None Priority: 3 Submitted By: Brian Takita (btakita) Assigned to: Nobody (None) Summary: Rspec on Rails does not use Active Record's fixture optimization Initial Comment: Active Record fixtures are "cached" in a Hash based on the class. Since Rspec uses anonymous classes, there are no cache hits. See fixtures.rb in ActiveRecord line 537. If we can figure out how to utilize there cached fixtures, specs that use fixtures will be considerably faster. ---------------------------------------------------------------------- >Comment By: Brian Takita (btakita) Date: 2007-06-20 16:02 Message: The other benefit to fixing this is using "all" of the fixtures for every example would pretty much be free, as long as transactional fixtures are used. This means we don't need to worry about which fixtures need to be loaded for the example. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11726&group_id=797 From noreply at rubyforge.org Thu Jun 21 12:39:43 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Thu, 21 Jun 2007 12:39:43 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11508 ] Exceptions are not raised for Controller Specs Message-ID: <20070621163943.BEF3A5240B14@rubyforge.org> Bugs item #11508, was opened at 2007-06-11 13:06 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11508&group_id=797 Category: rails plugin Group: None Status: Open Resolution: None Priority: 3 Submitted By: Brian Takita (btakita) Assigned to: Nobody (None) Summary: Exceptions are not raised for Controller Specs Initial Comment: The issue is old_rescue_action is called if the exception is not a MockExpectationError. This makes it hard to find exceptions in controllers. The standard Rails test behaviour is to always raise an exception. It used to work in 0.9.4. module ActionController module Rescue protected alias old_rescue_action rescue_action def rescue_action(exception) raise exception if exception.is_a?(Spec::Mocks::MockExpectationError) old_rescue_action(exception) end end end ---------------------------------------------------------------------- >Comment By: Brian Takita (btakita) Date: 2007-06-21 09:39 Message: Fix checked in Rev 2103. I still need to remove the experimental code. ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-06-20 09:54 Message: Please do. No objection. In fact, let's plan a 1.0.6 release after you get this done and we fix http://rubyforge.org/tracker/index.php?func=detail&aid=11628&group_id=797&atid=3149. Whatever the solution is, lets be noisy about it when we do the release. This thing has been happening under the radar and that's probably more frustrating than anything for people. Thanks Brian. David ---------------------------------------------------------------------- Comment By: Brian Takita (btakita) Date: 2007-06-20 09:48 Message: Unless you guys object, I'm going to fix this issue within the next few days. There have been some complaints, and considerable time spent debugging because of this issue. ---------------------------------------------------------------------- Comment By: Brian Takita (btakita) Date: 2007-06-19 12:03 Message: Maybe have the inverse of raise_controller_errors to deviate from the default (e.g. raise_only_mock_controller_errors)? ---------------------------------------------------------------------- Comment By: Brian Takita (btakita) Date: 2007-06-19 11:58 Message: Can we raise errors by default? This is what most people expect. ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-06-11 13:17 Message: If you run script/generate rspec you'll see the following in spec_helper.rb: config.before(:each, :behaviour_type => :controller) do raise_controller_errors end That makes things work as you suspect, and allows you use your own rescue_action if you want to. This is a bit experimental and hence not very well doc'd, so I'll leave this open. But you can use that for now. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11508&group_id=797 From exceedhl at gmail.com Thu Jun 21 13:02:24 2007 From: exceedhl at gmail.com (Huang Liang) Date: Fri, 22 Jun 2007 01:02:24 +0800 Subject: [rspec-devel] Are rspec code actually "driven" out from the spec incrementally? Message-ID: The spec in the source code package are very good examples and description for rspec. When I am looking at those spec, I wonder if the rspec are actually driven out by those spec step by step or we just add those spec after the core functionality of rspec has been finished? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/rspec-devel/attachments/20070622/908fdbb3/attachment.html From noreply at rubyforge.org Thu Jun 21 14:50:18 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Thu, 21 Jun 2007 14:50:18 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11749 ] Use of 'rescue => e' does not catch all exceptions Message-ID: <20070621185018.E1E1F5240AD3@rubyforge.org> Bugs item #11749, was opened at 2007-06-21 12:50 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11749&group_id=797 Category: None Group: None Status: Open Resolution: None Priority: 3 Submitted By: Bob Cotton (bcotton) Assigned to: Nobody (None) Summary: Use of 'rescue => e' does not catch all exceptions Initial Comment: There are several uses of 'rescue => e' in Behaviour and Example. According my PixAxe book rescue without an exception type will only catch RuntimeException. This seems wrong. I've got Timeout::Error (an Interrupt) escaping and killing my entire spec run. very frustrating. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11749&group_id=797 From dchelimsky at gmail.com Thu Jun 21 15:41:28 2007 From: dchelimsky at gmail.com (David Chelimsky) Date: Thu, 21 Jun 2007 14:41:28 -0500 Subject: [rspec-devel] Are rspec code actually "driven" out from the spec incrementally? In-Reply-To: References: Message-ID: <57c63afe0706211241o5071ef90pf86a604cf48e7287@mail.gmail.com> On 6/21/07, Huang Liang wrote: > The spec in the source code package are very good examples and description > for rspec. When I am looking at those spec, I wonder if the rspec are > actually driven out by those spec step by step or we just add those spec > after the core functionality of rspec has been finished? What do you think? :) > > _______________________________________________ > rspec-devel mailing list > rspec-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-devel > From exceedhl at gmail.com Thu Jun 21 22:57:18 2007 From: exceedhl at gmail.com (Huang Liang) Date: Fri, 22 Jun 2007 10:57:18 +0800 Subject: [rspec-devel] Are rspec code actually "driven" out from the spec incrementally? In-Reply-To: <57c63afe0706211241o5071ef90pf86a604cf48e7287@mail.gmail.com> References: <57c63afe0706211241o5071ef90pf86a604cf48e7287@mail.gmail.com> Message-ID: :-) I did not see that it is impossible. It's exciting for me to know that a tool can be actually driven out by itself because I have not done such kind of thing before. Many tools like CruiseControl eat their own dog food, but that happens after the tool has been in a minimal usable state. What I guess is if I want to use rspec to drive out the rspec, a spec might look like: describe Something, " ..." do it "..." do # setup fixture # action and verify using should... end end but in order to make this pass, actually we have to let rspec support several base functionalities like describe, it, should, which might be too much for just finishing one test. And when you are trying to fullfill this spec(which is like a test), you are not focusing on the functionality described by the spec, you have to work on some other functionality to make this spec work first and see the test result. Moreover, if we are using stories to manage the requirements of rspec, we may found the work contained in one story is not a vertical slice of the whole functionality. The story contains much other functionalities that spreads horizontally across different parts, which makes the story not small, very testable and estimable and describing a very clear business value. The above is just my guess. I'd like to know how the dev team actually drive out this great tool. On 6/22/07, David Chelimsky wrote: > > On 6/21/07, Huang Liang wrote: > > The spec in the source code package are very good examples and > description > > for rspec. When I am looking at those spec, I wonder if the rspec are > > actually driven out by those spec step by step or we just add those spec > > after the core functionality of rspec has been finished? > > What do you think? :) > > > > > _______________________________________________ > > rspec-devel mailing list > > rspec-devel at rubyforge.org > > http://rubyforge.org/mailman/listinfo/rspec-devel > > > _______________________________________________ > rspec-devel mailing list > rspec-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-devel > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/rspec-devel/attachments/20070622/2fc7d019/attachment.html From dchelimsky at gmail.com Thu Jun 21 23:17:04 2007 From: dchelimsky at gmail.com (David Chelimsky) Date: Thu, 21 Jun 2007 22:17:04 -0500 Subject: [rspec-devel] Are rspec code actually "driven" out from the spec incrementally? In-Reply-To: References: <57c63afe0706211241o5071ef90pf86a604cf48e7287@mail.gmail.com> Message-ID: <57c63afe0706212017p518d527dj50e5f493d78969f2@mail.gmail.com> On 6/21/07, Huang Liang wrote: > :-) > > I did not see that it is impossible. It's exciting for me to know that a > tool can be actually driven out by itself because I have not done such kind > of thing before. Many tools like CruiseControl eat their own dog food, but > that happens after the tool has been in a minimal usable state. > > What I guess is if I want to use rspec to drive out the rspec, a spec might > look like: > > describe Something, " ..." do > it "..." do > # setup fixture > # action and verify using should... > end > end > > but in order to make this pass, actually we have to let rspec support > several base functionalities like describe, it, should, which might be too > much for just finishing one test. And when you are trying to fullfill this > spec(which is like a test), you are not focusing on the functionality > described by the spec, you have to work on some other functionality to make > this spec work first and see the test result. > > Moreover, if we are using stories to manage the requirements of rspec, we > may found the work contained in one story is not a vertical slice of the > whole functionality. The story contains much other functionalities that > spreads horizontally across different parts, which makes the story not > small, very testable and estimable and describing a very clear business > value. > > The above is just my guess. I'd like to know how the dev team actually drive > out this great tool. I misunderstood your initial question. Forgive me. The first versions of rspec were developed in small steps using test/unit. Eventually we got to a point where we decided it was dog food time. At that point we converted our test/unit tests to rspec examples, and since then any new developments have been driven directly with rspec. Sorry if that's not as exciting as you had imagined. I wonder how things would have been different if we had started with rspec self-hosting from day 1. Cheers, David > > > On 6/22/07, David Chelimsky < dchelimsky at gmail.com> wrote: > > On 6/21/07, Huang Liang < exceedhl at gmail.com> wrote: > > > The spec in the source code package are very good examples and > description > > > for rspec. When I am looking at those spec, I wonder if the rspec are > > > actually driven out by those spec step by step or we just add those spec > > > after the core functionality of rspec has been finished? > > > > What do you think? :) > > > > > > > > _______________________________________________ > > > rspec-devel mailing list > > > rspec-devel at rubyforge.org > > > http://rubyforge.org/mailman/listinfo/rspec-devel > > > > > _______________________________________________ > > rspec-devel mailing list > > rspec-devel at rubyforge.org > > http://rubyforge.org/mailman/listinfo/rspec-devel > > > > > _______________________________________________ > rspec-devel mailing list > rspec-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-devel > From exceedhl at gmail.com Fri Jun 22 02:06:48 2007 From: exceedhl at gmail.com (Huang Liang) Date: Fri, 22 Jun 2007 14:06:48 +0800 Subject: [rspec-devel] Are rspec code actually "driven" out from the spec incrementally? In-Reply-To: <57c63afe0706212017p518d527dj50e5f493d78969f2@mail.gmail.com> References: <57c63afe0706211241o5071ef90pf86a604cf48e7287@mail.gmail.com> <57c63afe0706212017p518d527dj50e5f493d78969f2@mail.gmail.com> Message-ID: It's nice to know that. I think it's very cool that we can actually use rspec to drive rspec now. On 6/22/07, David Chelimsky wrote: > > On 6/21/07, Huang Liang wrote: > > :-) > > > > I did not see that it is impossible. It's exciting for me to know that a > > tool can be actually driven out by itself because I have not done such > kind > > of thing before. Many tools like CruiseControl eat their own dog food, > but > > that happens after the tool has been in a minimal usable state. > > > > What I guess is if I want to use rspec to drive out the rspec, a spec > might > > look like: > > > > describe Something, " ..." do > > it "..." do > > # setup fixture > > # action and verify using should... > > end > > end > > > > but in order to make this pass, actually we have to let rspec support > > several base functionalities like describe, it, should, which might be > too > > much for just finishing one test. And when you are trying to fullfill > this > > spec(which is like a test), you are not focusing on the functionality > > described by the spec, you have to work on some other functionality to > make > > this spec work first and see the test result. > > > > Moreover, if we are using stories to manage the requirements of rspec, > we > > may found the work contained in one story is not a vertical slice of the > > whole functionality. The story contains much other functionalities that > > spreads horizontally across different parts, which makes the story not > > small, very testable and estimable and describing a very clear business > > value. > > > > The above is just my guess. I'd like to know how the dev team actually > drive > > out this great tool. > > I misunderstood your initial question. Forgive me. The first versions > of rspec were developed in small steps using test/unit. Eventually we > got to a point where we decided it was dog food time. At that point we > converted our test/unit tests to rspec examples, and since then any > new developments have been driven directly with rspec. > > Sorry if that's not as exciting as you had imagined. I wonder how > things would have been different if we had started with rspec > self-hosting from day 1. > > Cheers, > David > > > > > > > On 6/22/07, David Chelimsky < dchelimsky at gmail.com> wrote: > > > On 6/21/07, Huang Liang < exceedhl at gmail.com> wrote: > > > > The spec in the source code package are very good examples and > > description > > > > for rspec. When I am looking at those spec, I wonder if the rspec > are > > > > actually driven out by those spec step by step or we just add those > spec > > > > after the core functionality of rspec has been finished? > > > > > > What do you think? :) > > > > > > > > > > > _______________________________________________ > > > > rspec-devel mailing list > > > > rspec-devel at rubyforge.org > > > > http://rubyforge.org/mailman/listinfo/rspec-devel > > > > > > > _______________________________________________ > > > rspec-devel mailing list > > > rspec-devel at rubyforge.org > > > http://rubyforge.org/mailman/listinfo/rspec-devel > > > > > > > > > _______________________________________________ > > rspec-devel mailing list > > rspec-devel at rubyforge.org > > http://rubyforge.org/mailman/listinfo/rspec-devel > > > _______________________________________________ > rspec-devel mailing list > rspec-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-devel > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/rspec-devel/attachments/20070622/40942ebf/attachment.html From dan at tastapod.com Fri Jun 22 08:23:58 2007 From: dan at tastapod.com (Dan North) Date: Fri, 22 Jun 2007 13:23:58 +0100 Subject: [rspec-devel] Are rspec code actually "driven" out from the spec incrementally? In-Reply-To: <57c63afe0706212017p518d527dj50e5f493d78969f2@mail.gmail.com> References: <57c63afe0706211241o5071ef90pf86a604cf48e7287@mail.gmail.com> <57c63afe0706212017p518d527dj50e5f493d78969f2@mail.gmail.com> Message-ID: <467BBF5E.5050400@tastapod.com> David Chelimsky wrote: > Sorry if that's not as exciting as you had imagined. I wonder how > things would have been different if we had started with rspec > self-hosting from day 1. > I can confidently suggest that two things would have happened. Firstly you would have had to get to a minimum bootstrap level of functionality /somehow/, so you'd have used test/unit to get there initially. Secondly, you would have made it self-hosting /far too early/ and then whenever it broke - which would have been frequently - you would have been unable to diagnose the problem because /it wasn't running!/ At least that's what happened to me with jbehave :) Also I met Ward Cunningham at a conference a couple of years ago and he told me the same thing happened to him at Microsoft with a well-known C# testing framework. So it seems there's no easy way round it. With rbehave I took a different approach, which was to use rspec to develop it and use an example application (game of life) to eat my own dogfood. Much happier with that arrangement - rspec was working just fine all the way through! > Cheers, > David > Cheers, Dan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/rspec-devel/attachments/20070622/2fc3f3a6/attachment.html From aslak.hellesoy at gmail.com Fri Jun 22 10:40:29 2007 From: aslak.hellesoy at gmail.com (aslak hellesoy) Date: Fri, 22 Jun 2007 16:40:29 +0200 Subject: [rspec-devel] Fwd: [#11628] error mocking partial page variable only after partial has already been rendered bug In-Reply-To: <57c63afe0706220656g68ceda17g937ddd7ef0eb796e@mail.gmail.com> References: <1d7ddd110706190025y576708ebnd07e98782b128731@mail.gmail.com> <57c63afe0706220656g68ceda17g937ddd7ef0eb796e@mail.gmail.com> Message-ID: <8d961d900706220740i2405c916p8148cd4610cb4950@mail.gmail.com> Forwarding this to the list as it has general interest. ---------- Forwarded message ---------- From: David Chelimsky Date: Jun 22, 2007 3:56 PM Subject: Re: [#11628] error mocking partial page variable only after partial has already been rendered bug To: Brian Takita Cc: aslak hellesoy The problem that we're trying to solve is providing stub values to partials. Doing that using the mocking framework does not work because the templates get compiled. An approach that works is this (directly in the example): render :partial => "people/person", :object => @person Here's where this starts to break down. Let's say that _person.html.erb is calling _address.html.erb with it's person object. In the example, I want to do this: template.should_receive(:render).with(:partial => "address", :person => @person) render :partial => "people/person", :object => @person As you might imagine, this breaks down because rails makes use render as an entry point for everything, so the call to render :partial => "people/person" gets compared to the expectation and fails - nothing ever gets rendered at all because we've set a message expectation on render. So what if we added special high level methods to ActionView::Base rather than trying to intercept the deeper calls. Something like: template.should_receive_render_with(:partial => "address", :person => @person) render :partial => "people/person", :object => @person The should_receive_render_with method would intercept calls to render and compare them to the expectation. If they meet the expectation this gets recorded. If it's the right template with the wrong hash, it fails immediately. Otherwise it passes the call back to the original render method. We can also have it add itself as a listener to the runner, so when the example finishes it can raise an ExpectationNotMetError if it never got the message. The benefit is that you can focus on one template and essentially mock all of it's included partials. The downside is that if a given partial is invoked more than once, you'd have to be able to set that expectation, either with .once, .twice, .exactly(n).times appended to the expectation, or with repeated expectations if you want to be specific about different hash values. Maybe to make it more clear the method should be: template.should_render_partial(:address).with(:object => @person) That separates the partial name, which is essentially our key as to whether or not to pay attention to the message, from the other arguments we need to match against. The downside is that we essentially have to re-implement a lot of what mocks already do - or extract some of that stuff out to another library - in order to provide a "pass through" feature, which a few people have asked for and I'm loathe to add to the mocking framework. Thoughts? David On 6/19/07, Brian Takita wrote: > Hello, > > I looked into this a little. > > It looks like in the success case, the compiled template source is evaled: > CompiledTemplates.module_eval(render_source, file_name, -line_offset) > in line 518. > > Since person is stubbed in the template object, the eval can't find > the local variable and falls back to the person method. > > On the failure case, @@template_args[render_symbol] is set in the first spec. > This causes > person_counter = local_assigns[:person_counter]\nperson = local_assigns[:person] > to be compiled, which sets person to nil. > > There are a couple of solutions: > Option 1: > ActionView::Base#compile_template? must return true for every render > (line 317 in base.rb) to recompile the template method. > @@template_args[render_symbol] must be cleared before the template is compiled > > Option 2: > ActionView::Base#render_template must get the locals_assigns hash somehow. > > Both seem pretty hairy. > > Brian > From dchelimsky at gmail.com Fri Jun 22 10:43:32 2007 From: dchelimsky at gmail.com (David Chelimsky) Date: Fri, 22 Jun 2007 09:43:32 -0500 Subject: [rspec-devel] Fwd: [#11628] error mocking partial page variable only after partial has already been rendered bug In-Reply-To: <8d961d900706220740i2405c916p8148cd4610cb4950@mail.gmail.com> References: <1d7ddd110706190025y576708ebnd07e98782b128731@mail.gmail.com> <57c63afe0706220656g68ceda17g937ddd7ef0eb796e@mail.gmail.com> <8d961d900706220740i2405c916p8148cd4610cb4950@mail.gmail.com> Message-ID: <57c63afe0706220743p5118241o5f884c04727f4068@mail.gmail.com> On 6/22/07, aslak hellesoy wrote: > Forwarding this to the list as it has general interest. The RFE this refers to is: http://rubyforge.org/tracker/index.php?func=detail&aid=11628&group_id=797&atid=3149 > > ---------- Forwarded message ---------- > From: David Chelimsky > Date: Jun 22, 2007 3:56 PM > Subject: Re: [#11628] error mocking partial page variable only after > partial has already been rendered bug > To: Brian Takita > Cc: aslak hellesoy > > > The problem that we're trying to solve is providing stub values to > partials. Doing that using the mocking framework does not work because > the templates get compiled. > > An approach that works is this (directly in the example): > > render :partial => "people/person", :object => @person > > Here's where this starts to break down. Let's say that > _person.html.erb is calling _address.html.erb with it's person object. > In the example, I want to do this: > > template.should_receive(:render).with(:partial => "address", :person => @person) > render :partial => "people/person", :object => @person > > As you might imagine, this breaks down because rails makes use render > as an entry point for everything, so the call to render :partial => > "people/person" gets compared to the expectation and fails - nothing > ever gets rendered at all because we've set a message expectation on > render. > > So what if we added special high level methods to ActionView::Base > rather than trying to intercept the deeper calls. Something like: > > template.should_receive_render_with(:partial => "address", :person => @person) > render :partial => "people/person", :object => @person > > The should_receive_render_with method would intercept calls to render > and compare them to the expectation. If they meet the expectation this > gets recorded. If it's the right template with the wrong hash, it > fails immediately. Otherwise it passes the call back to the original > render method. We can also have it add itself as a listener to the > runner, so when the example finishes it can raise an > ExpectationNotMetError if it never got the message. > > The benefit is that you can focus on one template and essentially mock > all of it's included partials. The downside is that if a given partial > is invoked more than once, you'd have to be able to set that > expectation, either with .once, .twice, .exactly(n).times appended to > the expectation, or with repeated expectations if you want to be > specific about different hash values. > > Maybe to make it more clear the method should be: > > template.should_render_partial(:address).with(:object => @person) > > That separates the partial name, which is essentially our key as to > whether or not to pay attention to the message, from the other > arguments we need to match against. > > The downside is that we essentially have to re-implement a lot of what > mocks already do - or extract some of that stuff out to another > library - in order to provide a "pass through" feature, which a few > people have asked for and I'm loathe to add to the mocking framework. > > Thoughts? > > David > > > > On 6/19/07, Brian Takita wrote: > > Hello, > > > > I looked into this a little. > > > > It looks like in the success case, the compiled template source is evaled: > > CompiledTemplates.module_eval(render_source, file_name, -line_offset) > > in line 518. > > > > Since person is stubbed in the template object, the eval can't find > > the local variable and falls back to the person method. > > > > On the failure case, @@template_args[render_symbol] is set in the first spec. > > This causes > > person_counter = local_assigns[:person_counter]\nperson = local_assigns[:person] > > to be compiled, which sets person to nil. > > > > There are a couple of solutions: > > Option 1: > > ActionView::Base#compile_template? must return true for every render > > (line 317 in base.rb) to recompile the template method. > > @@template_args[render_symbol] must be cleared before the template is compiled > > > > Option 2: > > ActionView::Base#render_template must get the locals_assigns hash somehow. > > > > Both seem pretty hairy. > > > > Brian > > > _______________________________________________ > rspec-devel mailing list > rspec-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-devel > From noreply at rubyforge.org Fri Jun 22 11:48:09 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Fri, 22 Jun 2007 11:48:09 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11774 ] Mocks should respond to :kind_of? in the same way they respond to :is_a? Message-ID: <20070622154809.F0F815240A65@rubyforge.org> Bugs item #11774, was opened at 2007-06-22 15:48 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11774&group_id=797 Category: mock module Group: None Status: Open Resolution: None Priority: 3 Submitted By: Ben Tucker (btucker) Assigned to: Nobody (None) Summary: Mocks should respond to :kind_of? in the same way they respond to :is_a? Initial Comment: Mocks currently respond to :is_a? by matching the class the mock object is mocking. :kind_of? should behave the same. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11774&group_id=797 From noreply at rubyforge.org Fri Jun 22 12:19:09 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Fri, 22 Jun 2007 12:19:09 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11774 ] Mocks should respond to :kind_of? in the same way they respond to :is_a? Message-ID: <20070622161909.F0ACA5240AB4@rubyforge.org> Bugs item #11774, was opened at 2007-06-22 15:48 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11774&group_id=797 Category: mock module Group: None Status: Open Resolution: None Priority: 3 Submitted By: Ben Tucker (btucker) Assigned to: Nobody (None) Summary: Mocks should respond to :kind_of? in the same way they respond to :is_a? Initial Comment: Mocks currently respond to :is_a? by matching the class the mock object is mocking. :kind_of? should behave the same. ---------------------------------------------------------------------- >Comment By: David Chelimsky (dchelimsky) Date: 2007-06-22 16:19 Message: Core mocks don't do this at all. Are you referring to mock_model in Spec::Rails? ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11774&group_id=797 From noreply at rubyforge.org Fri Jun 22 12:30:38 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Fri, 22 Jun 2007 12:30:38 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11774 ] Mocks should respond to :kind_of? in the same way they respond to :is_a? Message-ID: <20070622163039.1CF905240AF1@rubyforge.org> Bugs item #11774, was opened at 2007-06-22 15:48 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11774&group_id=797 Category: mock module Group: None Status: Open Resolution: None Priority: 3 Submitted By: Ben Tucker (btucker) Assigned to: Nobody (None) Summary: Mocks should respond to :kind_of? in the same way they respond to :is_a? Initial Comment: Mocks currently respond to :is_a? by matching the class the mock object is mocking. :kind_of? should behave the same. ---------------------------------------------------------------------- >Comment By: Ben Tucker (btucker) Date: 2007-06-22 16:30 Message: Yes, sorry, I miscategorized this. I am referring to mock_model in Spec::Rails. ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-06-22 16:19 Message: Core mocks don't do this at all. Are you referring to mock_model in Spec::Rails? ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11774&group_id=797 From noreply at rubyforge.org Fri Jun 22 12:34:31 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Fri, 22 Jun 2007 12:34:31 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11774 ] Mocks should respond to :kind_of? in the same way they respond to :is_a? Message-ID: <20070622163431.94B335240ACB@rubyforge.org> Bugs item #11774, was opened at 2007-06-22 15:48 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11774&group_id=797 Category: mock module Group: None Status: Open Resolution: None Priority: 3 Submitted By: Ben Tucker (btucker) Assigned to: Nobody (None) Summary: Mocks should respond to :kind_of? in the same way they respond to :is_a? Initial Comment: Mocks currently respond to :is_a? by matching the class the mock object is mocking. :kind_of? should behave the same. ---------------------------------------------------------------------- Comment By: Ben Tucker (btucker) Date: 2007-06-22 16:30 Message: Yes, sorry, I miscategorized this. I am referring to mock_model in Spec::Rails. ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-06-22 16:19 Message: Core mocks don't do this at all. Are you referring to mock_model in Spec::Rails? ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11774&group_id=797 From noreply at rubyforge.org Fri Jun 22 13:26:23 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Fri, 22 Jun 2007 13:26:23 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-7754 ] Command-R fails to run spec in TextMate Message-ID: <20070622172623.ED7F75240AB6@rubyforge.org> Bugs item #7754, was opened at 2007-01-11 08:19 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=7754&group_id=797 Category: RSpec.tmbundle Group: None Status: Closed Resolution: Accepted Priority: 3 Submitted By: Brian Yamabe (byamabe) Assigned to: Aslak Helles?y (aslak_hellesoy) Summary: Command-R fails to run spec in TextMate Initial Comment: When trying to run a spec from TextMate using command-r, I get: /Library/Application Support/TextMate/Bundles/RSpec.tmbundle/Support/lib/spec_mate.rb:1:in `require': No such file to load -- rubygems (LoadError) from /Library/Application Support/TextMate/Bundles/RSpec.tmbundle/Support/lib/spec_mate.rb:1 from /tmp/temp_textmate.EMYXc6:3:in `require' from /tmp/temp_textmate.EMYXc6:3 TM_RUBY is set properly (/opt/local/bin/ruby) Tried the following at Aslak suggestion and it ran without errors. 1) Create a file called foo.rb 2) Add one line to it: require 'rubygems' 3) Open it in TextMate 4) Run it from TextMate (Cmd-R - Run) ---------------------------------------------------------------------- Comment By: Nathan Youngman (nathany) Date: 2007-06-22 11:26 Message: after editing Environment.plist "you'll need to log out and log back in again for this to take effect." please note this in the documentation as well. thanks. ---------------------------------------------------------------------- Comment By: Brian Yamabe (byamabe) Date: 2007-01-19 14:10 Message: Running 'spec ' or 'rake spec' executes the test properly. In the terminal window running 'script/server' I do have this: Spec::Rails::HelperEvalContextController: missing default helper path spec/rails/ helper_eval_context_helper Spec::Rails::ViewSpecController: missing default helper path spec/rails/ view_spec_helper ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-01-19 07:57 Message: What do you get when you run the specs from the command line? ---------------------------------------------------------------------- Comment By: Brian Yamabe (byamabe) Date: 2007-01-19 07:42 Message: This helped, but now I get: /opt/local/lib/ruby/gems/1.8/gems/rspec-0.7.5/lib/spec/expectations/ sugar.rb:13:in `call': undefined method `controller_name' for # (NoMethodError) from /opt/local/lib/ruby/gems/1.8/gems/rspec-0.7.5/lib/ spec/expectations/sugar.rb:13:in `_method_missing' from /opt/local/lib/ ruby/gems/1.8/gems/rspec-0.7.5/lib/spec/expectations/sugar.rb:9:in `method_missing' from /opt/local/lib/ruby/gems/1.8/gems/rspec-0.7.5/ lib/spec/runner/context_eval.rb:46:in `method_missing' from ./ home_controller_spec.rb:5 from /opt/local/lib/ruby/gems/1.8/gems/ rspec-0.7.5/lib/spec/runner/context.rb:14:in `class_eval' from /opt/local/ lib/ruby/gems/1.8/gems/rspec-0.7.5/lib/spec/runner/context.rb:14:in `initialize' from /Users/byamabe/joyfulgames/work/trivia/config/../vendor/ plugins/rspec_on_rails/lib/spec/rails/context_factory.rb:18:in `new' from / Users/byamabe/joyfulgames/work/trivia/config/../vendor/plugins/ rspec_on_rails/lib/spec/rails/context_factory.rb:18:in `create' from /Users/ byamabe/joyfulgames/work/trivia/vendor/plugins/rspec_on_rails/lib/spec/ rails/extensions/kernel.rb:4:in `context' from ./home_controller_spec.rb:4 from /opt/local/lib/ruby/gems/1.8/gems/rspec-0.7.5/lib/spec/runner/ command_line.rb:21:in `load' from /opt/local/lib/ruby/gems/1.8/gems/ rspec-0.7.5/lib/spec/runner/command_line.rb:21:in `run' from /opt/local/ lib/ruby/gems/1.8/gems/rspec-0.7.5/lib/spec/runner/command_line.rb: 15:in `each' from /opt/local/lib/ruby/gems/1.8/gems/rspec-0.7.5/lib/spec/ runner/command_line.rb:15:in `run' from /Library/Application Support/ TextMate/Bundles/RSpec.tmbundle/Support/lib/spec_mate.rb:31:in `run' from /Library/Application Support/TextMate/Bundles/RSpec.tmbundle/ Support/lib/spec_mate.rb:9:in `run_file' from /tmp/temp_textmate.6oaSVX:4 ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-01-19 02:44 Message: Instructions added to docs in r1401 ---------------------------------------------------------------------- Comment By: Luke Redpath (lukeredpath) Date: 2007-01-11 08:29 Message: I had this problem too - the reason is that files with a shebang line (like the RSpec command in textmate) do not run the Textmate init script that picks up the system path it needs to find rubygems. To fix this problem, you also need to add the path to your ~/.MacOSX/ environment.plist file - here is mine: PATH /usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:/Users/luke/ bin:/opt/local/bin:/usr/local/mysql/bin Modify as necessary - you'll need to log out and log back in again for this to take effect. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=7754&group_id=797 From noreply at rubyforge.org Fri Jun 22 13:29:06 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Fri, 22 Jun 2007 13:29:06 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-7754 ] Command-R fails to run spec in TextMate Message-ID: <20070622172906.D4F335240B33@rubyforge.org> Bugs item #7754, was opened at 2007-01-11 08:19 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=7754&group_id=797 Category: RSpec.tmbundle Group: None Status: Closed Resolution: Accepted Priority: 3 Submitted By: Brian Yamabe (byamabe) Assigned to: Aslak Helles?y (aslak_hellesoy) Summary: Command-R fails to run spec in TextMate Initial Comment: When trying to run a spec from TextMate using command-r, I get: /Library/Application Support/TextMate/Bundles/RSpec.tmbundle/Support/lib/spec_mate.rb:1:in `require': No such file to load -- rubygems (LoadError) from /Library/Application Support/TextMate/Bundles/RSpec.tmbundle/Support/lib/spec_mate.rb:1 from /tmp/temp_textmate.EMYXc6:3:in `require' from /tmp/temp_textmate.EMYXc6:3 TM_RUBY is set properly (/opt/local/bin/ruby) Tried the following at Aslak suggestion and it ran without errors. 1) Create a file called foo.rb 2) Add one line to it: require 'rubygems' 3) Open it in TextMate 4) Run it from TextMate (Cmd-R - Run) ---------------------------------------------------------------------- Comment By: Nathan Youngman (nathany) Date: 2007-06-22 11:29 Message: also note, the documentation repeats "/usr/local/mysql/bin" twice. ---------------------------------------------------------------------- Comment By: Nathan Youngman (nathany) Date: 2007-06-22 11:26 Message: after editing Environment.plist "you'll need to log out and log back in again for this to take effect." please note this in the documentation as well. thanks. ---------------------------------------------------------------------- Comment By: Brian Yamabe (byamabe) Date: 2007-01-19 14:10 Message: Running 'spec ' or 'rake spec' executes the test properly. In the terminal window running 'script/server' I do have this: Spec::Rails::HelperEvalContextController: missing default helper path spec/rails/ helper_eval_context_helper Spec::Rails::ViewSpecController: missing default helper path spec/rails/ view_spec_helper ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-01-19 07:57 Message: What do you get when you run the specs from the command line? ---------------------------------------------------------------------- Comment By: Brian Yamabe (byamabe) Date: 2007-01-19 07:42 Message: This helped, but now I get: /opt/local/lib/ruby/gems/1.8/gems/rspec-0.7.5/lib/spec/expectations/ sugar.rb:13:in `call': undefined method `controller_name' for # (NoMethodError) from /opt/local/lib/ruby/gems/1.8/gems/rspec-0.7.5/lib/ spec/expectations/sugar.rb:13:in `_method_missing' from /opt/local/lib/ ruby/gems/1.8/gems/rspec-0.7.5/lib/spec/expectations/sugar.rb:9:in `method_missing' from /opt/local/lib/ruby/gems/1.8/gems/rspec-0.7.5/ lib/spec/runner/context_eval.rb:46:in `method_missing' from ./ home_controller_spec.rb:5 from /opt/local/lib/ruby/gems/1.8/gems/ rspec-0.7.5/lib/spec/runner/context.rb:14:in `class_eval' from /opt/local/ lib/ruby/gems/1.8/gems/rspec-0.7.5/lib/spec/runner/context.rb:14:in `initialize' from /Users/byamabe/joyfulgames/work/trivia/config/../vendor/ plugins/rspec_on_rails/lib/spec/rails/context_factory.rb:18:in `new' from / Users/byamabe/joyfulgames/work/trivia/config/../vendor/plugins/ rspec_on_rails/lib/spec/rails/context_factory.rb:18:in `create' from /Users/ byamabe/joyfulgames/work/trivia/vendor/plugins/rspec_on_rails/lib/spec/ rails/extensions/kernel.rb:4:in `context' from ./home_controller_spec.rb:4 from /opt/local/lib/ruby/gems/1.8/gems/rspec-0.7.5/lib/spec/runner/ command_line.rb:21:in `load' from /opt/local/lib/ruby/gems/1.8/gems/ rspec-0.7.5/lib/spec/runner/command_line.rb:21:in `run' from /opt/local/ lib/ruby/gems/1.8/gems/rspec-0.7.5/lib/spec/runner/command_line.rb: 15:in `each' from /opt/local/lib/ruby/gems/1.8/gems/rspec-0.7.5/lib/spec/ runner/command_line.rb:15:in `run' from /Library/Application Support/ TextMate/Bundles/RSpec.tmbundle/Support/lib/spec_mate.rb:31:in `run' from /Library/Application Support/TextMate/Bundles/RSpec.tmbundle/ Support/lib/spec_mate.rb:9:in `run_file' from /tmp/temp_textmate.6oaSVX:4 ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-01-19 02:44 Message: Instructions added to docs in r1401 ---------------------------------------------------------------------- Comment By: Luke Redpath (lukeredpath) Date: 2007-01-11 08:29 Message: I had this problem too - the reason is that files with a shebang line (like the RSpec command in textmate) do not run the Textmate init script that picks up the system path it needs to find rubygems. To fix this problem, you also need to add the path to your ~/.MacOSX/ environment.plist file - here is mine: PATH /usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:/Users/luke/ bin:/opt/local/bin:/usr/local/mysql/bin Modify as necessary - you'll need to log out and log back in again for this to take effect. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=7754&group_id=797 From noreply at rubyforge.org Fri Jun 22 14:07:18 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Fri, 22 Jun 2007 14:07:18 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11777 ] should render_template doesn't check paths correctly Message-ID: <20070622180718.AE8075240ACB@rubyforge.org> Bugs item #11777, was opened at 2007-06-22 11:07 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11777&group_id=797 Category: rails plugin Group: None Status: Open Resolution: None Priority: 3 Submitted By: Chad Woolley (thewoolleyman) Assigned to: Nobody (None) Summary: should render_template doesn't check paths correctly Initial Comment: For example, if you render 'something/new', should render_template will not fail even if given 'new'. Also, if you render 'badpath/new', it will also not fail. This was in a RESTful app, if that makes a difference. Thx, --Chad ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11777&group_id=797 From noreply at rubyforge.org Fri Jun 22 14:08:43 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Fri, 22 Jun 2007 14:08:43 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11777 ] should render_template doesn't check paths correctly Message-ID: <20070622180843.ACA745240991@rubyforge.org> Bugs item #11777, was opened at 2007-06-22 11:07 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11777&group_id=797 Category: rails plugin Group: None Status: Open Resolution: None Priority: 3 Submitted By: Chad Woolley (thewoolleyman) Assigned to: Nobody (None) Summary: should render_template doesn't check paths correctly Initial Comment: For example, if you render 'something/new', should render_template will not fail even if given 'new'. Also, if you render 'badpath/new', it will also not fail. This was in a RESTful app, if that makes a difference. Thx, --Chad ---------------------------------------------------------------------- >Comment By: Chad Woolley (thewoolleyman) Date: 2007-06-22 11:08 Message: FYI, this was in 1.0.0. We'll upgrade and let you know if it went away... ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11777&group_id=797 From noreply at rubyforge.org Fri Jun 22 17:43:50 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Fri, 22 Jun 2007 17:43:50 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11774 ] Mocks should respond to :kind_of? in the same way they respond to :is_a? Message-ID: <20070622214350.9B5025240B37@rubyforge.org> Bugs item #11774, was opened at 2007-06-22 15:48 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11774&group_id=797 Category: mock module Group: None Status: Open Resolution: None Priority: 3 Submitted By: Ben Tucker (btucker) Assigned to: Nobody (None) Summary: Mocks should respond to :kind_of? in the same way they respond to :is_a? Initial Comment: Mocks currently respond to :is_a? by matching the class the mock object is mocking. :kind_of? should behave the same. ---------------------------------------------------------------------- >Comment By: David Chelimsky (dchelimsky) Date: 2007-06-22 21:43 Message: Fixed in r2105 Added support for instance_of? too. ---------------------------------------------------------------------- Comment By: Ben Tucker (btucker) Date: 2007-06-22 16:30 Message: Yes, sorry, I miscategorized this. I am referring to mock_model in Spec::Rails. ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-06-22 16:19 Message: Core mocks don't do this at all. Are you referring to mock_model in Spec::Rails? ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11774&group_id=797 From noreply at rubyforge.org Fri Jun 22 17:44:05 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Fri, 22 Jun 2007 17:44:05 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11774 ] Mocks should respond to :kind_of? in the same way they respond to :is_a? Message-ID: <20070622214405.C95775240C19@rubyforge.org> Bugs item #11774, was opened at 2007-06-22 15:48 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11774&group_id=797 >Category: rails plugin Group: None >Status: Closed >Resolution: Accepted Priority: 3 Submitted By: Ben Tucker (btucker) >Assigned to: David Chelimsky (dchelimsky) Summary: Mocks should respond to :kind_of? in the same way they respond to :is_a? Initial Comment: Mocks currently respond to :is_a? by matching the class the mock object is mocking. :kind_of? should behave the same. ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-06-22 21:43 Message: Fixed in r2105 Added support for instance_of? too. ---------------------------------------------------------------------- Comment By: Ben Tucker (btucker) Date: 2007-06-22 16:30 Message: Yes, sorry, I miscategorized this. I am referring to mock_model in Spec::Rails. ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-06-22 16:19 Message: Core mocks don't do this at all. Are you referring to mock_model in Spec::Rails? ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11774&group_id=797 From noreply at rubyforge.org Fri Jun 22 17:57:14 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Fri, 22 Jun 2007 17:57:14 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11774 ] Mocks should respond to :kind_of? in the same way they respond to :is_a? Message-ID: <20070622215714.28EE15240AB6@rubyforge.org> Bugs item #11774, was opened at 2007-06-22 15:48 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11774&group_id=797 Category: rails plugin Group: None Status: Closed Resolution: Accepted Priority: 3 Submitted By: Ben Tucker (btucker) Assigned to: David Chelimsky (dchelimsky) Summary: Mocks should respond to :kind_of? in the same way they respond to :is_a? Initial Comment: Mocks currently respond to :is_a? by matching the class the mock object is mocking. :kind_of? should behave the same. ---------------------------------------------------------------------- >Comment By: Ben Tucker (btucker) Date: 2007-06-22 21:57 Message: r2105 brings up a somewhat related other issue >From the ruby docs: > obj.is_a?(class) => true or false > obj.kind_of?(class) => true or false > Returns true if class is the class of obj, or if class is > one of the superclasses of obj or modules included in obj. So the #kind_of? implementation is now correct, but #is_a? should work like it, not instance_of? ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-06-22 21:43 Message: Fixed in r2105 Added support for instance_of? too. ---------------------------------------------------------------------- Comment By: Ben Tucker (btucker) Date: 2007-06-22 16:30 Message: Yes, sorry, I miscategorized this. I am referring to mock_model in Spec::Rails. ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-06-22 16:19 Message: Core mocks don't do this at all. Are you referring to mock_model in Spec::Rails? ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11774&group_id=797 From noreply at rubyforge.org Fri Jun 22 18:09:17 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Fri, 22 Jun 2007 18:09:17 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11774 ] Mocks should respond to :kind_of? in the same way they respond to :is_a? Message-ID: <20070622220917.7CA375240AB6@rubyforge.org> Bugs item #11774, was opened at 2007-06-22 15:48 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11774&group_id=797 Category: rails plugin Group: None >Status: Open Resolution: Accepted Priority: 3 Submitted By: Ben Tucker (btucker) Assigned to: David Chelimsky (dchelimsky) Summary: Mocks should respond to :kind_of? in the same way they respond to :is_a? Initial Comment: Mocks currently respond to :is_a? by matching the class the mock object is mocking. :kind_of? should behave the same. ---------------------------------------------------------------------- Comment By: Ben Tucker (btucker) Date: 2007-06-22 21:57 Message: r2105 brings up a somewhat related other issue >From the ruby docs: > obj.is_a?(class) => true or false > obj.kind_of?(class) => true or false > Returns true if class is the class of obj, or if class is > one of the superclasses of obj or modules included in obj. So the #kind_of? implementation is now correct, but #is_a? should work like it, not instance_of? ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-06-22 21:43 Message: Fixed in r2105 Added support for instance_of? too. ---------------------------------------------------------------------- Comment By: Ben Tucker (btucker) Date: 2007-06-22 16:30 Message: Yes, sorry, I miscategorized this. I am referring to mock_model in Spec::Rails. ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-06-22 16:19 Message: Core mocks don't do this at all. Are you referring to mock_model in Spec::Rails? ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11774&group_id=797 From noreply at rubyforge.org Fri Jun 22 18:47:52 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Fri, 22 Jun 2007 18:47:52 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11774 ] Mocks should respond to :kind_of? in the same way they respond to :is_a? Message-ID: <20070622224752.A76E25240C15@rubyforge.org> Bugs item #11774, was opened at 2007-06-22 15:48 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11774&group_id=797 Category: rails plugin Group: None >Status: Closed Resolution: Accepted Priority: 3 Submitted By: Ben Tucker (btucker) Assigned to: David Chelimsky (dchelimsky) Summary: Mocks should respond to :kind_of? in the same way they respond to :is_a? Initial Comment: Mocks currently respond to :is_a? by matching the class the mock object is mocking. :kind_of? should behave the same. ---------------------------------------------------------------------- >Comment By: David Chelimsky (dchelimsky) Date: 2007-06-22 22:47 Message: D'oh! Fixed in r2106 ---------------------------------------------------------------------- Comment By: Ben Tucker (btucker) Date: 2007-06-22 21:57 Message: r2105 brings up a somewhat related other issue >From the ruby docs: > obj.is_a?(class) => true or false > obj.kind_of?(class) => true or false > Returns true if class is the class of obj, or if class is > one of the superclasses of obj or modules included in obj. So the #kind_of? implementation is now correct, but #is_a? should work like it, not instance_of? ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-06-22 21:43 Message: Fixed in r2105 Added support for instance_of? too. ---------------------------------------------------------------------- Comment By: Ben Tucker (btucker) Date: 2007-06-22 16:30 Message: Yes, sorry, I miscategorized this. I am referring to mock_model in Spec::Rails. ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-06-22 16:19 Message: Core mocks don't do this at all. Are you referring to mock_model in Spec::Rails? ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11774&group_id=797 From noreply at rubyforge.org Fri Jun 22 19:14:34 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Fri, 22 Jun 2007 19:14:34 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11749 ] Use of 'rescue => e' does not catch all exceptions Message-ID: <20070622231434.5143C5240C17@rubyforge.org> Bugs item #11749, was opened at 2007-06-21 18:50 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11749&group_id=797 Category: None Group: None Status: Open Resolution: None Priority: 3 Submitted By: Bob Cotton (bcotton) Assigned to: Nobody (None) Summary: Use of 'rescue => e' does not catch all exceptions Initial Comment: There are several uses of 'rescue => e' in Behaviour and Example. According my PixAxe book rescue without an exception type will only catch RuntimeException. This seems wrong. I've got Timeout::Error (an Interrupt) escaping and killing my entire spec run. very frustrating. ---------------------------------------------------------------------- >Comment By: David Chelimsky (dchelimsky) Date: 2007-06-22 23:14 Message: Well MY PickAxe book says it catches StandardError or anything derived from it. Regardless, we have a problem in that anything not derived from StandardError will go uncaught. Will address soon. Will address sooner if you or somebody else submits failing examples. Cheers, David ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11749&group_id=797 From noreply at rubyforge.org Sat Jun 23 06:11:18 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Sat, 23 Jun 2007 06:11:18 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11793 ] should raise_error('with a message') does not work correctly Message-ID: <20070623101118.641A652409FB@rubyforge.org> Bugs item #11793, was opened at 2007-06-23 10:11 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11793&group_id=797 Category: expectation module Group: None Status: Open Resolution: None Priority: 3 Submitted By: David Chelimsky (dchelimsky) Assigned to: David Chelimsky (dchelimsky) Summary: should raise_error('with a message') does not work correctly Initial Comment: The following example passes: describe "should raise_error(message)" do it "should pass if RuntimeError is raised with the right message" do lambda {raise 'blah'}.should raise_error(RuntimeError, 'blah') end end However, this one fails: describe "should raise_error(message)" do it "should pass if RuntimeError is raised with the right message" do lambda {raise 'blah'}.should raise_error('blah') end end They should both pass. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11793&group_id=797 From noreply at rubyforge.org Sat Jun 23 06:12:20 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Sat, 23 Jun 2007 06:12:20 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11793 ] should raise_error('with a message') does not work correctly Message-ID: <20070623101220.34F645240A5B@rubyforge.org> Bugs item #11793, was opened at 2007-06-23 10:11 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11793&group_id=797 Category: expectation module Group: None >Status: Closed >Resolution: Accepted Priority: 3 Submitted By: David Chelimsky (dchelimsky) Assigned to: David Chelimsky (dchelimsky) Summary: should raise_error('with a message') does not work correctly Initial Comment: The following example passes: describe "should raise_error(message)" do it "should pass if RuntimeError is raised with the right message" do lambda {raise 'blah'}.should raise_error(RuntimeError, 'blah') end end However, this one fails: describe "should raise_error(message)" do it "should pass if RuntimeError is raised with the right message" do lambda {raise 'blah'}.should raise_error('blah') end end They should both pass. ---------------------------------------------------------------------- >Comment By: David Chelimsky (dchelimsky) Date: 2007-06-23 10:12 Message: Fixed in r2107. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11793&group_id=797 From noreply at rubyforge.org Sat Jun 23 06:39:00 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Sat, 23 Jun 2007 06:39:00 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11749 ] Use of 'rescue => e' does not catch all exceptions Message-ID: <20070623103901.0AF055240A62@rubyforge.org> Bugs item #11749, was opened at 2007-06-21 18:50 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11749&group_id=797 >Category: runner module Group: None >Status: Closed >Resolution: Accepted Priority: 3 Submitted By: Bob Cotton (bcotton) >Assigned to: David Chelimsky (dchelimsky) Summary: Use of 'rescue => e' does not catch all exceptions Initial Comment: There are several uses of 'rescue => e' in Behaviour and Example. According my PixAxe book rescue without an exception type will only catch RuntimeException. This seems wrong. I've got Timeout::Error (an Interrupt) escaping and killing my entire spec run. very frustrating. ---------------------------------------------------------------------- >Comment By: David Chelimsky (dchelimsky) Date: 2007-06-23 10:39 Message: Fixed in r2108 ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-06-22 23:14 Message: Well MY PickAxe book says it catches StandardError or anything derived from it. Regardless, we have a problem in that anything not derived from StandardError will go uncaught. Will address soon. Will address sooner if you or somebody else submits failing examples. Cheers, David ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11749&group_id=797 From noreply at rubyforge.org Sat Jun 23 07:33:25 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Sat, 23 Jun 2007 07:33:25 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11777 ] should render_template doesn't check paths correctly Message-ID: <20070623113325.E942E5240A62@rubyforge.org> Bugs item #11777, was opened at 2007-06-22 18:07 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11777&group_id=797 Category: rails plugin Group: None >Status: Closed >Resolution: Accepted Priority: 3 Submitted By: Chad Woolley (thewoolleyman) >Assigned to: David Chelimsky (dchelimsky) Summary: should render_template doesn't check paths correctly Initial Comment: For example, if you render 'something/new', should render_template will not fail even if given 'new'. Also, if you render 'badpath/new', it will also not fail. This was in a RESTful app, if that makes a difference. Thx, --Chad ---------------------------------------------------------------------- >Comment By: David Chelimsky (dchelimsky) Date: 2007-06-23 11:33 Message: Fixed in r2109. I fixed the problem with 'badpath/new', but the other issue you raise, that it does not fail when you say 'new', is as intended as long as the path matches the controller you are describing. For example, if you say: describe ThingController it "should ..." get 'new' response.should render_template('new') end and and what's being rendered is 'thing/new', then it should pass. Whereas if what's being rendered is 'other/new' then it should fail. ---------------------------------------------------------------------- Comment By: Chad Woolley (thewoolleyman) Date: 2007-06-22 18:08 Message: FYI, this was in 1.0.0. We'll upgrade and let you know if it went away... ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11777&group_id=797 From noreply at rubyforge.org Sat Jun 23 07:45:06 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Sat, 23 Jun 2007 07:45:06 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11508 ] Exceptions are not raised for Controller Specs Message-ID: <20070623114506.E55A65240A88@rubyforge.org> Bugs item #11508, was opened at 2007-06-11 20:06 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11508&group_id=797 Category: rails plugin Group: None >Status: Closed >Resolution: Accepted Priority: 3 Submitted By: Brian Takita (btakita) >Assigned to: Brian Takita (btakita) Summary: Exceptions are not raised for Controller Specs Initial Comment: The issue is old_rescue_action is called if the exception is not a MockExpectationError. This makes it hard to find exceptions in controllers. The standard Rails test behaviour is to always raise an exception. It used to work in 0.9.4. module ActionController module Rescue protected alias old_rescue_action rescue_action def rescue_action(exception) raise exception if exception.is_a?(Spec::Mocks::MockExpectationError) old_rescue_action(exception) end end end ---------------------------------------------------------------------- >Comment By: David Chelimsky (dchelimsky) Date: 2007-06-23 11:45 Message: I removed the experimental code in r2110. ---------------------------------------------------------------------- Comment By: Brian Takita (btakita) Date: 2007-06-21 16:39 Message: Fix checked in Rev 2103. I still need to remove the experimental code. ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-06-20 16:54 Message: Please do. No objection. In fact, let's plan a 1.0.6 release after you get this done and we fix http://rubyforge.org/tracker/index.php?func=detail&aid=11628&group_id=797&atid=3149. Whatever the solution is, lets be noisy about it when we do the release. This thing has been happening under the radar and that's probably more frustrating than anything for people. Thanks Brian. David ---------------------------------------------------------------------- Comment By: Brian Takita (btakita) Date: 2007-06-20 16:48 Message: Unless you guys object, I'm going to fix this issue within the next few days. There have been some complaints, and considerable time spent debugging because of this issue. ---------------------------------------------------------------------- Comment By: Brian Takita (btakita) Date: 2007-06-19 19:03 Message: Maybe have the inverse of raise_controller_errors to deviate from the default (e.g. raise_only_mock_controller_errors)? ---------------------------------------------------------------------- Comment By: Brian Takita (btakita) Date: 2007-06-19 18:58 Message: Can we raise errors by default? This is what most people expect. ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-06-11 20:17 Message: If you run script/generate rspec you'll see the following in spec_helper.rb: config.before(:each, :behaviour_type => :controller) do raise_controller_errors end That makes things work as you suspect, and allows you use your own rescue_action if you want to. This is a bit experimental and hence not very well doc'd, so I'll leave this open. But you can use that for now. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11508&group_id=797 From dchelimsky at gmail.com Sat Jun 23 12:01:38 2007 From: dchelimsky at gmail.com (David Chelimsky) Date: Sat, 23 Jun 2007 11:01:38 -0500 Subject: [rspec-devel] new pending feature (pending release) Message-ID: <57c63afe0706230901x72f06fcck5b3cd64f43f85912@mail.gmail.com> I just added a new "pending" feature. It's in trunk (rev 2118+) and will be part of the 1.0.6 release (*probably* within the next week). Read all about it: http://blog.davidchelimsky.net/articles/2007/06/23/pending-insert-reason-here Cheers, David From dchelimsky at gmail.com Sat Jun 23 16:50:35 2007 From: dchelimsky at gmail.com (David Chelimsky) Date: Sat, 23 Jun 2007 15:50:35 -0500 Subject: [rspec-devel] integration testing/rspec/rbehave Message-ID: <57c63afe0706231350y211ddb14r5c6710f5012d31cd@mail.gmail.com> Hi all, Dan North has released rbehave: http://dannorth.net/2007/06/introducing-rbehave, http://rubyforge.org/projects/rbehave/. He used rspec to describe it, and it actually uses rspec's expectation library to express the details. The idea is that while rspec excels at expressing object behaviour, rbehave is targeted at story level behaviour. By using rspec expectations for both there's very little context shifting for developers who use both tools on the same project. The only real difference is in how object-specific examples are structured in rspec vs stories and scenarios in rbehave. With that context, there is one big thing missing from our BDD/Rails toolset, and that is pure ruby rails integration testing. I'd like to propose that we focus on getting that support into rbehave. If any of you are interested in contributing to this effort, please join the rbehave-devel list (http://rubyforge.org/mail/?group_id=1475) and let Dan know. Thanks, David From noreply at rubyforge.org Sun Jun 24 02:42:09 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Sun, 24 Jun 2007 02:42:09 -0400 (EDT) Subject: [rspec-devel] [ rspec-Patches-11807 ] Daemonize spec_server and rake tasks to manage them. Message-ID: <20070624064209.C50D15240B18@rubyforge.org> Patches item #11807, was opened at 2007-06-24 15:42 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3151&aid=11807&group_id=797 Category: rails plugin Group: None Status: Open Resolution: None Priority: 3 Submitted By: Kyosuke MOROHASHI (moro) Assigned to: Nobody (None) Summary: Daemonize spec_server and rake tasks to manage them. Initial Comment: This patche allows us to run spec_server as a damemon. And manage daemon's (start|stop|reload) via rake tasks. rake spec:server:start -- start spec_server as a daemon process rake spec:server:stop -- stop daemonized spec_server rake spec:server:reload -- reload daemonized spec_server Of course, you can start spec_server up as a foreground process (default). ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3151&aid=11807&group_id=797 From noreply at rubyforge.org Sun Jun 24 02:44:06 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Sun, 24 Jun 2007 02:44:06 -0400 (EDT) Subject: [rspec-devel] [ rspec-Patches-11807 ] Daemonize spec_server and rake tasks to manage them. Message-ID: <20070624064406.C6D3E5240B9A@rubyforge.org> Patches item #11807, was opened at 2007-06-24 15:42 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3151&aid=11807&group_id=797 Category: rails plugin Group: None Status: Open Resolution: None Priority: 3 Submitted By: Kyosuke MOROHASHI (moro) Assigned to: Nobody (None) Summary: Daemonize spec_server and rake tasks to manage them. Initial Comment: This patche allows us to run spec_server as a damemon. And manage daemon's (start|stop|reload) via rake tasks. rake spec:server:start -- start spec_server as a daemon process rake spec:server:stop -- stop daemonized spec_server rake spec:server:reload -- reload daemonized spec_server Of course, you can start spec_server up as a foreground process (default). ---------------------------------------------------------------------- >Comment By: Kyosuke MOROHASHI (moro) Date: 2007-06-24 15:44 Message: sorry, miss to attache patch. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3151&aid=11807&group_id=797 From noreply at rubyforge.org Sun Jun 24 08:17:16 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Sun, 24 Jun 2007 08:17:16 -0400 (EDT) Subject: [rspec-devel] [ rspec-Patches-11807 ] Daemonize spec_server and rake tasks to manage them. Message-ID: <20070624121716.F0E1F5240982@rubyforge.org> Patches item #11807, was opened at 2007-06-24 02:42 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3151&aid=11807&group_id=797 Category: rails plugin Group: None >Status: Closed >Resolution: Accepted Priority: 3 Submitted By: Kyosuke MOROHASHI (moro) >Assigned to: Aslak Helles?y (aslak_hellesoy) Summary: Daemonize spec_server and rake tasks to manage them. Initial Comment: This patche allows us to run spec_server as a damemon. And manage daemon's (start|stop|reload) via rake tasks. rake spec:server:start -- start spec_server as a daemon process rake spec:server:stop -- stop daemonized spec_server rake spec:server:reload -- reload daemonized spec_server Of course, you can start spec_server up as a foreground process (default). ---------------------------------------------------------------------- >Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-06-24 08:17 Message: Nice feature! Applied in r2121. ---------------------------------------------------------------------- Comment By: Kyosuke MOROHASHI (moro) Date: 2007-06-24 02:44 Message: sorry, miss to attache patch. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3151&aid=11807&group_id=797 From noreply at rubyforge.org Sun Jun 24 09:06:22 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Sun, 24 Jun 2007 09:06:22 -0400 (EDT) Subject: [rspec-devel] [ rspec-Patches-11254 ] RSpec syntax coloring and function pop-up integration in TextMate Message-ID: <20070624130622.EE06952409A7@rubyforge.org> Patches item #11254, was opened at 2007-05-31 10:43 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3151&aid=11254&group_id=797 Category: None Group: None Status: Open Resolution: None Priority: 3 Submitted By: Wincent Colaiuta (wincent) >Assigned to: Aslak Helles?y (aslak_hellesoy) Summary: RSpec syntax coloring and function pop-up integration in TextMate Initial Comment: This patch makes two additions to the RSpec TextMate bundle to provide a better user experience: syntax coloring of RSpec keywords (before, after, describe, it), and display of behaviours and examples in the function pop-up menu. This latter feature is very useful for navigation when working with files with large numbers of specs. Examples appear indented. Now, this is my first ever TextMate customization so I am sure someone more experienced could improve on the implementation, but in its basic form it works. Shortcomings of the current implementation: - recognition occurs at the whole-line level, so syntax colouring only kicks in once you have typed the entire line - recognition simplisticly divides the behaviour and example descriptions into three parts, the "describe" (or "it"), the "do", and "everything else" between the two - this in turn means that there is no special syntax colouring of the "everything else" - it also means that examples such as: it "should be valid" do ... end will appear in the function pop-up with the enclosing quotes: "should be valid" - likewise, a behaviour like: describe User, "at creation time" do ... end Will appear in the function pop-up as: User, "at creation time" - and shared behaviours will appear as: "All controllers", :shared => true Hopefully someone with more knowledge about TextMate customization than I can address these issues, but as it stands I think the basic implementation is useful enough that life is better with the aid of these imperfect changes. Will also try to attach a screenshot with the patch to show what the pop-up looks like. ---------------------------------------------------------------------- >Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-06-24 09:06 Message: This sounds great, but I'm having some problems. 1) The patch doesn't apply cleanly against trunk r2121 with "patch -p0 < textmate.diff": patching file Preferences/Symbol patching file Preferences/Symbol patching file info.plist Hunk #1 FAILED at 280. 1 out of 1 hunk FAILED -- saving rejects to file info.plist.rej patching file Syntaxes/RSpec.tmLanguage $ cat info.plist.rej *************** *** 280,285 **** 240FDD9D-CD49-4917-9003-80A3E1DADFBA B5906021-8E54-4863-A13B-EA46333DB5F1 67E726E0-63E2-4840-B8BB-37F665CD34B8 uuid 4CEA47CC-2C3A-45FB-80BE-3820828227C2 --- 280,288 ---- 240FDD9D-CD49-4917-9003-80A3E1DADFBA B5906021-8E54-4863-A13B-EA46333DB5F1 67E726E0-63E2-4840-B8BB-37F665CD34B8 + 923F0A10-96B9-4792-99A4-94FEF66E0B8C + 57EF6130-05A6-4117-94CB-C0BD63328334 + 28F89786-04F4-43D7-82A6-34B046C2BC6B uuid 4CEA47CC-2C3A-45FB-80BE-3820828227C2 2) I tried to add the three rejected lines manually, and in the bundle editor I can see the new RSpec syntax, but I don't see the new preferences. Shouldn't they show up too? 3) There is no new syntax highlighting on my Textmate. How does TextMate know to use this highlighting? Do I need to do anything special to make it work? 4) How do I bring up the list over behaviours and examples shown in your screenshot? It must be some keyboard shortcut I'm unaware of. Cheers, Aslak ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3151&aid=11254&group_id=797 From noreply at rubyforge.org Sun Jun 24 09:10:11 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Sun, 24 Jun 2007 09:10:11 -0400 (EDT) Subject: [rspec-devel] [ rspec-Patches-11509 ] Documentation - RSpec requires hpricot Message-ID: <20070624131011.B056C5240982@rubyforge.org> Patches item #11509, was opened at 2007-06-11 16:18 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3151&aid=11509&group_id=797 Category: None Group: None >Status: Closed >Resolution: Accepted Priority: 3 Submitted By: Scott Taylor (smtlaissezfaire) >Assigned to: Aslak Helles?y (aslak_hellesoy) Summary: Documentation - RSpec requires hpricot Initial Comment: RSpec requires hpricot. This adds a note to rspec/README. ---------------------------------------------------------------------- >Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-06-24 09:10 Message: Fixed a while ago ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3151&aid=11509&group_id=797 From noreply at rubyforge.org Sun Jun 24 09:20:21 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Sun, 24 Jun 2007 09:20:21 -0400 (EDT) Subject: [rspec-devel] [ rspec-Patches-11608 ] Exclude rspec_on_rails from plugin spec runs Message-ID: <20070624132022.3C6A15240982@rubyforge.org> Patches item #11608, was opened at 2007-06-16 00:32 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3151&aid=11608&group_id=797 Category: rails plugin Group: None >Status: Closed >Resolution: Accepted Priority: 3 Submitted By: Kyle Hargraves (philodespotos) >Assigned to: Aslak Helles?y (aslak_hellesoy) Summary: Exclude rspec_on_rails from plugin spec runs Initial Comment: Simple patch to exclude rspec_on_rails' plugin specs from the spec:plugins and :plugin_doc tasks. rspec_on_rails' specs largely fail for me, anyhow, so this seems like the best way to go. ---------------------------------------------------------------------- >Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-06-24 09:20 Message: Applied in r2122 ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3151&aid=11608&group_id=797 From noreply at rubyforge.org Sun Jun 24 09:23:14 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Sun, 24 Jun 2007 09:23:14 -0400 (EDT) Subject: [rspec-devel] [ rspec-Patches-11658 ] Removal of duplicated spec in OptionParser Message-ID: <20070624132314.7CC375240982@rubyforge.org> Patches item #11658, was opened at 2007-06-18 11:20 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3151&aid=11658&group_id=797 Category: runner module Group: None >Status: Closed >Resolution: Rejected Priority: 3 Submitted By: Scott Taylor (smtlaissezfaire) Assigned to: Nobody (None) Summary: Removal of duplicated spec in OptionParser Initial Comment: A spec used in the option parser spec is duplicated in the option spec. It appears as though the option parser should only used to parse command line options, while the Option class is used to provide the behavior for those options given on the command line. The spec which should remain in the code base is the specification "parse_example sets examples to contents of file" in rspec/spec/spec/runner/options_spec.rb ---------------------------------------------------------------------- >Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-06-24 09:23 Message: Nitpicking ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3151&aid=11658&group_id=797 From noreply at rubyforge.org Sun Jun 24 12:20:19 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Sun, 24 Jun 2007 12:20:19 -0400 (EDT) Subject: [rspec-devel] [ rspec-Patches-11608 ] Exclude rspec_on_rails from plugin spec runs Message-ID: <20070624162019.8B4775240982@rubyforge.org> Patches item #11608, was opened at 2007-06-16 04:32 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3151&aid=11608&group_id=797 Category: rails plugin Group: None >Status: Open Resolution: Accepted Priority: 3 Submitted By: Kyle Hargraves (philodespotos) Assigned to: Aslak Helles?y (aslak_hellesoy) Summary: Exclude rspec_on_rails from plugin spec runs Initial Comment: Simple patch to exclude rspec_on_rails' plugin specs from the spec:plugins and :plugin_doc tasks. rspec_on_rails' specs largely fail for me, anyhow, so this seems like the best way to go. ---------------------------------------------------------------------- >Comment By: David Chelimsky (dchelimsky) Date: 2007-06-24 16:20 Message: I'm un-applying this and re-opening it as it stops our own examples from running when we run rake. Need a version that we can control whether or not to run them easily. ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-06-24 13:20 Message: Applied in r2122 ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3151&aid=11608&group_id=797 From noreply at rubyforge.org Sun Jun 24 18:14:41 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Sun, 24 Jun 2007 18:14:41 -0400 (EDT) Subject: [rspec-devel] [ rspec-Patches-10791 ] A 'switch between source and spec file' command for textmate (with auto-creation!) Message-ID: <20070624221441.C9804524098D@rubyforge.org> Patches item #10791, was opened at 2007-05-12 01:31 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3151&aid=10791&group_id=797 Category: None >Group: None >Status: Closed >Resolution: Accepted Priority: 3 Submitted By: Ruy Asan (rubyruy) >Assigned to: Aslak Helles?y (aslak_hellesoy) Summary: A 'switch between source and spec file' command for textmate (with auto-creation!) Initial Comment: There is a great deal of switching back and forth between source and spec files when doing RSpec. The official tmbundle could probably benefit from this. Unforunately, I started writing this for just-my-own-use, so as a result it's not very pretty, needs to be tested, integrated with the various (and annoyingly un-documented) textmate libs and packaged. If a fellow text-mater wants to clean it up and add it to the official bundle, please do :) If not, I'll probably make it into a proper patch when I get some time. Source (and added info) here: http://ruy.ca/posts/6-A-simple-switch-between-source-and-spec-file-command-for-textmate-with-auto-creation- ---------------------------------------------------------------------- >Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-06-24 18:14 Message: I have added the command (r2127). It's based on this, but completely rewritten (with specs). ---------------------------------------------------------------------- Comment By: Scott Taylor (smtlaissezfaire) Date: 2007-05-13 20:58 Message: On Point #1, you may need to use the textmate url syntax: tmate://path/to/file that's what the rails tmbundle uses to open files inside the already open project. ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-05-13 19:04 Message: Very nice, but I have two problems: 1) When I run the command, TextMate complains: command not found: mate /path/to/some/file 2) There are no specs for this. It won't get in without specs. I recommend adding to the existing specs for RSpec.tmbundle. You can also add some fixtures (Some app/spec file pairs). The specs should be decoupled from TextMate itself. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3151&aid=10791&group_id=797 From noreply at rubyforge.org Mon Jun 25 02:13:47 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Mon, 25 Jun 2007 02:13:47 -0400 (EDT) Subject: [rspec-devel] [ rspec-Feature Requests-11818 ] Have mode for Rails Error Handling Message-ID: <20070625061347.33BE75240BA9@rubyforge.org> Feature Requests item #11818, was opened at 2007-06-24 23:13 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3152&aid=11818&group_id=797 Category: rails plugin Group: None Status: Open Priority: 3 Submitted By: Brian Takita (btakita) Assigned to: Nobody (None) Summary: Have mode for Rails Error Handling Initial Comment: Currently we default to raise an error as it happens. There should be a way to use Rail's default error handling. This is needed to verify that error specific behaviour is occurring, such as exception notification. To start things off, I added ActionController::Rescue#use_rails_error_handling! and ActionController::Rescue#use_rails_error_handling? to do this (Rev 2128). Thoughts? ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3152&aid=11818&group_id=797 From noreply at rubyforge.org Mon Jun 25 02:20:31 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Mon, 25 Jun 2007 02:20:31 -0400 (EDT) Subject: [rspec-devel] [ rspec-Feature Requests-11818 ] Have mode for Rails Error Handling Message-ID: <20070625062031.7336F5240BA9@rubyforge.org> Feature Requests item #11818, was opened at 2007-06-25 06:13 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3152&aid=11818&group_id=797 Category: rails plugin Group: None Status: Open Priority: 3 Submitted By: Brian Takita (btakita) Assigned to: Nobody (None) Summary: Have mode for Rails Error Handling Initial Comment: Currently we default to raise an error as it happens. There should be a way to use Rail's default error handling. This is needed to verify that error specific behaviour is occurring, such as exception notification. To start things off, I added ActionController::Rescue#use_rails_error_handling! and ActionController::Rescue#use_rails_error_handling? to do this (Rev 2128). Thoughts? ---------------------------------------------------------------------- >Comment By: David Chelimsky (dchelimsky) Date: 2007-06-25 06:20 Message: Seems reasonable. I think that same method should then be made available via config: Spec::Runner.configure do |config| config.use_rails_error_handling! end or directly in a given behaviour: describe SomeController do use_rails_error_handling! ... end WDYT? ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3152&aid=11818&group_id=797 From noreply at rubyforge.org Mon Jun 25 02:22:13 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Mon, 25 Jun 2007 02:22:13 -0400 (EDT) Subject: [rspec-devel] [ rspec-Feature Requests-11818 ] Have mode for Rails Error Handling Message-ID: <20070625062213.DE70B5240BA9@rubyforge.org> Feature Requests item #11818, was opened at 2007-06-25 06:13 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3152&aid=11818&group_id=797 Category: rails plugin Group: None Status: Open Priority: 3 Submitted By: Brian Takita (btakita) Assigned to: Nobody (None) Summary: Have mode for Rails Error Handling Initial Comment: Currently we default to raise an error as it happens. There should be a way to use Rail's default error handling. This is needed to verify that error specific behaviour is occurring, such as exception notification. To start things off, I added ActionController::Rescue#use_rails_error_handling! and ActionController::Rescue#use_rails_error_handling? to do this (Rev 2128). Thoughts? ---------------------------------------------------------------------- >Comment By: David Chelimsky (dchelimsky) Date: 2007-06-25 06:22 Message: Well - maybe the exclamation point doesn't make sense except when the method is being called directly on ActionController::Rescue. But I think we should either always have the exclamation point or never. Otherwise it'll just get confusing. ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-06-25 06:20 Message: Seems reasonable. I think that same method should then be made available via config: Spec::Runner.configure do |config| config.use_rails_error_handling! end or directly in a given behaviour: describe SomeController do use_rails_error_handling! ... end WDYT? ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3152&aid=11818&group_id=797 From noreply at rubyforge.org Mon Jun 25 05:21:55 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Mon, 25 Jun 2007 05:21:55 -0400 (EDT) Subject: [rspec-devel] [ rspec-Patches-11254 ] RSpec syntax coloring and function pop-up integration in TextMate Message-ID: <20070625092155.D1F285240998@rubyforge.org> Patches item #11254, was opened at 2007-05-31 14:43 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3151&aid=11254&group_id=797 Category: None Group: None Status: Open Resolution: None Priority: 3 Submitted By: Wincent Colaiuta (wincent) Assigned to: Aslak Helles?y (aslak_hellesoy) Summary: RSpec syntax coloring and function pop-up integration in TextMate Initial Comment: This patch makes two additions to the RSpec TextMate bundle to provide a better user experience: syntax coloring of RSpec keywords (before, after, describe, it), and display of behaviours and examples in the function pop-up menu. This latter feature is very useful for navigation when working with files with large numbers of specs. Examples appear indented. Now, this is my first ever TextMate customization so I am sure someone more experienced could improve on the implementation, but in its basic form it works. Shortcomings of the current implementation: - recognition occurs at the whole-line level, so syntax colouring only kicks in once you have typed the entire line - recognition simplisticly divides the behaviour and example descriptions into three parts, the "describe" (or "it"), the "do", and "everything else" between the two - this in turn means that there is no special syntax colouring of the "everything else" - it also means that examples such as: it "should be valid" do ... end will appear in the function pop-up with the enclosing quotes: "should be valid" - likewise, a behaviour like: describe User, "at creation time" do ... end Will appear in the function pop-up as: User, "at creation time" - and shared behaviours will appear as: "All controllers", :shared => true Hopefully someone with more knowledge about TextMate customization than I can address these issues, but as it stands I think the basic implementation is useful enough that life is better with the aid of these imperfect changes. Will also try to attach a screenshot with the patch to show what the pop-up looks like. ---------------------------------------------------------------------- >Comment By: Wincent Colaiuta (wincent) Date: 2007-06-25 09:21 Message: (1) The patch was made against the trunk back at the end of May (r2060, I think). The changes to the info.plist (shouldn't it be Info.plist, btw?) weren't manually done by me, but were inserted by TextMate when I made the other additions via its Bundle Editor. These settings are pretty opaque to me and omitting them seems to make no difference, so I will attach a patch against the current trunk which does not include the info.plist changes. (2) There aren't any new user-settable "preferences" as such. The two new files in the "Preferences" subdirectory of the bundle are used to add Behaviours and Examples to the TextMate symbols list... this is what allows them to appear in the pop-up. (3) To see the syntax highlighting you must select "RSpec" from the language pop-up at the bottom of the window. This is just like when you have a Rails file and want special Rails-specific highlighting instead of the default Ruby highlighting. It would be nice if TextMate allowed you to specify that all files ending in "_spec.rb" would be auto-detected as RSpec files, but as far as I know, TextMate only allows you to specify the extension part (".rb") and that would override the default Ruby highlighting. So if we want that feature we either need to try again get the RSpec syntax rolled into the Ruby.tmbundle, or try to get Allan to modify Textmate to allow us to specify not just the extension. (4) The pop-up menu is the function pop-up at the bottom of the TextMate window (right hand side). I don't know if there is a keyboard shortcut; I use the mouse for that. ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-06-24 13:06 Message: This sounds great, but I'm having some problems. 1) The patch doesn't apply cleanly against trunk r2121 with "patch -p0 < textmate.diff": patching file Preferences/Symbol patching file Preferences/Symbol patching file info.plist Hunk #1 FAILED at 280. 1 out of 1 hunk FAILED -- saving rejects to file info.plist.rej patching file Syntaxes/RSpec.tmLanguage $ cat info.plist.rej *************** *** 280,285 **** 240FDD9D-CD49-4917-9003-80A3E1DADFBA B5906021-8E54-4863-A13B-EA46333DB5F1 67E726E0-63E2-4840-B8BB-37F665CD34B8 uuid 4CEA47CC-2C3A-45FB-80BE-3820828227C2 --- 280,288 ---- 240FDD9D-CD49-4917-9003-80A3E1DADFBA B5906021-8E54-4863-A13B-EA46333DB5F1 67E726E0-63E2-4840-B8BB-37F665CD34B8 + 923F0A10-96B9-4792-99A4-94FEF66E0B8C + 57EF6130-05A6-4117-94CB-C0BD63328334 + 28F89786-04F4-43D7-82A6-34B046C2BC6B uuid 4CEA47CC-2C3A-45FB-80BE-3820828227C2 2) I tried to add the three rejected lines manually, and in the bundle editor I can see the new RSpec syntax, but I don't see the new preferences. Shouldn't they show up too? 3) There is no new syntax highlighting on my Textmate. How does TextMate know to use this highlighting? Do I need to do anything special to make it work? 4) How do I bring up the list over behaviours and examples shown in your screenshot? It must be some keyboard shortcut I'm unaware of. Cheers, Aslak ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3151&aid=11254&group_id=797 From noreply at rubyforge.org Mon Jun 25 13:06:41 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Mon, 25 Jun 2007 13:06:41 -0400 (EDT) Subject: [rspec-devel] [ rspec-Feature Requests-11834 ] Fake Controller Flash object Message-ID: <20070625170641.568EC5240A32@rubyforge.org> Feature Requests item #11834, was opened at 2007-06-25 10:06 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3152&aid=11834&group_id=797 Category: rails plugin Group: None Status: Open Priority: 3 Submitted By: Brian Takita (btakita) Assigned to: Nobody (None) Summary: Fake Controller Flash object Initial Comment: Currently it is difficult to test the values on Flash.now, because the Flash.sweep is called during the process action. We made a Fake Flash Hash object that collects the flash content and does not sweep it when the request is processed. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3152&aid=11834&group_id=797 From noreply at rubyforge.org Mon Jun 25 19:07:47 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Mon, 25 Jun 2007 19:07:47 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11843 ] watir_behaviour missing from spec_ui gem Message-ID: <20070625230747.9CC885240A67@rubyforge.org> Bugs item #11843, was opened at 2007-06-25 16:07 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11843&group_id=797 Category: None Group: None Status: Open Resolution: None Priority: 3 Submitted By: Erik Ostrom (eostrom) Assigned to: Nobody (None) Summary: watir_behaviour missing from spec_ui gem Initial Comment: I installed watir 1.4.1 and spec_ui 0.2.3 on Windows XP (Ruby 1.8.6) and edited files as described here: http://rubyforge.org/pipermail/rspec-users/2007-May/001541.html I wrote a simple spec, tried to run it, and got this: c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in 'gem_original_require': no such file to load -- spec/ui/watir/watir_behaviour (MissingSourceFile) from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' from C:/workspace/april/config/../vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:495:in `require' from C:/workspace/april/config/../vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:342:in `new_constants_in' from C:/workspace/april/config/../vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:495:in `require' from c:/ruby/lib/ruby/gems/1.8/gems/spec_ui-0.2.3/lib/spec/ui/watir.rb:3 The relevant line is this: require 'spec/ui/watir/watir_behaviour' The installed gem directory .../gems/spec_ui-0.2.3/lib/spec/ui/watir contains browser.rb, matchers.rb, but no watir_behaviour.rb. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11843&group_id=797 From noreply at rubyforge.org Mon Jun 25 19:23:21 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Mon, 25 Jun 2007 19:23:21 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11843 ] watir_behaviour missing from spec_ui gem Message-ID: <20070625232321.66F875240A64@rubyforge.org> Bugs item #11843, was opened at 2007-06-25 23:07 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11843&group_id=797 Category: None Group: None >Status: Closed >Resolution: Accepted Priority: 3 Submitted By: Erik Ostrom (eostrom) >Assigned to: David Chelimsky (dchelimsky) Summary: watir_behaviour missing from spec_ui gem Initial Comment: I installed watir 1.4.1 and spec_ui 0.2.3 on Windows XP (Ruby 1.8.6) and edited files as described here: http://rubyforge.org/pipermail/rspec-users/2007-May/001541.html I wrote a simple spec, tried to run it, and got this: c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in 'gem_original_require': no such file to load -- spec/ui/watir/watir_behaviour (MissingSourceFile) from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' from C:/workspace/april/config/../vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:495:in `require' from C:/workspace/april/config/../vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:342:in `new_constants_in' from C:/workspace/april/config/../vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:495:in `require' from c:/ruby/lib/ruby/gems/1.8/gems/spec_ui-0.2.3/lib/spec/ui/watir.rb:3 The relevant line is this: require 'spec/ui/watir/watir_behaviour' The installed gem directory .../gems/spec_ui-0.2.3/lib/spec/ui/watir contains browser.rb, matchers.rb, but no watir_behaviour.rb. ---------------------------------------------------------------------- >Comment By: David Chelimsky (dchelimsky) Date: 2007-06-25 23:23 Message: Fixed in r2130. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11843&group_id=797 From bob.cotton at rallydev.com Tue Jun 26 00:30:27 2007 From: bob.cotton at rallydev.com (Bob Cotton) Date: Mon, 25 Jun 2007 22:30:27 -0600 Subject: [rspec-devel] new pending feature (pending release) In-Reply-To: <57c63afe0706230901x72f06fcck5b3cd64f43f85912@mail.gmail.com> (David Chelimsky's message of "Sat, 23 Jun 2007 11:01:38 -0500") References: <57c63afe0706230901x72f06fcck5b3cd64f43f85912@mail.gmail.com> Message-ID: "David Chelimsky" writes: > I just added a new "pending" feature. It's in trunk (rev 2118+) and > will be part of the 1.0.6 release (*probably* within the next week). > > Read all about it: > http://blog.davidchelimsky.net/articles/2007/06/23/pending-insert-reason-here A very nice feature. Here's a twist to consider: We use rspec for functional testing of a large-ish application. Sometimes we find bugs that may take some time to be resolved, a few days, a few weeks. Once the bug is identified, I don't want to see it failing the nightly builds, day after day. pending() might be useful here, as I can say: pending("Bug 12345 being fixed") But then I would have to wrap this in some conditional logic that tests if the bug is actually fixed. But, what if pending took a block: pending("Bug 12345 being fixed") do actual.should == expected end and pending would fail (not with a pending exception) once the code inside the block started passing? That way we could mark something as a know issue, and be notified when that thing was fixed and go removed the pending. Thoughts? - Bob From aslak.hellesoy at gmail.com Tue Jun 26 02:57:41 2007 From: aslak.hellesoy at gmail.com (aslak hellesoy) Date: Tue, 26 Jun 2007 08:57:41 +0200 Subject: [rspec-devel] new pending feature (pending release) In-Reply-To: References: <57c63afe0706230901x72f06fcck5b3cd64f43f85912@mail.gmail.com> Message-ID: <8d961d900706252357s4f6a1ea5l8a27cedfd18488fa@mail.gmail.com> On 6/26/07, Bob Cotton wrote: > "David Chelimsky" writes: > > > I just added a new "pending" feature. It's in trunk (rev 2118+) and > > will be part of the 1.0.6 release (*probably* within the next week). > > > > Read all about it: > > http://blog.davidchelimsky.net/articles/2007/06/23/pending-insert-reason-here > > A very nice feature. > > Here's a twist to consider: > > We use rspec for functional testing of a large-ish > application. Sometimes we find bugs that may take some time to be > resolved, a few days, a few weeks. Once the bug is identified, I don't > want to see it failing the nightly builds, day after day. > > pending() might be useful here, as I can say: > > pending("Bug 12345 being fixed") > > But then I would have to wrap this in some conditional logic that > tests if the bug is actually fixed. > > But, what if pending took a block: > > pending("Bug 12345 being fixed") do > actual.should == expected > end > > and pending would fail (not with a pending exception) once the code > inside the block started passing? > > That way we could mark something as a know issue, and be notified when > that thing was fixed and go removed the pending. > I think that's a great idea. It could be coloured blue in the output. > Thoughts? > > - Bob > _______________________________________________ > rspec-devel mailing list > rspec-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-devel > From noreply at rubyforge.org Tue Jun 26 03:02:15 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Tue, 26 Jun 2007 03:02:15 -0400 (EDT) Subject: [rspec-devel] [ rspec-Feature Requests-11834 ] Fake Controller Flash object Message-ID: <20070626070216.1D8625240BE2@rubyforge.org> Feature Requests item #11834, was opened at 2007-06-25 13:06 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3152&aid=11834&group_id=797 Category: rails plugin Group: None Status: Open Priority: 3 Submitted By: Brian Takita (btakita) Assigned to: Nobody (None) Summary: Fake Controller Flash object Initial Comment: Currently it is difficult to test the values on Flash.now, because the Flash.sweep is called during the process action. We made a Fake Flash Hash object that collects the flash content and does not sweep it when the request is processed. ---------------------------------------------------------------------- >Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-06-26 03:02 Message: What does it look like? ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3152&aid=11834&group_id=797 From dchelimsky at gmail.com Tue Jun 26 06:51:43 2007 From: dchelimsky at gmail.com (David Chelimsky) Date: Tue, 26 Jun 2007 05:51:43 -0500 Subject: [rspec-devel] new pending feature (pending release) In-Reply-To: <8d961d900706252357s4f6a1ea5l8a27cedfd18488fa@mail.gmail.com> References: <57c63afe0706230901x72f06fcck5b3cd64f43f85912@mail.gmail.com> <8d961d900706252357s4f6a1ea5l8a27cedfd18488fa@mail.gmail.com> Message-ID: <57c63afe0706260351n4b4018a1t34dd7209b229a4bd@mail.gmail.com> On 6/26/07, aslak hellesoy wrote: > On 6/26/07, Bob Cotton wrote: > > "David Chelimsky" writes: > > > > > I just added a new "pending" feature. It's in trunk (rev 2118+) and > > > will be part of the 1.0.6 release (*probably* within the next week). > > > > > > Read all about it: > > > http://blog.davidchelimsky.net/articles/2007/06/23/pending-insert-reason-here > > > > A very nice feature. > > > > Here's a twist to consider: > > > > We use rspec for functional testing of a large-ish > > application. Sometimes we find bugs that may take some time to be > > resolved, a few days, a few weeks. Once the bug is identified, I don't > > want to see it failing the nightly builds, day after day. > > > > pending() might be useful here, as I can say: > > > > pending("Bug 12345 being fixed") > > > > But then I would have to wrap this in some conditional logic that > > tests if the bug is actually fixed. > > > > But, what if pending took a block: > > > > pending("Bug 12345 being fixed") do > > actual.should == expected > > end > > > > and pending would fail (not with a pending exception) once the code > > inside the block started passing? > > > > That way we could mark something as a know issue, and be notified when > > that thing was fixed and go removed the pending. > > > > I think that's a great idea. It could be coloured blue in the output. As long as we make the block optional, I'm cool w/ this. I can see that use for it, but I don't know that I'd want to force it on everyone. Bob - you want to take a crack at this? > > > Thoughts? > > > > - Bob > > _______________________________________________ > > rspec-devel mailing list > > rspec-devel at rubyforge.org > > http://rubyforge.org/mailman/listinfo/rspec-devel > > > _______________________________________________ > rspec-devel mailing list > rspec-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-devel > From bob.cotton at rallydev.com Tue Jun 26 09:03:30 2007 From: bob.cotton at rallydev.com (Bob Cotton) Date: Tue, 26 Jun 2007 07:03:30 -0600 Subject: [rspec-devel] new pending feature (pending release) In-Reply-To: <57c63afe0706260351n4b4018a1t34dd7209b229a4bd@mail.gmail.com> (David Chelimsky's message of "Tue, 26 Jun 2007 05:51:43 -0500") References: <57c63afe0706230901x72f06fcck5b3cd64f43f85912@mail.gmail.com> <8d961d900706252357s4f6a1ea5l8a27cedfd18488fa@mail.gmail.com> <57c63afe0706260351n4b4018a1t34dd7209b229a4bd@mail.gmail.com> Message-ID: "David Chelimsky" writes: > On 6/26/07, aslak hellesoy wrote: >> On 6/26/07, Bob Cotton wrote: >> > "David Chelimsky" writes: >> > >> > > I just added a new "pending" feature. It's in trunk (rev 2118+) and >> > > will be part of the 1.0.6 release (*probably* within the next week). >> > > >> > > Read all about it: >> > > http://blog.davidchelimsky.net/articles/2007/06/23/pending-insert-reason-here >> > >> > A very nice feature. >> > >> > Here's a twist to consider: >> > >> > We use rspec for functional testing of a large-ish >> > application. Sometimes we find bugs that may take some time to be >> > resolved, a few days, a few weeks. Once the bug is identified, I don't >> > want to see it failing the nightly builds, day after day. >> > >> > pending() might be useful here, as I can say: >> > >> > pending("Bug 12345 being fixed") >> > >> > But then I would have to wrap this in some conditional logic that >> > tests if the bug is actually fixed. >> > >> > But, what if pending took a block: >> > >> > pending("Bug 12345 being fixed") do >> > actual.should == expected >> > end >> > >> > and pending would fail (not with a pending exception) once the code >> > inside the block started passing? >> > >> > That way we could mark something as a know issue, and be notified when >> > that thing was fixed and go removed the pending. >> > >> >> I think that's a great idea. It could be coloured blue in the output. > > As long as we make the block optional, I'm cool w/ this. I can see > that use for it, but I don't know that I'd want to force it on > everyone. > > Bob - you want to take a crack at this? Will do. -Bob > >> >> > Thoughts? >> > >> > - Bob >> > _______________________________________________ >> > rspec-devel mailing list >> > rspec-devel at rubyforge.org >> > http://rubyforge.org/mailman/listinfo/rspec-devel >> > >> _______________________________________________ >> rspec-devel mailing list >> rspec-devel at rubyforge.org >> http://rubyforge.org/mailman/listinfo/rspec-devel >> > _______________________________________________ > rspec-devel mailing list > rspec-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-devel From noreply at rubyforge.org Tue Jun 26 14:01:07 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Tue, 26 Jun 2007 14:01:07 -0400 (EDT) Subject: [rspec-devel] [ rspec-Patches-11608 ] Exclude rspec_on_rails from plugin spec runs Message-ID: <20070626180107.603045240AE0@rubyforge.org> Patches item #11608, was opened at 2007-06-16 04:32 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3151&aid=11608&group_id=797 Category: rails plugin Group: None Status: Open Resolution: Accepted Priority: 3 Submitted By: Kyle Hargraves (philodespotos) Assigned to: Aslak Helles?y (aslak_hellesoy) Summary: Exclude rspec_on_rails from plugin spec runs Initial Comment: Simple patch to exclude rspec_on_rails' plugin specs from the spec:plugins and :plugin_doc tasks. rspec_on_rails' specs largely fail for me, anyhow, so this seems like the best way to go. ---------------------------------------------------------------------- >Comment By: Kyle Hargraves (philodespotos) Date: 2007-06-26 18:01 Message: How about just depending on the environment? This patch probably isn't exactly what you'd want, but it seems to work -- though I haven't tested my pre_commit edit. Sorry to harrass, but developing a plugin on 'fresh' installs is a pain, since I have to patch rspec_on_rails every time I check it out, or pull my own copy around with me. =) ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-06-24 16:20 Message: I'm un-applying this and re-opening it as it stops our own examples from running when we run rake. Need a version that we can control whether or not to run them easily. ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-06-24 13:20 Message: Applied in r2122 ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3151&aid=11608&group_id=797 From noreply at rubyforge.org Tue Jun 26 17:13:32 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Tue, 26 Jun 2007 17:13:32 -0400 (EDT) Subject: [rspec-devel] [ rspec-Patches-11868 ] Add ability for pending to optionally hold a failing block and to fail when it passes Message-ID: <20070626211332.A0AFC5240B75@rubyforge.org> Patches item #11868, was opened at 2007-06-26 15:13 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3151&aid=11868&group_id=797 Category: None Group: None Status: Open Resolution: None Priority: 3 Submitted By: Bob Cotton (bcotton) Assigned to: Nobody (None) Summary: Add ability for pending to optionally hold a failing block and to fail when it passes Initial Comment: See http://rubyforge.org/pipermail/rspec-devel/2007-June/003144.html ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3151&aid=11868&group_id=797 From noreply at rubyforge.org Tue Jun 26 21:15:19 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Tue, 26 Jun 2007 21:15:19 -0400 (EDT) Subject: [rspec-devel] [ rspec-Patches-11868 ] Add ability for pending to optionally hold a failing block and to fail when it passes Message-ID: <20070627011519.8C53F5240C1F@rubyforge.org> Patches item #11868, was opened at 2007-06-26 21:13 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3151&aid=11868&group_id=797 Category: None Group: None >Status: Closed >Resolution: Accepted Priority: 3 Submitted By: Bob Cotton (bcotton) >Assigned to: David Chelimsky (dchelimsky) Summary: Add ability for pending to optionally hold a failing block and to fail when it passes Initial Comment: See http://rubyforge.org/pipermail/rspec-devel/2007-June/003144.html ---------------------------------------------------------------------- >Comment By: David Chelimsky (dchelimsky) Date: 2007-06-27 01:15 Message: Applied to r2133. FYI - thank you for submitting all 4 formatted html files. Unfortunately, I couldn't use them because they require the syntax gem to get the syntax highlighting to work. Everything else looks great though. Thanks. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3151&aid=11868&group_id=797 From noreply at rubyforge.org Tue Jun 26 21:30:19 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Tue, 26 Jun 2007 21:30:19 -0400 (EDT) Subject: [rspec-devel] [ rspec-Patches-11608 ] Exclude rspec_on_rails from plugin spec runs Message-ID: <20070627013019.A75295240BE2@rubyforge.org> Patches item #11608, was opened at 2007-06-16 04:32 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3151&aid=11608&group_id=797 Category: rails plugin Group: None Status: Open Resolution: Accepted Priority: 3 Submitted By: Kyle Hargraves (philodespotos) Assigned to: Aslak Helles?y (aslak_hellesoy) Summary: Exclude rspec_on_rails from plugin spec runs Initial Comment: Simple patch to exclude rspec_on_rails' plugin specs from the spec:plugins and :plugin_doc tasks. rspec_on_rails' specs largely fail for me, anyhow, so this seems like the best way to go. ---------------------------------------------------------------------- >Comment By: David Chelimsky (dchelimsky) Date: 2007-06-27 01:30 Message: Making contributions isn't harassing. If you contribute a patch that is tested and doesn't stop our own examples from running, I'll be glad to apply it. FYI - you should look into http://piston.rubyforge.org/ - it's a good general solution for this sort of problem. ---------------------------------------------------------------------- Comment By: Kyle Hargraves (philodespotos) Date: 2007-06-26 18:01 Message: How about just depending on the environment? This patch probably isn't exactly what you'd want, but it seems to work -- though I haven't tested my pre_commit edit. Sorry to harrass, but developing a plugin on 'fresh' installs is a pain, since I have to patch rspec_on_rails every time I check it out, or pull my own copy around with me. =) ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-06-24 16:20 Message: I'm un-applying this and re-opening it as it stops our own examples from running when we run rake. Need a version that we can control whether or not to run them easily. ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-06-24 13:20 Message: Applied in r2122 ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3151&aid=11608&group_id=797 From bob.cotton at rallydev.com Tue Jun 26 23:05:43 2007 From: bob.cotton at rallydev.com (Bob Cotton) Date: Tue, 26 Jun 2007 21:05:43 -0600 Subject: [rspec-devel] [ rspec-Patches-11868 ] Add ability for pending to optionally hold a failing block and to fail when it passes In-Reply-To: <20070627011519.8C53F5240C1F@rubyforge.org> (noreply@rubyforge.org's message of "Tue, 26 Jun 2007 21:15:19 -0400 (EDT)") References: <20070627011519.8C53F5240C1F@rubyforge.org> Message-ID: writes: >>Comment By: David Chelimsky (dchelimsky) > Date: 2007-06-27 01:15 > > Message: > Applied to r2133. > > FYI - thank you for submitting all 4 formatted html > files. Unfortunately, I couldn't use them because they require the > syntax gem to get the syntax highlighting to work. Everything else > looks great though. Good to know. I'll install that gem also. Do you have an automated way to create all those files? - Bob From dchelimsky at gmail.com Tue Jun 26 23:19:14 2007 From: dchelimsky at gmail.com (David Chelimsky) Date: Tue, 26 Jun 2007 22:19:14 -0500 Subject: [rspec-devel] [ rspec-Patches-11868 ] Add ability for pending to optionally hold a failing block and to fail when it passes In-Reply-To: References: <20070627011519.8C53F5240C1F@rubyforge.org> Message-ID: <57c63afe0706262019i660a21d0hdb03b092aef50d57@mail.gmail.com> On 6/26/07, Bob Cotton wrote: > writes: > > >>Comment By: David Chelimsky (dchelimsky) > > Date: 2007-06-27 01:15 > > > > Message: > > Applied to r2133. > > > > FYI - thank you for submitting all 4 formatted html > > files. Unfortunately, I couldn't use them because they require the > > syntax gem to get the syntax highlighting to work. Everything else > > looks great though. > > Good to know. I'll install that gem also. > > Do you have an automated way to create all those files? I don't - do you? > > - Bob > _______________________________________________ > rspec-devel mailing list > rspec-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-devel > From dchelimsky at gmail.com Wed Jun 27 01:31:53 2007 From: dchelimsky at gmail.com (David Chelimsky) Date: Wed, 27 Jun 2007 00:31:53 -0500 Subject: [rspec-devel] template.expect_render Message-ID: <57c63afe0706262231o31ffe07bv36d51b1fde376e15@mail.gmail.com> Trunksters, I just added a couple of methods to ActionView::Base in Spec::Rails (as of r2136) that lets you do this in view examples: describe '/things/index.html.erb' do it "should render _thing with a collection of things" do assigns[:things] = things = [Object.new] template.expect_render(:partial => 'thing', :collection => things) render '/things/index.html.erb' end end This solves two big problems - mocking nested partials and mocking :object and :collection in partials. template.expect_render wraps part of 'spec/mocks', but not the whole framework - so we get the expectation matching benefit w/o conflicting with other mock frameworks that ppl might choose to use. There is also template.stub_render(opts) in case you just want to stub the render w/o verification. I would LOVE it if some of you would try this method out and provide feedback before we release it. Please feel to ask any questions about this on this list. Thanks, David From noreply at rubyforge.org Wed Jun 27 02:38:05 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Wed, 27 Jun 2007 02:38:05 -0400 (EDT) Subject: [rspec-devel] [ rspec-Feature Requests-11834 ] Fake Controller Flash object Message-ID: <20070627063805.BA3F55240C63@rubyforge.org> Feature Requests item #11834, was opened at 2007-06-25 10:06 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3152&aid=11834&group_id=797 Category: rails plugin Group: None Status: Open Priority: 3 Submitted By: Brian Takita (btakita) Assigned to: Nobody (None) Summary: Fake Controller Flash object Initial Comment: Currently it is difficult to test the values on Flash.now, because the Flash.sweep is called during the process action. We made a Fake Flash Hash object that collects the flash content and does not sweep it when the request is processed. ---------------------------------------------------------------------- >Comment By: Brian Takita (btakita) Date: 2007-06-26 23:38 Message: Mainly, it was Nathan Wilmes who developed this. It is very bare bones, and meant for primarily collecting value. class MockFlashHash def initialize @hash = {} @now_hash = {} end def [](key) @hash[key] end def []=(key, obj) @hash[key] = obj end def discard(k = nil) initialize end def now @now_hash end def update(hash) @hash.update(hash) end def sweep # This is the key. We don't really want flash.now's to go away. end end ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-06-26 00:02 Message: What does it look like? ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3152&aid=11834&group_id=797 From bob.cotton at rallydev.com Wed Jun 27 07:26:08 2007 From: bob.cotton at rallydev.com (Bob Cotton) Date: Wed, 27 Jun 2007 05:26:08 -0600 Subject: [rspec-devel] [ rspec-Patches-11868 ] Add ability for pending to optionally hold a failing block and to fail when it passes In-Reply-To: <57c63afe0706262019i660a21d0hdb03b092aef50d57@mail.gmail.com> (David Chelimsky's message of "Tue, 26 Jun 2007 22:19:14 -0500") References: <20070627011519.8C53F5240C1F@rubyforge.org> <57c63afe0706262019i660a21d0hdb03b092aef50d57@mail.gmail.com> Message-ID: "David Chelimsky" writes: > On 6/26/07, Bob Cotton wrote: >> writes: >> >> >>Comment By: David Chelimsky (dchelimsky) >> > Date: 2007-06-27 01:15 >> > >> > Message: >> > Applied to r2133. >> > >> > FYI - thank you for submitting all 4 formatted html >> > files. Unfortunately, I couldn't use them because they require the >> > syntax gem to get the syntax highlighting to work. Everything else >> > looks great though. >> >> Good to know. I'll install that gem also. >> >> Do you have an automated way to create all those files? > > I don't - do you? Nope. > >> >> - Bob >> _______________________________________________ >> rspec-devel mailing list >> rspec-devel at rubyforge.org >> http://rubyforge.org/mailman/listinfo/rspec-devel >> > _______________________________________________ > rspec-devel mailing list > rspec-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-devel From aslak.hellesoy at gmail.com Wed Jun 27 07:48:14 2007 From: aslak.hellesoy at gmail.com (aslak hellesoy) Date: Wed, 27 Jun 2007 13:48:14 +0200 Subject: [rspec-devel] [ rspec-Patches-11868 ] Add ability for pending to optionally hold a failing block and to fail when it passes In-Reply-To: References: <20070627011519.8C53F5240C1F@rubyforge.org> <57c63afe0706262019i660a21d0hdb03b092aef50d57@mail.gmail.com> Message-ID: <8d961d900706270448t2218e2aex187d070197d84c26@mail.gmail.com> On 6/27/07, Bob Cotton wrote: > "David Chelimsky" writes: > > > On 6/26/07, Bob Cotton wrote: > >> writes: > >> > >> >>Comment By: David Chelimsky (dchelimsky) > >> > Date: 2007-06-27 01:15 > >> > > >> > Message: > >> > Applied to r2133. > >> > > >> > FYI - thank you for submitting all 4 formatted html > >> > files. Unfortunately, I couldn't use them because they require the > >> > syntax gem to get the syntax highlighting to work. Everything else > >> > looks great though. > >> > >> Good to know. I'll install that gem also. > >> > >> Do you have an automated way to create all those files? > > > > I don't - do you? > > Nope. > What we usually do is to uncomment the line in html_formatter_spec.rb that writes the file to disk, eyeball the diff and eyeball the html in a browser to see that everything still looks good, then comment out the line again. Aslak > > > >> > >> - Bob > >> _______________________________________________ > >> rspec-devel mailing list > >> rspec-devel at rubyforge.org > >> http://rubyforge.org/mailman/listinfo/rspec-devel > >> > > _______________________________________________ > > rspec-devel mailing list > > rspec-devel at rubyforge.org > > http://rubyforge.org/mailman/listinfo/rspec-devel > _______________________________________________ > rspec-devel mailing list > rspec-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-devel > From dchelimsky at gmail.com Wed Jun 27 07:50:28 2007 From: dchelimsky at gmail.com (David Chelimsky) Date: Wed, 27 Jun 2007 06:50:28 -0500 Subject: [rspec-devel] [ rspec-Patches-11868 ] Add ability for pending to optionally hold a failing block and to fail when it passes In-Reply-To: <8d961d900706270448t2218e2aex187d070197d84c26@mail.gmail.com> References: <20070627011519.8C53F5240C1F@rubyforge.org> <57c63afe0706262019i660a21d0hdb03b092aef50d57@mail.gmail.com> <8d961d900706270448t2218e2aex187d070197d84c26@mail.gmail.com> Message-ID: <57c63afe0706270450rd9c40abh3f8a7d230c9ba968@mail.gmail.com> On 6/27/07, aslak hellesoy wrote: > On 6/27/07, Bob Cotton wrote: > > "David Chelimsky" writes: > > > > > On 6/26/07, Bob Cotton wrote: > > >> writes: > > >> > > >> >>Comment By: David Chelimsky (dchelimsky) > > >> > Date: 2007-06-27 01:15 > > >> > > > >> > Message: > > >> > Applied to r2133. > > >> > > > >> > FYI - thank you for submitting all 4 formatted html > > >> > files. Unfortunately, I couldn't use them because they require the > > >> > syntax gem to get the syntax highlighting to work. Everything else > > >> > looks great though. > > >> > > >> Good to know. I'll install that gem also. > > >> > > >> Do you have an automated way to create all those files? > > > > > > I don't - do you? > > > > Nope. > > > > What we usually do is to uncomment the line in html_formatter_spec.rb > that writes the file to disk, eyeball the diff and eyeball the html in > a browser to see that everything still looks good, then comment out > the line again. I think the question was about automating the process for all 4 versions of ruby we're supporting. Bob had included them in the patch, so I imagine he already figured out how to generate them one at a time. Bob? > > Aslak > > > > > > >> > > >> - Bob > > >> _______________________________________________ > > >> rspec-devel mailing list > > >> rspec-devel at rubyforge.org > > >> http://rubyforge.org/mailman/listinfo/rspec-devel > > >> > > > _______________________________________________ > > > rspec-devel mailing list > > > rspec-devel at rubyforge.org > > > http://rubyforge.org/mailman/listinfo/rspec-devel > > _______________________________________________ > > rspec-devel mailing list > > rspec-devel at rubyforge.org > > http://rubyforge.org/mailman/listinfo/rspec-devel > > > _______________________________________________ > rspec-devel mailing list > rspec-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-devel > From dan at tastapod.com Wed Jun 27 11:01:32 2007 From: dan at tastapod.com (Dan North) Date: Wed, 27 Jun 2007 16:01:32 +0100 Subject: [rspec-devel] new pending feature (pending release) In-Reply-To: References: <57c63afe0706230901x72f06fcck5b3cd64f43f85912@mail.gmail.com> Message-ID: <46827BCC.1090101@tastapod.com> I think that's brilliant! Especially that the pending /fails/ when the block /works/, so you have to remove the pending block before you can check in. Mind if I steal it for rbehave? Bob Cotton wrote: > "David Chelimsky" writes: > > >> I just added a new "pending" feature. It's in trunk (rev 2118+) and >> will be part of the 1.0.6 release (*probably* within the next week). >> >> Read all about it: >> http://blog.davidchelimsky.net/articles/2007/06/23/pending-insert-reason-here >> > > A very nice feature. > > Here's a twist to consider: > > We use rspec for functional testing of a large-ish > application. Sometimes we find bugs that may take some time to be > resolved, a few days, a few weeks. Once the bug is identified, I don't > want to see it failing the nightly builds, day after day. > > pending() might be useful here, as I can say: > > pending("Bug 12345 being fixed") > > But then I would have to wrap this in some conditional logic that > tests if the bug is actually fixed. > > But, what if pending took a block: > > pending("Bug 12345 being fixed") do > actual.should == expected > end > > and pending would fail (not with a pending exception) once the code > inside the block started passing? > > That way we could mark something as a know issue, and be notified when > that thing was fixed and go removed the pending. > > Thoughts? > > - Bob > _______________________________________________ > rspec-devel mailing list > rspec-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-devel > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/rspec-devel/attachments/20070627/c554a015/attachment.html From aslak.hellesoy at gmail.com Wed Jun 27 11:10:09 2007 From: aslak.hellesoy at gmail.com (aslak hellesoy) Date: Wed, 27 Jun 2007 17:10:09 +0200 Subject: [rspec-devel] Should all teardown blocks run regardless of error? Message-ID: <8d961d900706270810j6a46d82anf820066565fe5144@mail.gmail.com> I was just bitten by some unexpected behaviour. Look at the following spec. Spec::Runner.configure do |config| config.after(:each) do puts "C" end end describe "examples and teardowns" do it "should all run" do puts "A" end after(:each) do puts "B" raise "oh no" end end I would have expected to see: A B C But in fact I see: A B The last (global) teardown doesn't get run - the first teardown block raising an error causes the other ones to not be run at all. This seems inconsistent to me - if an example fails, the (first) teardown will still run. I'd like to change this so that all teardowns get run, even if previous ones fail (likewise for multiple setups). Does anyone have any objections to that? Aslak From aslak.hellesoy at gmail.com Wed Jun 27 11:11:47 2007 From: aslak.hellesoy at gmail.com (aslak hellesoy) Date: Wed, 27 Jun 2007 17:11:47 +0200 Subject: [rspec-devel] new pending feature (pending release) In-Reply-To: <46827BCC.1090101@tastapod.com> References: <57c63afe0706230901x72f06fcck5b3cd64f43f85912@mail.gmail.com> <46827BCC.1090101@tastapod.com> Message-ID: <8d961d900706270811t4ee60528p2037db1dca22c412@mail.gmail.com> On 6/27/07, Dan North wrote: > > I think that's brilliant! Especially that the pending fails when the block > works, so you have to remove the pending block before you can check in. > > Mind if I steal it for rbehave? > Of course not :0) Aslak > > > Bob Cotton wrote: > "David Chelimsky" writes: > > > > I just added a new "pending" feature. It's in trunk (rev 2118+) and > will be part of the 1.0.6 release (*probably* within the next week). > > Read all about it: > http://blog.davidchelimsky.net/articles/2007/06/23/pending-insert-reason-here > > A very nice feature. > > Here's a twist to consider: > > We use rspec for functional testing of a large-ish > application. Sometimes we find bugs that may take some time to be > resolved, a few days, a few weeks. Once the bug is identified, I don't > want to see it failing the nightly builds, day after day. > > pending() might be useful here, as I can say: > > pending("Bug 12345 being fixed") > > But then I would have to wrap this in some conditional logic that > tests if the bug is actually fixed. > > But, what if pending took a block: > > pending("Bug 12345 being fixed") do > actual.should == expected > end > > and pending would fail (not with a pending exception) once the code > inside the block started passing? > > That way we could mark something as a know issue, and be notified when > that thing was fixed and go removed the pending. > > Thoughts? > > - Bob > _______________________________________________ > rspec-devel mailing list > rspec-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-devel > > > > _______________________________________________ > rspec-devel mailing list > rspec-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-devel > From aslak.hellesoy at gmail.com Wed Jun 27 11:13:59 2007 From: aslak.hellesoy at gmail.com (aslak hellesoy) Date: Wed, 27 Jun 2007 17:13:59 +0200 Subject: [rspec-devel] Should all teardown blocks run regardless of error? In-Reply-To: <8d961d900706270810j6a46d82anf820066565fe5144@mail.gmail.com> References: <8d961d900706270810j6a46d82anf820066565fe5144@mail.gmail.com> Message-ID: <8d961d900706270813o76a3f1a5q437a4b05e4c1dae7@mail.gmail.com> Old words die hard. I meant *after* blocks, not teardown ;-) On 6/27/07, aslak hellesoy wrote: > I was just bitten by some unexpected behaviour. Look at the following spec. > > Spec::Runner.configure do |config| > config.after(:each) do > puts "C" > end > end > > describe "examples and teardowns" do > it "should all run" do > puts "A" > end > > after(:each) do > puts "B" > raise "oh no" > end > end > > I would have expected to see: > > A > B > C > > But in fact I see: > > A > B > > The last (global) teardown doesn't get run - the first teardown block > raising an error causes the other ones to not be run at all. This > seems inconsistent to me - if an example fails, the (first) teardown > will still run. > > I'd like to change this so that all teardowns get run, even if > previous ones fail (likewise for multiple setups). Does anyone have > any objections to that? > > Aslak > From dan at tastapod.com Wed Jun 27 11:24:39 2007 From: dan at tastapod.com (Dan North) Date: Wed, 27 Jun 2007 16:24:39 +0100 Subject: [rspec-devel] integration testing/rspec/rbehave In-Reply-To: <57c63afe0706231350y211ddb14r5c6710f5012d31cd@mail.gmail.com> References: <57c63afe0706231350y211ddb14r5c6710f5012d31cd@mail.gmail.com> Message-ID: <46828137.7030304@tastapod.com> Thanks for the mention David. I'm very excited about the idea of rspec+rbehave becoming a killer stack for integration/acceptance testing and full "outside-in" BDD. Having said that, I don't know nearly enough about rails or the rails/rspec integration points. I've lurked on this list for some time now, and I have noticed that a lot of the issues in the tracker are about rails integration. I would really appreciate any help from the people on this list to help bring that richness of integration into rbehave. To reiterate what David said, please feel free to contact me directly or join the rbehave-devel list if you are interested in helping out. I'm away until mid-July, but I'll be in touch then. In the meantime please feel free to gem install rbehave and take it for a spin. Thanks, Dan David Chelimsky wrote: > Hi all, > > Dan North has released rbehave: > http://dannorth.net/2007/06/introducing-rbehave, > http://rubyforge.org/projects/rbehave/. He used rspec to describe it, > and it actually uses rspec's expectation library to express the > details. The idea is that while rspec excels at expressing object > behaviour, rbehave is targeted at story level behaviour. By using > rspec expectations for both there's very little context shifting for > developers who use both tools on the same project. The only real > difference is in how object-specific examples are structured in rspec > vs stories and scenarios in rbehave. > > With that context, there is one big thing missing from our BDD/Rails > toolset, and that is pure ruby rails integration testing. I'd like to > propose that we focus on getting that support into rbehave. If any of > you are interested in contributing to this effort, please join the > rbehave-devel list (http://rubyforge.org/mail/?group_id=1475) and let > Dan know. > > Thanks, > David > _______________________________________________ > rspec-devel mailing list > rspec-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-devel > From dchelimsky at gmail.com Wed Jun 27 12:00:19 2007 From: dchelimsky at gmail.com (David Chelimsky) Date: Wed, 27 Jun 2007 11:00:19 -0500 Subject: [rspec-devel] new pending feature (pending release) In-Reply-To: <8d961d900706270811t4ee60528p2037db1dca22c412@mail.gmail.com> References: <57c63afe0706230901x72f06fcck5b3cd64f43f85912@mail.gmail.com> <46827BCC.1090101@tastapod.com> <8d961d900706270811t4ee60528p2037db1dca22c412@mail.gmail.com> Message-ID: <57c63afe0706270900w78a77306k1c08521bc0697703@mail.gmail.com> On 6/27/07, aslak hellesoy wrote: > On 6/27/07, Dan North wrote: > > > > I think that's brilliant! Especially that the pending fails when the block > > works, so you have to remove the pending block before you can check in. > > > > Mind if I steal it for rbehave? Why steal it? Just use it! You're already requiring parts of rspec, just require the necessary parts for this too :) If that's too complex, let me know and I'll make it so you can do something like require 'spec/expectations/pending' or something like that. David > > > > Of course not :0) > > Aslak > > > > > > > Bob Cotton wrote: > > "David Chelimsky" writes: > > > > > > > > I just added a new "pending" feature. It's in trunk (rev 2118+) and > > will be part of the 1.0.6 release (*probably* within the next week). > > > > Read all about it: > > http://blog.davidchelimsky.net/articles/2007/06/23/pending-insert-reason-here > > > > A very nice feature. > > > > Here's a twist to consider: > > > > We use rspec for functional testing of a large-ish > > application. Sometimes we find bugs that may take some time to be > > resolved, a few days, a few weeks. Once the bug is identified, I don't > > want to see it failing the nightly builds, day after day. > > > > pending() might be useful here, as I can say: > > > > pending("Bug 12345 being fixed") > > > > But then I would have to wrap this in some conditional logic that > > tests if the bug is actually fixed. > > > > But, what if pending took a block: > > > > pending("Bug 12345 being fixed") do > > actual.should == expected > > end > > > > and pending would fail (not with a pending exception) once the code > > inside the block started passing? > > > > That way we could mark something as a know issue, and be notified when > > that thing was fixed and go removed the pending. > > > > Thoughts? > > > > - Bob > > _______________________________________________ > > rspec-devel mailing list > > rspec-devel at rubyforge.org > > http://rubyforge.org/mailman/listinfo/rspec-devel > > > > > > > > _______________________________________________ > > rspec-devel mailing list > > rspec-devel at rubyforge.org > > http://rubyforge.org/mailman/listinfo/rspec-devel > > > _______________________________________________ > rspec-devel mailing list > rspec-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-devel > From dchelimsky at gmail.com Wed Jun 27 12:01:12 2007 From: dchelimsky at gmail.com (David Chelimsky) Date: Wed, 27 Jun 2007 11:01:12 -0500 Subject: [rspec-devel] Should all teardown blocks run regardless of error? In-Reply-To: <8d961d900706270813o76a3f1a5q437a4b05e4c1dae7@mail.gmail.com> References: <8d961d900706270810j6a46d82anf820066565fe5144@mail.gmail.com> <8d961d900706270813o76a3f1a5q437a4b05e4c1dae7@mail.gmail.com> Message-ID: <57c63afe0706270901y4f4df3aco5d390cbe54a6ea5e@mail.gmail.com> On 6/27/07, aslak hellesoy wrote: > Old words die hard. I meant *after* blocks, not teardown ;-) > > On 6/27/07, aslak hellesoy wrote: > > I was just bitten by some unexpected behaviour. Look at the following spec. > > > > Spec::Runner.configure do |config| > > config.after(:each) do > > puts "C" > > end > > end > > > > describe "examples and teardowns" do > > it "should all run" do > > puts "A" > > end > > > > after(:each) do > > puts "B" > > raise "oh no" > > end > > end > > > > I would have expected to see: > > > > A > > B > > C > > > > But in fact I see: > > > > A > > B > > > > The last (global) teardown doesn't get run - the first teardown block > > raising an error causes the other ones to not be run at all. This > > seems inconsistent to me - if an example fails, the (first) teardown > > will still run. > > > > I'd like to change this so that all teardowns get run, even if > > previous ones fail (likewise for multiple setups). Does anyone have > > any objections to that? +1 (no objection) > > > > Aslak > > > _______________________________________________ > rspec-devel mailing list > rspec-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-devel > From bob.cotton at rallydev.com Wed Jun 27 13:04:29 2007 From: bob.cotton at rallydev.com (Bob Cotton) Date: Wed, 27 Jun 2007 11:04:29 -0600 Subject: [rspec-devel] [ rspec-Patches-11868 ] Add ability for pending to optionally hold a failing block and to fail when it passes In-Reply-To: <57c63afe0706270450rd9c40abh3f8a7d230c9ba968@mail.gmail.com> (David Chelimsky's message of "Wed, 27 Jun 2007 06:50:28 -0500") References: <20070627011519.8C53F5240C1F@rubyforge.org> <57c63afe0706262019i660a21d0hdb03b092aef50d57@mail.gmail.com> <8d961d900706270448t2218e2aex187d070197d84c26@mail.gmail.com> <57c63afe0706270450rd9c40abh3f8a7d230c9ba968@mail.gmail.com> Message-ID: "David Chelimsky" writes: > On 6/27/07, aslak hellesoy wrote: >> On 6/27/07, Bob Cotton wrote: >> > "David Chelimsky" writes: >> > >> > > On 6/26/07, Bob Cotton wrote: >> > >> writes: >> > >> >> > >> >>Comment By: David Chelimsky (dchelimsky) >> > >> > Date: 2007-06-27 01:15 >> > >> > >> > >> > Message: >> > >> > Applied to r2133. >> > >> > >> > >> > FYI - thank you for submitting all 4 formatted html >> > >> > files. Unfortunately, I couldn't use them because they require the >> > >> > syntax gem to get the syntax highlighting to work. Everything else >> > >> > looks great though. >> > >> >> > >> Good to know. I'll install that gem also. >> > >> >> > >> Do you have an automated way to create all those files? >> > > >> > > I don't - do you? >> > >> > Nope. >> > >> >> What we usually do is to uncomment the line in html_formatter_spec.rb >> that writes the file to disk, eyeball the diff and eyeball the html in >> a browser to see that everything still looks good, then comment out >> the line again. > > I think the question was about automating the process for all 4 > versions of ruby we're supporting. Bob had included them in the patch, > so I imagine he already figured out how to generate them one at a > time. Bob? By hand. I ran the specs 4 times, one for each version. I used the directions in spec/README.jruby for JRuby. I had installed the 'other' version of ruby in /usr/local/ruby-, then installed rubygems into each of those locations, and installed rake and diff-lcs into each. Seems I missed syntax. then I ran /usr/local/ruby-/bin/ruby bin/spec spec -c from the rspec/rspec dir for each version. Of course I had uncommented the File.open before this. I was looking at multiruby from ZenTest, it takes care of auto installing multiple versions of ruby, with rubygems. That might be hacked to do what we need. jruby is still an odd-ball. - Bob > >> >> Aslak >> >> > > >> > >> >> > >> - Bob >> > >> _______________________________________________ >> > >> rspec-devel mailing list >> > >> rspec-devel at rubyforge.org >> > >> http://rubyforge.org/mailman/listinfo/rspec-devel >> > >> >> > > _______________________________________________ >> > > rspec-devel mailing list >> > > rspec-devel at rubyforge.org >> > > http://rubyforge.org/mailman/listinfo/rspec-devel >> > _______________________________________________ >> > rspec-devel mailing list >> > rspec-devel at rubyforge.org >> > http://rubyforge.org/mailman/listinfo/rspec-devel >> > >> _______________________________________________ >> rspec-devel mailing list >> rspec-devel at rubyforge.org >> http://rubyforge.org/mailman/listinfo/rspec-devel >> > _______________________________________________ > rspec-devel mailing list > rspec-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-devel From bob.cotton at rallydev.com Wed Jun 27 13:13:27 2007 From: bob.cotton at rallydev.com (Bob Cotton) Date: Wed, 27 Jun 2007 11:13:27 -0600 Subject: [rspec-devel] new pending feature (pending release) In-Reply-To: <57c63afe0706270900w78a77306k1c08521bc0697703@mail.gmail.com> (David Chelimsky's message of "Wed, 27 Jun 2007 11:00:19 -0500") References: <57c63afe0706230901x72f06fcck5b3cd64f43f85912@mail.gmail.com> <46827BCC.1090101@tastapod.com> <8d961d900706270811t4ee60528p2037db1dca22c412@mail.gmail.com> <57c63afe0706270900w78a77306k1c08521bc0697703@mail.gmail.com> Message-ID: "David Chelimsky" writes: > On 6/27/07, aslak hellesoy wrote: >> On 6/27/07, Dan North wrote: >> > >> > I think that's brilliant! Especially that the pending fails when the block >> > works, so you have to remove the pending block before you can check in. >> > >> > Mind if I steal it for rbehave? > > Why steal it? Just use it! You're already requiring parts of rspec, > just require the necessary parts for this too :) This is something that's been kicking around in the back of my mind since I saw the rbehave announcement. Wasn't really sure where to bring it up, here or on the rbehave dev list. Seems there's a larger audience here, so here goes.... I can see some potential with the rbehave syntax, but over the last few months I've spent quite some time submitting patches to rspec to make it usable for functional testing: namely context_setup (which was renamed to before(:all)) and shared behaviors. Those combined with the rich formatter framework and it's going to be a while before rbehave catches up these regards, at least for us. Is there any way to combine the two projects so that describe/it and story/scenario/given/when/then are just alternative DSLs in a larger framework? - Bob > > If that's too complex, let me know and I'll make it so you can do > something like require 'spec/expectations/pending' or something like > that. > > David > >> > >> >> Of course not :0) >> >> Aslak >> >> > >> > >> > Bob Cotton wrote: >> > "David Chelimsky" writes: >> > >> > >> > >> > I just added a new "pending" feature. It's in trunk (rev 2118+) and >> > will be part of the 1.0.6 release (*probably* within the next week). >> > >> > Read all about it: >> > http://blog.davidchelimsky.net/articles/2007/06/23/pending-insert-reason-here >> > >> > A very nice feature. >> > >> > Here's a twist to consider: >> > >> > We use rspec for functional testing of a large-ish >> > application. Sometimes we find bugs that may take some time to be >> > resolved, a few days, a few weeks. Once the bug is identified, I don't >> > want to see it failing the nightly builds, day after day. >> > >> > pending() might be useful here, as I can say: >> > >> > pending("Bug 12345 being fixed") >> > >> > But then I would have to wrap this in some conditional logic that >> > tests if the bug is actually fixed. >> > >> > But, what if pending took a block: >> > >> > pending("Bug 12345 being fixed") do >> > actual.should == expected >> > end >> > >> > and pending would fail (not with a pending exception) once the code >> > inside the block started passing? >> > >> > That way we could mark something as a know issue, and be notified when >> > that thing was fixed and go removed the pending. >> > >> > Thoughts? >> > >> > - Bob >> > _______________________________________________ >> > rspec-devel mailing list >> > rspec-devel at rubyforge.org >> > http://rubyforge.org/mailman/listinfo/rspec-devel >> > >> > >> > >> > _______________________________________________ >> > rspec-devel mailing list >> > rspec-devel at rubyforge.org >> > http://rubyforge.org/mailman/listinfo/rspec-devel >> > >> _______________________________________________ >> rspec-devel mailing list >> rspec-devel at rubyforge.org >> http://rubyforge.org/mailman/listinfo/rspec-devel >> > _______________________________________________ > rspec-devel mailing list > rspec-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-devel From noreply at rubyforge.org Wed Jun 27 13:13:41 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Wed, 27 Jun 2007 13:13:41 -0400 (EDT) Subject: [rspec-devel] [ rspec-Patches-11888 ] rspec_on_rails spews out warnings when assert_select is used with an XML response Message-ID: <20070627171341.376595240B1F@rubyforge.org> Patches item #11888, was opened at 2007-06-27 17:13 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3151&aid=11888&group_id=797 Category: rails plugin Group: None Status: Open Resolution: None Priority: 3 Submitted By: Ian Leitch (idl) Assigned to: Nobody (None) Summary: rspec_on_rails spews out warnings when assert_select is used with an XML response Initial Comment: The warning: ignoring attempt to close channel with link opened at byte 61, line 3 closed at byte 141, line 5 attributes at open: {} text around open: "ss version=\2.0\>\n \n \n References: <8d961d900706270810j6a46d82anf820066565fe5144@mail.gmail.com> <8d961d900706270813o76a3f1a5q437a4b05e4c1dae7@mail.gmail.com> Message-ID: <4682AEEF.6010009@tastapod.com> I agree completely. Whenever I implement or override tearDown in a junit testcase, I use this template: try { // my teardown stuff } finally { super.tearDown(); } aslak hellesoy wrote: > Old words die hard. I meant *after* blocks, not teardown ;-) > > On 6/27/07, aslak hellesoy wrote: > >> I was just bitten by some unexpected behaviour. Look at the following spec. >> >> Spec::Runner.configure do |config| >> config.after(:each) do >> puts "C" >> end >> end >> >> describe "examples and teardowns" do >> it "should all run" do >> puts "A" >> end >> >> after(:each) do >> puts "B" >> raise "oh no" >> end >> end >> >> I would have expected to see: >> >> A >> B >> C >> >> But in fact I see: >> >> A >> B >> >> The last (global) teardown doesn't get run - the first teardown block >> raising an error causes the other ones to not be run at all. This >> seems inconsistent to me - if an example fails, the (first) teardown >> will still run. >> >> I'd like to change this so that all teardowns get run, even if >> previous ones fail (likewise for multiple setups). Does anyone have >> any objections to that? >> >> Aslak >> >> > _______________________________________________ > rspec-devel mailing list > rspec-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-devel > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/rspec-devel/attachments/20070627/0af326a6/attachment.html From dan at tastapod.com Wed Jun 27 14:40:15 2007 From: dan at tastapod.com (Dan North) Date: Wed, 27 Jun 2007 19:40:15 +0100 Subject: [rspec-devel] new pending feature (pending release) In-Reply-To: <57c63afe0706270900w78a77306k1c08521bc0697703@mail.gmail.com> References: <57c63afe0706230901x72f06fcck5b3cd64f43f85912@mail.gmail.com> <46827BCC.1090101@tastapod.com> <8d961d900706270811t4ee60528p2037db1dca22c412@mail.gmail.com> <57c63afe0706270900w78a77306k1c08521bc0697703@mail.gmail.com> Message-ID: <4682AF0F.1090809@tastapod.com> Hmm, actually it would probably make sense to use rspec exceptions in the equivalent places. Good thinking! David Chelimsky wrote: > On 6/27/07, aslak hellesoy wrote: > >> On 6/27/07, Dan North wrote: >> >>> I think that's brilliant! Especially that the pending fails when the block >>> works, so you have to remove the pending block before you can check in. >>> >>> Mind if I steal it for rbehave? >>> > > Why steal it? Just use it! You're already requiring parts of rspec, > just require the necessary parts for this too :) > > If that's too complex, let me know and I'll make it so you can do > something like require 'spec/expectations/pending' or something like > that. > > David > > >> Of course not :0) >> >> Aslak >> >> >>> Bob Cotton wrote: >>> "David Chelimsky" writes: >>> >>> >>> >>> I just added a new "pending" feature. It's in trunk (rev 2118+) and >>> will be part of the 1.0.6 release (*probably* within the next week). >>> >>> Read all about it: >>> http://blog.davidchelimsky.net/articles/2007/06/23/pending-insert-reason-here >>> >>> A very nice feature. >>> >>> Here's a twist to consider: >>> >>> We use rspec for functional testing of a large-ish >>> application. Sometimes we find bugs that may take some time to be >>> resolved, a few days, a few weeks. Once the bug is identified, I don't >>> want to see it failing the nightly builds, day after day. >>> >>> pending() might be useful here, as I can say: >>> >>> pending("Bug 12345 being fixed") >>> >>> But then I would have to wrap this in some conditional logic that >>> tests if the bug is actually fixed. >>> >>> But, what if pending took a block: >>> >>> pending("Bug 12345 being fixed") do >>> actual.should == expected >>> end >>> >>> and pending would fail (not with a pending exception) once the code >>> inside the block started passing? >>> >>> That way we could mark something as a know issue, and be notified when >>> that thing was fixed and go removed the pending. >>> >>> Thoughts? >>> >>> - Bob >>> _______________________________________________ >>> rspec-devel mailing list >>> rspec-devel at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/rspec-devel >>> >>> >>> >>> _______________________________________________ >>> rspec-devel mailing list >>> rspec-devel at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/rspec-devel >>> >>> >> _______________________________________________ >> rspec-devel mailing list >> rspec-devel at rubyforge.org >> http://rubyforge.org/mailman/listinfo/rspec-devel >> >> > _______________________________________________ > rspec-devel mailing list > rspec-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-devel > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/rspec-devel/attachments/20070627/82c5e68d/attachment.html From dchelimsky at gmail.com Wed Jun 27 15:14:05 2007 From: dchelimsky at gmail.com (David Chelimsky) Date: Wed, 27 Jun 2007 14:14:05 -0500 Subject: [rspec-devel] new pending feature (pending release) In-Reply-To: References: <57c63afe0706230901x72f06fcck5b3cd64f43f85912@mail.gmail.com> <46827BCC.1090101@tastapod.com> <8d961d900706270811t4ee60528p2037db1dca22c412@mail.gmail.com> <57c63afe0706270900w78a77306k1c08521bc0697703@mail.gmail.com> Message-ID: <57c63afe0706271214g6e24f6d7j95f3998af179969a@mail.gmail.com> On 6/27/07, Bob Cotton wrote: > "David Chelimsky" writes: > > > On 6/27/07, aslak hellesoy wrote: > >> On 6/27/07, Dan North wrote: > >> > > >> > I think that's brilliant! Especially that the pending fails when the block > >> > works, so you have to remove the pending block before you can check in. > >> > > >> > Mind if I steal it for rbehave? > > > > Why steal it? Just use it! You're already requiring parts of rspec, > > just require the necessary parts for this too :) > > This is something that's been kicking around in the back of my mind > since I saw the rbehave announcement. Wasn't really sure where to > bring it up, here or on the rbehave dev list. Seems there's a larger > audience here, so here goes.... > > I can see some potential with the rbehave syntax, but over the last > few months I've spent quite some time submitting patches to rspec to > make it usable for functional testing: namely context_setup (which was > renamed to before(:all)) and shared behaviors. > > Those combined with the rich formatter framework and it's going to be > a while before rbehave catches up these regards, at least for us. > > Is there any way to combine the two projects so that describe/it and > story/scenario/given/when/then are just alternative DSLs in a larger > framework? When there's a will ... There are some differences that make merging the projects not necessarily that helpful BUT rbehave does use rspec expecations (should and matchers) and Dan and I are talking about extracting some of the reporting functionality. We'll keep you posted. > > - Bob > > > > > If that's too complex, let me know and I'll make it so you can do > > something like require 'spec/expectations/pending' or something like > > that. > > > > David > > > >> > > >> > >> Of course not :0) > >> > >> Aslak > >> > >> > > >> > > >> > Bob Cotton wrote: > >> > "David Chelimsky" writes: > >> > > >> > > >> > > >> > I just added a new "pending" feature. It's in trunk (rev 2118+) and > >> > will be part of the 1.0.6 release (*probably* within the next week). > >> > > >> > Read all about it: > >> > http://blog.davidchelimsky.net/articles/2007/06/23/pending-insert-reason-here > >> > > >> > A very nice feature. > >> > > >> > Here's a twist to consider: > >> > > >> > We use rspec for functional testing of a large-ish > >> > application. Sometimes we find bugs that may take some time to be > >> > resolved, a few days, a few weeks. Once the bug is identified, I don't > >> > want to see it failing the nightly builds, day after day. > >> > > >> > pending() might be useful here, as I can say: > >> > > >> > pending("Bug 12345 being fixed") > >> > > >> > But then I would have to wrap this in some conditional logic that > >> > tests if the bug is actually fixed. > >> > > >> > But, what if pending took a block: > >> > > >> > pending("Bug 12345 being fixed") do > >> > actual.should == expected > >> > end > >> > > >> > and pending would fail (not with a pending exception) once the code > >> > inside the block started passing? > >> > > >> > That way we could mark something as a know issue, and be notified when > >> > that thing was fixed and go removed the pending. > >> > > >> > Thoughts? > >> > > >> > - Bob > >> > _______________________________________________ > >> > rspec-devel mailing list > >> > rspec-devel at rubyforge.org > >> > http://rubyforge.org/mailman/listinfo/rspec-devel > >> > > >> > > >> > > >> > _______________________________________________ > >> > rspec-devel mailing list > >> > rspec-devel at rubyforge.org > >> > http://rubyforge.org/mailman/listinfo/rspec-devel > >> > > >> _______________________________________________ > >> rspec-devel mailing list > >> rspec-devel at rubyforge.org > >> http://rubyforge.org/mailman/listinfo/rspec-devel > >> > > _______________________________________________ > > rspec-devel mailing list > > rspec-devel at rubyforge.org > > http://rubyforge.org/mailman/listinfo/rspec-devel > _______________________________________________ > rspec-devel mailing list > rspec-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-devel > From noreply at rubyforge.org Wed Jun 27 15:45:08 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Wed, 27 Jun 2007 15:45:08 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11891 ] script/generate rspec_controller fails to create appropriate views (from templates) on edge rails Message-ID: <20070627194508.CAA075240B1F@rubyforge.org> Bugs item #11891, was opened at 2007-06-27 15:45 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11891&group_id=797 Category: rails plugin Group: None Status: Open Resolution: None Priority: 3 Submitted By: George Anderson (caton) Assigned to: Nobody (None) Summary: script/generate rspec_controller fails to create appropriate views (from templates) on edge rails Initial Comment: Mac OSX 10.4.9 edge rails: r7126 rspec (plugin): r2082 rspec_on_rails: r2081 Views couldn't be generated by script/generate rspec_controller ... $ script/generate rspec_controller patient_base index face_sheet patient_messages rx chart_timeline archive chart_note flow_sheet hist ory hospital lab_results radiology x_ray exists app/controllers/ exists app/helpers/ create app/views/patient_base exists spec/controllers/ exists spec/helpers/ create spec/views/patient_base create spec/controllers/patient_base_controller_spec.rb create spec/helpers/patient_base_helper_spec.rb create app/controllers/patient_base_controller.rb create app/helpers/patient_base_helper.rb create spec/views/patient_base/index_view_spec.rb create app/views/patient_base/index.rhtml No such file or directory - /Users/george/work/one_box/vendor/rails/railties/lib/rails_generator/generators/components/controller/templates/view.rhtml railties/lib/rails_generator/generators/components/controller/templates/view.html changed to view.html.erb as of r6690 (roughly 2 months ago). See: http://dev.rubyonrails.org/browser/trunk/railties/lib/rails_generator/generators/components/controller/templates Rails 1.2 STABLE should use view.rhtml (See: http://dev.rubyonrails.org/browser/branches/1-2-stable/railties/lib/rails_generator/generators/components/controller/templates) So perhaps this ticket is premature. Consider, however, the *.html.erb style will eventually be in the STABLE release. At that time, RSpec may have to deal with the *old* and *new* style templates. For those of you reading this far, and not feeling you have suffient RSpec-fu to create a patch for this (myself included among you), consider this workaround: $ script/generate rspec_controller patient_base index this will throw the error herein described, but just lop off the "rspec_" bit and run: $ script/generate controller patient_base index Most of the files will be identical, but the *.html.erb-style templates will generate as expected. For bonus points, clean up the test::unit cruft thusly: $ rm test/functional/patient_base_controller_test.rb Thx. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11891&group_id=797 From noreply at rubyforge.org Thu Jun 28 05:39:26 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Thu, 28 Jun 2007 05:39:26 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11903 ] config.include with behaviour_type 'hash' does not work Message-ID: <20070628093926.9EE5A5240AC2@rubyforge.org> Bugs item #11903, was opened at 2007-06-28 11:39 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11903&group_id=797 Category: runner module Group: None Status: Open Resolution: None Priority: 3 Submitted By: Jochen Kramer (freetwix) Assigned to: Nobody (None) Summary: config.include with behaviour_type 'hash' does not work Initial Comment: module My module ViewSpecHelper def dude_me end end end Spec::Runner.configure do |config| config.include(My::ViewSpecHelper, :behaviour_type => :view) end throws an Exception: rspec/lib/spec/dsl/behaviour.rb:151:in `include': wrong argument type Hash (expected Module) (TypeError) from ... Reproduce this bug by copying the above code snippet into the spec_helper. Thanks for providing RSpec, though. Jochen and Thorsten ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11903&group_id=797 From noreply at rubyforge.org Thu Jun 28 09:19:31 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Thu, 28 Jun 2007 09:19:31 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11903 ] config.include with behaviour_type 'hash' does not work Message-ID: <20070628131931.C26015240AE5@rubyforge.org> Bugs item #11903, was opened at 2007-06-28 05:39 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11903&group_id=797 Category: runner module Group: None Status: Open >Resolution: Accepted >Priority: 4 Submitted By: Jochen Kramer (freetwix) >Assigned to: Aslak Helles?y (aslak_hellesoy) Summary: config.include with behaviour_type 'hash' does not work Initial Comment: module My module ViewSpecHelper def dude_me end end end Spec::Runner.configure do |config| config.include(My::ViewSpecHelper, :behaviour_type => :view) end throws an Exception: rspec/lib/spec/dsl/behaviour.rb:151:in `include': wrong argument type Hash (expected Module) (TypeError) from ... Reproduce this bug by copying the above code snippet into the spec_helper. Thanks for providing RSpec, though. Jochen and Thorsten ---------------------------------------------------------------------- >Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-06-28 09:19 Message: I've checked in a pending spec that reproduces this in RSpec core. I know how to fix the bug, but it might involve a little more coding than 10 minutes. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11903&group_id=797 From noreply at rubyforge.org Thu Jun 28 10:24:01 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Thu, 28 Jun 2007 10:24:01 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11903 ] config.include with behaviour_type 'hash' does not work Message-ID: <20070628142401.D85905240ACD@rubyforge.org> Bugs item #11903, was opened at 2007-06-28 05:39 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11903&group_id=797 Category: runner module Group: None >Status: Closed Resolution: Accepted Priority: 4 Submitted By: Jochen Kramer (freetwix) Assigned to: Aslak Helles?y (aslak_hellesoy) Summary: config.include with behaviour_type 'hash' does not work Initial Comment: module My module ViewSpecHelper def dude_me end end end Spec::Runner.configure do |config| config.include(My::ViewSpecHelper, :behaviour_type => :view) end throws an Exception: rspec/lib/spec/dsl/behaviour.rb:151:in `include': wrong argument type Hash (expected Module) (TypeError) from ... Reproduce this bug by copying the above code snippet into the spec_helper. Thanks for providing RSpec, though. Jochen and Thorsten ---------------------------------------------------------------------- >Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-06-28 10:24 Message: Fixed in r2149 ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-06-28 09:19 Message: I've checked in a pending spec that reproduces this in RSpec core. I know how to fix the bug, but it might involve a little more coding than 10 minutes. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11903&group_id=797 From noreply at rubyforge.org Thu Jun 28 10:37:59 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Thu, 28 Jun 2007 10:37:59 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11584 ] Different results for 'rspec' and 'rcov' task in handling hashes. Message-ID: <20070628143759.A0EBF5240ACD@rubyforge.org> Bugs item #11584, was opened at 2007-06-14 18:05 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11584&group_id=797 Category: expectation module Group: None >Status: Closed >Resolution: Rejected Priority: 3 Submitted By: Christian Kebekus (ckatorial) Assigned to: Nobody (None) Summary: Different results for 'rspec' and 'rcov' task in handling hashes. Initial Comment: There seems to be a difference between running the spec and the rcov task. As much as I can figure, the access to a hash is not consistent. The spec task returns/iterates through the hash the expected way, while the rcov task does not. = Example See attached file for example. $ rake spec (in /Temp) . Finished in 0.019277 seconds 1 example, 0 failures $ rake rcov (in /Temp) F 1) Spec::Mocks::MockExpectationError in 'The Business Unit Filter with Single Filter Condition should not filter patient with matching only partial fields of business unit' Mock 'patient business unit' expected :key with (any args) once, but received it 0 times ./spec/filters/business_unit_filter_spec.rb:8: Finished in 0.008152 seconds 1 example, 1 failure = Environment $ ruby --version ruby 1.8.6 (2007-03-13 patchlevel 0) [i686-darwin8.9.1] $ gem -v 0.9.4 $ rake --version rake, version 0.7.3 $ gem list | grep rspec rspec (1.0.5) RSpec-1.0.5 (r2081) - BDD for Ruby http://rspec.rubyforge.org/ $ gem list | grep rcov rcov (0.8.0.2) ---------------------------------------------------------------------- >Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-06-28 10:37 Message: Ruby iterates over elements in a Hash in an arbitrary order. If things behave differently with and without RCov it only means that this arbitraryness has bitten you. It has nothing to do with RSpec. Your spec is making unreasonable assumptions about Hash iteration ordering, that's all. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11584&group_id=797 From noreply at rubyforge.org Thu Jun 28 11:57:25 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Thu, 28 Jun 2007 11:57:25 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-10577 ] Rails with Oracle breaks 0.9.2 Message-ID: <20070628155726.059D95240AB0@rubyforge.org> Bugs item #10577, was opened at 2007-05-04 21:27 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=10577&group_id=797 Category: rails plugin Group: None Status: Open Resolution: None Priority: 3 Submitted By: John Andrews (jandrews) Assigned to: Nobody (None) Summary: Rails with Oracle breaks 0.9.2 Initial Comment: Upgrading to rspec 0.9.2 from 0.8.2 using Oracle database with ActiveRecord breaks due to the following: oracle_adapter.rb:316 (owner, table_name) = @connection.describe(table_name) @connection is an instance of OCI8AutoRecover which itself delegates the describe method to OCI8. class OCI8AutoRecover < DelegateClass(OCI8) #... # no def describe method end DelegateClass internally uses method_missing to call the delegate class' describe class OCI8 #:nodoc: def describe(name) #... end #... end The problem is that rspec defines Kernel#describe, so method_missing never catches the call to delegate and it fails from rspec because there is obviously no block given. My work-around modifies 2 files. I will just include the methods I changed because I don't have diffs from trunk. from file: rspec_on_rails/lib/spec/rails/extensions/kernel.rb def describe(*args, &block) # assuming that if a block is not given that it is not a call # for rspec if block_given? args << {} unless Hash === args.last args.last[:spec_path] = caller(0)[1] end original_describe(*args, &block) end from file: rspec-0.9.2/lib/spec/runner/extensions/kernel.rb def describe(*args, &block) if block_given? raise ArgumentError if args.empty? register_behaviour(Spec::DSL::BehaviourFactory.create(*args, &block)) else # not the describe that we are looking for # it's probably a call from the oracle adapter super *args end end I don't know if this is the best way to fix the issue, but it works for me and all my specs pass again. if you need more info or someone to test a fix for Oracle I am able to help. ---------------------------------------------------------------------- Comment By: Venkatasubramaniyan K (venkat) Date: 2007-06-28 21:27 Message: Dear rspec team: I am also running into the same problem. I figured out the issue after a long debug session. I don't have any good solution for it. But I would appreciate a solution for this soon (even if it is a temp patch to begin with), so that we don't waste time debugging this. Yes, there could be other software affected by this but the specific Oracle issue at least needs to be resolved. Thanks, Venkat. ---------------------------------------------------------------------- Comment By: sinclair bain (sinclair) Date: 2007-06-01 23:55 Message: Hi, I just ran into this problem in rspec_for_rails 1.0.0. The solution I think we will settle for in the short term is a monkey patch to the OCI8AutoRecover class. The patch implements the #describe method in the OCI8AutoRecover class (via a module include). The patch file is in our rails_app/lib directory and is #required in the environment.rb. This is the implementation: module OracleAdapterPatch # rspec method name collision patch def describe(obj) puts "OCI8AutoRecover#describe( #{obj} ) forwarded to #{@connection}" @connection.describe(obj) end end OCI8AutoRecover.send(:include, OracleAdapterPatch) As is stated below this is (still) a band-aid approach. Cheers! sinclair ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-05-06 05:26 Message: I'm uncomfortable with this solution. It's a band-aid for this particular example, but someone else might come along and do something similar - using method_missing to delegate to another object WITH a block expected in that object's #describe method. Does anyone have any other suggestions? ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=10577&group_id=797 From noreply at rubyforge.org Thu Jun 28 12:12:36 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Thu, 28 Jun 2007 12:12:36 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-10577 ] Rails with Oracle breaks 0.9.2 Message-ID: <20070628161236.C90645240ADA@rubyforge.org> Bugs item #10577, was opened at 2007-05-04 10:57 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=10577&group_id=797 Category: rails plugin Group: None Status: Open Resolution: None Priority: 3 Submitted By: John Andrews (jandrews) Assigned to: Nobody (None) Summary: Rails with Oracle breaks 0.9.2 Initial Comment: Upgrading to rspec 0.9.2 from 0.8.2 using Oracle database with ActiveRecord breaks due to the following: oracle_adapter.rb:316 (owner, table_name) = @connection.describe(table_name) @connection is an instance of OCI8AutoRecover which itself delegates the describe method to OCI8. class OCI8AutoRecover < DelegateClass(OCI8) #... # no def describe method end DelegateClass internally uses method_missing to call the delegate class' describe class OCI8 #:nodoc: def describe(name) #... end #... end The problem is that rspec defines Kernel#describe, so method_missing never catches the call to delegate and it fails from rspec because there is obviously no block given. My work-around modifies 2 files. I will just include the methods I changed because I don't have diffs from trunk. from file: rspec_on_rails/lib/spec/rails/extensions/kernel.rb def describe(*args, &block) # assuming that if a block is not given that it is not a call # for rspec if block_given? args << {} unless Hash === args.last args.last[:spec_path] = caller(0)[1] end original_describe(*args, &block) end from file: rspec-0.9.2/lib/spec/runner/extensions/kernel.rb def describe(*args, &block) if block_given? raise ArgumentError if args.empty? register_behaviour(Spec::DSL::BehaviourFactory.create(*args, &block)) else # not the describe that we are looking for # it's probably a call from the oracle adapter super *args end end I don't know if this is the best way to fix the issue, but it works for me and all my specs pass again. if you need more info or someone to test a fix for Oracle I am able to help. ---------------------------------------------------------------------- Comment By: sinclair bain (sinclair) Date: 2007-06-28 11:12 Message: We have a patch for this: Save the following to your /lib directory in a file called e.g. oracle_adapter.rb --------------- # Rspec's dsl uses #describe as a method name at the core of its functionality # The oracle_adapter also uses #describe and the two clash. # Because rspec mixes-in the #describe method via the Kernel module all # Object instances (i.e. all objects) have a #describe method. # The oracle adpater uses a delegation model for some functionality via the # #method_missing mechanism. The #describe method is one of the methods which # _was_ missing when rspec was not around. However the mixin via Kernel changes # that thus _things_ do not function as intended (on the oracle side). # This patch hacks in the #describe method to where it was missing and then # delegates to the implementation. # #see # http://rubyforge.org/tracker/index.php?func=detail&aid=10577&group_id=797&atid=3149 module OracleAdapterPatch # rspec method name collision patch def describe(obj) # puts "OCI8AutoRecover#describe( #{obj} ) forwarded to #{@connection}" @connection.describe(obj) end end OCI8AutoRecover.send(:include, OracleAdapterPatch) ---------------------------- Edit as required. In your environment.rb for example add the following require 'oracle_adapter' which can be made conditional (or could this be a rspec rake task?) Cheers! sinclair rspec now functions ---------------------------------------------------------------------- Comment By: Venkatasubramaniyan K (venkat) Date: 2007-06-28 10:57 Message: Dear rspec team: I am also running into the same problem. I figured out the issue after a long debug session. I don't have any good solution for it. But I would appreciate a solution for this soon (even if it is a temp patch to begin with), so that we don't waste time debugging this. Yes, there could be other software affected by this but the specific Oracle issue at least needs to be resolved. Thanks, Venkat. ---------------------------------------------------------------------- Comment By: sinclair bain (sinclair) Date: 2007-06-01 13:25 Message: Hi, I just ran into this problem in rspec_for_rails 1.0.0. The solution I think we will settle for in the short term is a monkey patch to the OCI8AutoRecover class. The patch implements the #describe method in the OCI8AutoRecover class (via a module include). The patch file is in our rails_app/lib directory and is #required in the environment.rb. This is the implementation: module OracleAdapterPatch # rspec method name collision patch def describe(obj) puts "OCI8AutoRecover#describe( #{obj} ) forwarded to #{@connection}" @connection.describe(obj) end end OCI8AutoRecover.send(:include, OracleAdapterPatch) As is stated below this is (still) a band-aid approach. Cheers! sinclair ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-05-05 18:56 Message: I'm uncomfortable with this solution. It's a band-aid for this particular example, but someone else might come along and do something similar - using method_missing to delegate to another object WITH a block expected in that object's #describe method. Does anyone have any other suggestions? ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=10577&group_id=797 From noreply at rubyforge.org Thu Jun 28 12:45:51 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Thu, 28 Jun 2007 12:45:51 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11891 ] script/generate rspec_controller fails to create appropriate views (from templates) on edge rails Message-ID: <20070628164551.516BB5240ADA@rubyforge.org> Bugs item #11891, was opened at 2007-06-27 15:45 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11891&group_id=797 Category: rails plugin Group: None Status: Open Resolution: None Priority: 3 Submitted By: George Anderson (caton) Assigned to: Nobody (None) Summary: script/generate rspec_controller fails to create appropriate views (from templates) on edge rails Initial Comment: Mac OSX 10.4.9 edge rails: r7126 rspec (plugin): r2082 rspec_on_rails: r2081 Views couldn't be generated by script/generate rspec_controller ... $ script/generate rspec_controller patient_base index face_sheet patient_messages rx chart_timeline archive chart_note flow_sheet hist ory hospital lab_results radiology x_ray exists app/controllers/ exists app/helpers/ create app/views/patient_base exists spec/controllers/ exists spec/helpers/ create spec/views/patient_base create spec/controllers/patient_base_controller_spec.rb create spec/helpers/patient_base_helper_spec.rb create app/controllers/patient_base_controller.rb create app/helpers/patient_base_helper.rb create spec/views/patient_base/index_view_spec.rb create app/views/patient_base/index.rhtml No such file or directory - /Users/george/work/one_box/vendor/rails/railties/lib/rails_generator/generators/components/controller/templates/view.rhtml railties/lib/rails_generator/generators/components/controller/templates/view.html changed to view.html.erb as of r6690 (roughly 2 months ago). See: http://dev.rubyonrails.org/browser/trunk/railties/lib/rails_generator/generators/components/controller/templates Rails 1.2 STABLE should use view.rhtml (See: http://dev.rubyonrails.org/browser/branches/1-2-stable/railties/lib/rails_generator/generators/components/controller/templates) So perhaps this ticket is premature. Consider, however, the *.html.erb style will eventually be in the STABLE release. At that time, RSpec may have to deal with the *old* and *new* style templates. For those of you reading this far, and not feeling you have suffient RSpec-fu to create a patch for this (myself included among you), consider this workaround: $ script/generate rspec_controller patient_base index this will throw the error herein described, but just lop off the "rspec_" bit and run: $ script/generate controller patient_base index Most of the files will be identical, but the *.html.erb-style templates will generate as expected. For bonus points, clean up the test::unit cruft thusly: $ rm test/functional/patient_base_controller_test.rb Thx. ---------------------------------------------------------------------- >Comment By: George Anderson (caton) Date: 2007-06-28 12:45 Message: .rhtml won't be fully deprecated until Rails 3.0 See: http://dev.rubyonrails.org/changeset/6178 ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11891&group_id=797 From noreply at rubyforge.org Thu Jun 28 12:48:35 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Thu, 28 Jun 2007 12:48:35 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-11891 ] script/generate rspec_controller fails to create appropriate views (from templates) on edge rails Message-ID: <20070628164835.ECCF85240AE8@rubyforge.org> Bugs item #11891, was opened at 2007-06-27 19:45 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11891&group_id=797 Category: rails plugin Group: None Status: Open Resolution: None Priority: 3 Submitted By: George Anderson (caton) >Assigned to: David Chelimsky (dchelimsky) Summary: script/generate rspec_controller fails to create appropriate views (from templates) on edge rails Initial Comment: Mac OSX 10.4.9 edge rails: r7126 rspec (plugin): r2082 rspec_on_rails: r2081 Views couldn't be generated by script/generate rspec_controller ... $ script/generate rspec_controller patient_base index face_sheet patient_messages rx chart_timeline archive chart_note flow_sheet hist ory hospital lab_results radiology x_ray exists app/controllers/ exists app/helpers/ create app/views/patient_base exists spec/controllers/ exists spec/helpers/ create spec/views/patient_base create spec/controllers/patient_base_controller_spec.rb create spec/helpers/patient_base_helper_spec.rb create app/controllers/patient_base_controller.rb create app/helpers/patient_base_helper.rb create spec/views/patient_base/index_view_spec.rb create app/views/patient_base/index.rhtml No such file or directory - /Users/george/work/one_box/vendor/rails/railties/lib/rails_generator/generators/components/controller/templates/view.rhtml railties/lib/rails_generator/generators/components/controller/templates/view.html changed to view.html.erb as of r6690 (roughly 2 months ago). See: http://dev.rubyonrails.org/browser/trunk/railties/lib/rails_generator/generators/components/controller/templates Rails 1.2 STABLE should use view.rhtml (See: http://dev.rubyonrails.org/browser/branches/1-2-stable/railties/lib/rails_generator/generators/components/controller/templates) So perhaps this ticket is premature. Consider, however, the *.html.erb style will eventually be in the STABLE release. At that time, RSpec may have to deal with the *old* and *new* style templates. For those of you reading this far, and not feeling you have suffient RSpec-fu to create a patch for this (myself included among you), consider this workaround: $ script/generate rspec_controller patient_base index this will throw the error herein described, but just lop off the "rspec_" bit and run: $ script/generate controller patient_base index Most of the files will be identical, but the *.html.erb-style templates will generate as expected. For bonus points, clean up the test::unit cruft thusly: $ rm test/functional/patient_base_controller_test.rb Thx. ---------------------------------------------------------------------- >Comment By: David Chelimsky (dchelimsky) Date: 2007-06-28 16:48 Message: No need to justify this - it's missing functionality that we'll add. The rspec_resource generator already does the right thing based on the rails environment and we can get the rspec_controller generator to do the same. ---------------------------------------------------------------------- Comment By: George Anderson (caton) Date: 2007-06-28 16:45 Message: .rhtml won't be fully deprecated until Rails 3.0 See: http://dev.rubyonrails.org/changeset/6178 ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11891&group_id=797 From noreply at rubyforge.org Thu Jun 28 14:06:31 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Thu, 28 Jun 2007 14:06:31 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-10577 ] Rails with Oracle breaks 0.9.2 Message-ID: <20070628180631.E16595240B79@rubyforge.org> Bugs item #10577, was opened at 2007-05-04 11:57 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=10577&group_id=797 Category: rails plugin Group: None Status: Open >Resolution: Accepted Priority: 3 Submitted By: John Andrews (jandrews) >Assigned to: Aslak Helles?y (aslak_hellesoy) Summary: Rails with Oracle breaks 0.9.2 Initial Comment: Upgrading to rspec 0.9.2 from 0.8.2 using Oracle database with ActiveRecord breaks due to the following: oracle_adapter.rb:316 (owner, table_name) = @connection.describe(table_name) @connection is an instance of OCI8AutoRecover which itself delegates the describe method to OCI8. class OCI8AutoRecover < DelegateClass(OCI8) #... # no def describe method end DelegateClass internally uses method_missing to call the delegate class' describe class OCI8 #:nodoc: def describe(name) #... end #... end The problem is that rspec defines Kernel#describe, so method_missing never catches the call to delegate and it fails from rspec because there is obviously no block given. My work-around modifies 2 files. I will just include the methods I changed because I don't have diffs from trunk. from file: rspec_on_rails/lib/spec/rails/extensions/kernel.rb def describe(*args, &block) # assuming that if a block is not given that it is not a call # for rspec if block_given? args << {} unless Hash === args.last args.last[:spec_path] = caller(0)[1] end original_describe(*args, &block) end from file: rspec-0.9.2/lib/spec/runner/extensions/kernel.rb def describe(*args, &block) if block_given? raise ArgumentError if args.empty? register_behaviour(Spec::DSL::BehaviourFactory.create(*args, &block)) else # not the describe that we are looking for # it's probably a call from the oracle adapter super *args end end I don't know if this is the best way to fix the issue, but it works for me and all my specs pass again. if you need more info or someone to test a fix for Oracle I am able to help. ---------------------------------------------------------------------- >Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-06-28 14:06 Message: I'm looking into a fix for this... ---------------------------------------------------------------------- Comment By: sinclair bain (sinclair) Date: 2007-06-28 12:12 Message: We have a patch for this: Save the following to your /lib directory in a file called e.g. oracle_adapter.rb --------------- # Rspec's dsl uses #describe as a method name at the core of its functionality # The oracle_adapter also uses #describe and the two clash. # Because rspec mixes-in the #describe method via the Kernel module all # Object instances (i.e. all objects) have a #describe method. # The oracle adpater uses a delegation model for some functionality via the # #method_missing mechanism. The #describe method is one of the methods which # _was_ missing when rspec was not around. However the mixin via Kernel changes # that thus _things_ do not function as intended (on the oracle side). # This patch hacks in the #describe method to where it was missing and then # delegates to the implementation. # #see # http://rubyforge.org/tracker/index.php?func=detail&aid=10577&group_id=797&atid=3149 module OracleAdapterPatch # rspec method name collision patch def describe(obj) # puts "OCI8AutoRecover#describe( #{obj} ) forwarded to #{@connection}" @connection.describe(obj) end end OCI8AutoRecover.send(:include, OracleAdapterPatch) ---------------------------- Edit as required. In your environment.rb for example add the following require 'oracle_adapter' which can be made conditional (or could this be a rspec rake task?) Cheers! sinclair rspec now functions ---------------------------------------------------------------------- Comment By: Venkatasubramaniyan K (venkat) Date: 2007-06-28 11:57 Message: Dear rspec team: I am also running into the same problem. I figured out the issue after a long debug session. I don't have any good solution for it. But I would appreciate a solution for this soon (even if it is a temp patch to begin with), so that we don't waste time debugging this. Yes, there could be other software affected by this but the specific Oracle issue at least needs to be resolved. Thanks, Venkat. ---------------------------------------------------------------------- Comment By: sinclair bain (sinclair) Date: 2007-06-01 14:25 Message: Hi, I just ran into this problem in rspec_for_rails 1.0.0. The solution I think we will settle for in the short term is a monkey patch to the OCI8AutoRecover class. The patch implements the #describe method in the OCI8AutoRecover class (via a module include). The patch file is in our rails_app/lib directory and is #required in the environment.rb. This is the implementation: module OracleAdapterPatch # rspec method name collision patch def describe(obj) puts "OCI8AutoRecover#describe( #{obj} ) forwarded to #{@connection}" @connection.describe(obj) end end OCI8AutoRecover.send(:include, OracleAdapterPatch) As is stated below this is (still) a band-aid approach. Cheers! sinclair ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-05-05 19:56 Message: I'm uncomfortable with this solution. It's a band-aid for this particular example, but someone else might come along and do something similar - using method_missing to delegate to another object WITH a block expected in that object's #describe method. Does anyone have any other suggestions? ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=10577&group_id=797 From noreply at rubyforge.org Thu Jun 28 14:54:07 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Thu, 28 Jun 2007 14:54:07 -0400 (EDT) Subject: [rspec-devel] [ rspec-Bugs-10577 ] Rails with Oracle breaks 0.9.2 Message-ID: <20070628185407.924A75240B1A@rubyforge.org> Bugs item #10577, was opened at 2007-05-04 11:57 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=10577&group_id=797 Category: rails plugin Group: None Status: Open Resolution: Accepted Priority: 3 Submitted By: John Andrews (jandrews) >Assigned to: Nobody (None) Summary: Rails with Oracle breaks 0.9.2 Initial Comment: Upgrading to rspec 0.9.2 from 0.8.2 using Oracle database with ActiveRecord breaks due to the following: oracle_adapter.rb:316 (owner, table_name) = @connection.describe(table_name) @connection is an instance of OCI8AutoRecover which itself delegates the describe method to OCI8. class OCI8AutoRecover < DelegateClass(OCI8) #... # no def describe method end DelegateClass internally uses method_missing to call the delegate class' describe class OCI8 #:nodoc: def describe(name) #... end #... end The problem is that rspec defines Kernel#describe, so method_missing never catches the call to delegate and it fails from rspec because there is obviously no block given. My work-around modifies 2 files. I will just include the methods I changed because I don't have diffs from trunk. from file: rspec_on_rails/lib/spec/rails/extensions/kernel.rb def describe(*args, &block) # assuming that if a block is not given that it is not a call # for rspec if block_given? args << {} unless Hash === args.last args.last[:spec_path] = caller(0)[1] end original_describe(*args, &block) end from file: rspec-0.9.2/lib/spec/runner/extensions/kernel.rb def describe(*args, &block) if block_given? raise ArgumentError if args.empty? register_behaviour(Spec::DSL::BehaviourFactory.create(*args, &block)) else # not the describe that we are looking for # it's probably a call from the oracle adapter super *args end end I don't know if this is the best way to fix the issue, but it works for me and all my specs pass again. if you need more info or someone to test a fix for Oracle I am able to help. ---------------------------------------------------------------------- >Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-06-28 14:54 Message: Method visibility is as follows: Object method > Kernel method > method_missing (RSpec describe) ORA driver (DelegateClass) What we need to do here is to make sure the OCI8AutoRecover object intercepts the method before it falls back to Kernel. That's easily done by monkey patching it: class OCI8AutoRecover def describe(name) @connection.describe(name) end end All this does is to define the describe method directly and delegate explicitly. It should work just like before, but I don't have an ORA here to verify it. If someone can confirm that this works I'll roll this into Spec::Rails and enable it automagically so you don't have anything special to do. Aaait? ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-06-28 14:06 Message: I'm looking into a fix for this... ---------------------------------------------------------------------- Comment By: sinclair bain (sinclair) Date: 2007-06-28 12:12 Message: We have a patch for this: Save the following to your /lib directory in a file called e.g. oracle_adapter.rb --------------- # Rspec's dsl uses #describe as a method name at the core of its functionality # The oracle_adapter also uses #describe and the two clash. # Because rspec mixes-in the #describe method via the Kernel module all # Object instances (i.e. all objects) have a #describe method. # The oracle adpater uses a delegation model for some functionality via the # #method_missing mechanism. The #describe method is one of the methods which # _was_ missing when rspec was not around. However the mixin via Kernel changes # that thus _things_ do not function as intended (on the oracle side). # This patch hacks in the #describe method to where it was missing and then # delegates to the implementation. # #see # http://rubyforge.org/tracker/index.php?func=detail&aid=10577&group_id=797&atid=3149 module OracleAdapterPatch # rspec method name collision patch def describe(obj) # puts "OCI8AutoRecover#describe( #{obj} ) forwarded to #{@connection}" @connection.describe(obj) end end OCI8AutoRecover.send(:include, OracleAdapterPatch) ---------------------------- Edit as required. In your environment.rb for example add the following require 'oracle_adapter' which can be made conditional (or could this be a rspec rake task?) Cheers! sinclair rspec now functions ---------------------------------------------------------------------- Comment By: Venkatasubramaniyan K (venkat) Date: 2007-06-28 11:57 Message: Dear rspec team: I am also running into the same problem. I figured out the issue after a long debug session. I don't have any good solution for it. But I would appreciate a solution for this soon (even if it is a temp patch to begin with), so that we don't waste time debugging this. Yes, there could be other software affected by this but the specific Oracle issue at least needs to be resolved. Thanks, Venkat. ---------------------------------------------------------------------- Comment By: sinclair bain (sinclair) Date: 2007-06-01 14:25 Message: Hi, I just ran into this problem in rspec_for_rails 1.0.0. The solution I think we will settle for in the short term is a monkey patch to the OCI8AutoRecover class. The patch implements the #describe method in the OCI8AutoRecover class (via a module include). The patch file is in our rails_app/lib directory and is #required in the environment.rb. This is the implementation: module OracleAdapterPatch # rspec method name collision patch def describe(obj) puts "OCI8AutoRecover#describe( #{obj} ) forwarded to #{@connection}" @connection.describe(obj) end end OCI8AutoRecover.send(:include, OracleAdapterPatch) As is stated below this is (still) a band-aid approach. Cheers! sinclair ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-05-05 19:56 Message: I'm uncomfortable with this solution. It's a band-aid for this particular example, but someone else might come along and do something similar - using method_missing to delegate to another object WITH a block expected in that object's #describe method. Does anyone have any other suggestions? ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=10577&group_id=797 From noreply at rubyforge.org Thu Jun 28 18:53:43 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Thu, 28 Jun 2007 18:53:43 -0400 (EDT) Subject: [rspec-devel] [ rspec-Feature Requests-11916 ] View Specs should have all the View Helper modules included Message-ID: <20070628225343.60CC45240B6A@rubyforge.org> Feature Requests item #11916, was opened at 2007-06-28 15:53 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3152&aid=11916&group_id=797 Category: rails plugin Group: None Status: Open Priority: 3 Submitted By: Brian Takita (btakita) Assigned to: Nobody (None) Summary: View Specs should have all the View Helper modules included Initial Comment: So we can call methods like h and truncate without resorting to view.send(:h) or class << view public :h end h() ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3152&aid=11916&group_id=797 From noreply at rubyforge.org Fri Jun 29 02:46:10 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Fri, 29 Jun 2007 02:46:10 -0400 (EDT) Subject: [rspec-devel] [ rspec-Patches-11917 ] Cleaner Spec::Ui error for failed Selenium connection Message-ID: <20070629064610.B71565240BB6@rubyforge.org> Patches item #11917, was opened at 2007-06-28 23:46 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3151&aid=11917&group_id=797 Category: None Group: None Status: Open Resolution: None Priority: 3 Submitted By: Ian Dees (undees) Assigned to: Nobody (None) Summary: Cleaner Spec::Ui error for failed Selenium connection Initial Comment: If Spec::Ui fails for some reason to connect to the Selenium remote (e.g., if it's not running, or the port settings are wrong), the result is a rather lengthy backtrace leading off with a "You must call Spec::Ui::ScreenshotFormatter.screenshot..." message---even if the requisite call to screenshot() is in the right place. Spec::Ui::ScreenshotFormatter::extra_error_content() seems to expect @relative_png_path to be set, which is reasonable for spec failures, but in the case of a "before" clause raising an error, this attribute won't have been set yet. The simplest solution is to skip the call to img_div()---which calls relative_png_path()---if failure.expectation_not_met() is false. This would seem to have the side effect of skipping the screen capture for a "describe" clause that raises any error other than ExpectationNotMet. From a test writer's perspective, I can say the lack of a screenshot in that (rare?) case wouldn't bug me. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3151&aid=11917&group_id=797 From noreply at rubyforge.org Fri Jun 29 05:43:42 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Fri, 29 Jun 2007 05:43:42 -0400 (EDT) Subject: [rspec-devel] [ rspec-Patches-11919 ] Making non-implemented specs easy in textmate Message-ID: <20070629094342.94EF9524098F@rubyforge.org> Patches item #11919, was opened at 2007-06-29 09:43 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3151&aid=11919&group_id=797 Category: None Group: None Status: Open Resolution: None Priority: 3 Submitted By: Scott Taylor (smtlaissezfaire) Assigned to: Nobody (None) Summary: Making non-implemented specs easy in textmate Initial Comment: Small modification to the 'it' textmate snippet. The third tab trigger will allow the removal of the block, so that one can list a series of it "should ..." specifications, one after another. Two things: 1. I'm not exactly sure if anyone finds this useful, so please reject it if it isn't. 2. I couldn't figure out if this thing has specs to go along with it, and exactly how to add it to subversion, so I've attached the full bundle. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3151&aid=11919&group_id=797 From noreply at rubyforge.org Fri Jun 29 05:45:48 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Fri, 29 Jun 2007 05:45:48 -0400 (EDT) Subject: [rspec-devel] [ rspec-Patches-11919 ] Making non-implemented specs easy in textmate Message-ID: <20070629094548.702E3524098F@rubyforge.org> Patches item #11919, was opened at 2007-06-29 09:43 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3151&aid=11919&group_id=797 Category: None Group: None Status: Open Resolution: None Priority: 3 Submitted By: Scott Taylor (smtlaissezfaire) Assigned to: Nobody (None) Summary: Making non-implemented specs easy in textmate Initial Comment: Small modification to the 'it' textmate snippet. The third tab trigger will allow the removal of the block, so that one can list a series of it "should ..." specifications, one after another. Two things: 1. I'm not exactly sure if anyone finds this useful, so please reject it if it isn't. 2. I couldn't figure out if this thing has specs to go along with it, and exactly how to add it to subversion, so I've attached the full bundle. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3151&aid=11919&group_id=797 From noreply at rubyforge.org Fri Jun 29 05:46:03 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Fri, 29 Jun 2007 05:46:03 -0400 (EDT) Subject: [rspec-devel] [ rspec-Patches-11919 ] Making non-implemented specs easy in textmate Message-ID: <20070629094603.3C1F9524098F@rubyforge.org> Patches item #11919, was opened at 2007-06-29 09:43 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3151&aid=11919&group_id=797 Category: None Group: None Status: Open Resolution: None Priority: 3 Submitted By: Scott Taylor (smtlaissezfaire) Assigned to: Nobody (None) Summary: Making non-implemented specs easy in textmate Initial Comment: Small modification to the 'it' textmate snippet. The third tab trigger will allow the removal of the block, so that one can list a series of it "should ..." specifications, one after another. Two things: 1. I'm not exactly sure if anyone finds this useful, so please reject it if it isn't. 2. I couldn't figure out if this thing has specs to go along with it, and exactly how to add it to subversion, so I've attached the full bundle. ---------------------------------------------------------------------- >Comment By: Scott Taylor (smtlaissezfaire) Date: 2007-06-29 09:46 Message: the bundle... ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3151&aid=11919&group_id=797 From noreply at rubyforge.org Fri Jun 29 05:46:49 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Fri, 29 Jun 2007 05:46:49 -0400 (EDT) Subject: [rspec-devel] [ rspec-Patches-11919 ] Making non-implemented specs easy in textmate Message-ID: <20070629094649.4010A5240A0F@rubyforge.org> Patches item #11919, was opened at 2007-06-29 09:43 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3151&aid=11919&group_id=797 Category: None Group: None Status: Open Resolution: None Priority: 3 Submitted By: Scott Taylor (smtlaissezfaire) Assigned to: Nobody (None) Summary: Making non-implemented specs easy in textmate Initial Comment: Small modification to the 'it' textmate snippet. The third tab trigger will allow the removal of the block, so that one can list a series of it "should ..." specifications, one after another. Two things: 1. I'm not exactly sure if anyone finds this useful, so please reject it if it isn't. 2. I couldn't figure out if this thing has specs to go along with it, and exactly how to add it to subversion, so I've attached the full bundle. ---------------------------------------------------------------------- Comment By: Scott Taylor (smtlaissezfaire) Date: 2007-06-29 09:46 Message: the bundle... ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3151&aid=11919&group_id=797 From noreply at rubyforge.org Fri Jun 29 05:47:22 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Fri, 29 Jun 2007 05:47:22 -0400 (EDT) Subject: [rspec-devel] [ rspec-Patches-11919 ] Making non-implemented specs easy in textmate Message-ID: <20070629094722.495E1524098F@rubyforge.org> Patches item #11919, was opened at 2007-06-29 09:43 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3151&aid=11919&group_id=797 Category: None Group: None Status: Open Resolution: None Priority: 3 Submitted By: Scott Taylor (smtlaissezfaire) Assigned to: Nobody (None) Summary: Making non-implemented specs easy in textmate Initial Comment: Small modification to the 'it' textmate snippet. The third tab trigger will allow the removal of the block, so that one can list a series of it "should ..." specifications, one after another. Two things: 1. I'm not exactly sure if anyone finds this useful, so please reject it if it isn't. 2. I couldn't figure out if this thing has specs to go along with it, and exactly how to add it to subversion, so I've attached the full bundle. ---------------------------------------------------------------------- Comment By: Scott Taylor (smtlaissezfaire) Date: 2007-06-29 09:46 Message: the bundle... ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3151&aid=11919&group_id=797 From noreply at rubyforge.org Fri Jun 29 05:47:32 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Fri, 29 Jun 2007 05:47:32 -0400 (EDT) Subject: [rspec-devel] [ rspec-Patches-11919 ] Making non-implemented specs easy in textmate Message-ID: <20070629094732.3884C5240A3A@rubyforge.org> Patches item #11919, was opened at 2007-06-29 09:43 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3151&aid=11919&group_id=797 Category: None Group: None Status: Open Resolution: None Priority: 3 Submitted By: Scott Taylor (smtlaissezfaire) Assigned to: Nobody (None) Summary: Making non-implemented specs easy in textmate Initial Comment: Small modification to the 'it' textmate snippet. The third tab trigger will allow the removal of the block, so that one can list a series of it "should ..." specifications, one after another. Two things: 1. I'm not exactly sure if anyone finds this useful, so please reject it if it isn't. 2. I couldn't figure out if this thing has specs to go along with it, and exactly how to add it to subversion, so I've attached the full bundle. ---------------------------------------------------------------------- Comment By: Scott Taylor (smtlaissezfaire) Date: 2007-06-29 09:46 Message: the bundle... ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3151&aid=11919&group_id=797 From noreply at rubyforge.org Fri Jun 29 05:57:35 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Fri, 29 Jun 2007 05:57:35 -0400 (EDT) Subject: [rspec-devel] [ rspec-Patches-11919 ] Making non-implemented specs easy in textmate Message-ID: <20070629095735.8D47A52409F9@rubyforge.org> Patches item #11919, was opened at 2007-06-29 05:43 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3151&aid=11919&group_id=797 Category: None Group: None Status: Open Resolution: None Priority: 3 Submitted By: Scott Taylor (smtlaissezfaire) Assigned to: Nobody (None) Summary: Making non-implemented specs easy in textmate Initial Comment: Small modification to the 'it' textmate snippet. The third tab trigger will allow the removal of the block, so that one can list a series of it "should ..." specifications, one after another. Two things: 1. I'm not exactly sure if anyone finds this useful, so please reject it if it isn't. 2. I couldn't figure out if this thing has specs to go along with it, and exactly how to add it to subversion, so I've attached the full bundle. ---------------------------------------------------------------------- >Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-06-29 05:57 Message: You forgot to check the attachment checkbox. Can you attach a diff instead so I can see what you have changed? (Just svn add it locally before doing svn diff). ---------------------------------------------------------------------- Comment By: Scott Taylor (smtlaissezfaire) Date: 2007-06-29 05:46 Message: the bundle... ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3151&aid=11919&group_id=797 From noreply at rubyforge.org Fri Jun 29 06:41:59 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Fri, 29 Jun 2007 06:41:59 -0400 (EDT) Subject: [rspec-devel] [ rspec-Patches-11921 ] Adds the correct controller_name from derived_controller_name() to the ViewExampleController Message-ID: <20070629104159.DF429524098F@rubyforge.org> Patches item #11921, was opened at 2007-06-29 10:41 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3151&aid=11921&group_id=797 Category: rails plugin Group: None Status: Open Resolution: None Priority: 3 Submitted By: Eloy Duran (alloy) Assigned to: Nobody (None) Summary: Adds the correct controller_name from derived_controller_name() to the ViewExampleController Initial Comment: Only the controller_path is being set on an instantiated ViewExampleController, in my case (working with Hobo) I needed the controller_name to return the derived_controller_name too. Unfortunately I was unable to locate the specs for the ViewExampleController, did I miss it? Cheers, Eloy ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3151&aid=11921&group_id=797 From noreply at rubyforge.org Fri Jun 29 08:19:52 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Fri, 29 Jun 2007 08:19:52 -0400 (EDT) Subject: [rspec-devel] [ rspec-Patches-11921 ] Adds the correct controller_name from derived_controller_name() to the ViewExampleController Message-ID: <20070629121952.480A85240A3C@rubyforge.org> Patches item #11921, was opened at 2007-06-29 10:41 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3151&aid=11921&group_id=797 Category: rails plugin Group: None Status: Open Resolution: None Priority: 3 Submitted By: Eloy Duran (alloy) Assigned to: Nobody (None) Summary: Adds the correct controller_name from derived_controller_name() to the ViewExampleController Initial Comment: Only the controller_path is being set on an instantiated ViewExampleController, in my case (working with Hobo) I needed the controller_name to return the derived_controller_name too. Unfortunately I was unable to locate the specs for the ViewExampleController, did I miss it? Cheers, Eloy ---------------------------------------------------------------------- >Comment By: David Chelimsky (dchelimsky) Date: 2007-06-29 12:19 Message: ViewExampleController is not described directly it seems, but what is in there was driven by view_spec_spec.rb. If you want to add more granular examples for the ViewExampleController, that would be great. Otherwise, you can simply add an example in view_spec_spec.rb that uses controller_name to drive the implementation. Cheers, David ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3151&aid=11921&group_id=797 From noreply at rubyforge.org Fri Jun 29 09:27:25 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Fri, 29 Jun 2007 09:27:25 -0400 (EDT) Subject: [rspec-devel] [ rspec-Patches-11919 ] Making non-implemented specs easy in textmate Message-ID: <20070629132725.D11F45240AC0@rubyforge.org> Patches item #11919, was opened at 2007-06-29 09:43 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3151&aid=11919&group_id=797 Category: None Group: None Status: Open Resolution: None Priority: 3 Submitted By: Scott Taylor (smtlaissezfaire) Assigned to: Nobody (None) Summary: Making non-implemented specs easy in textmate Initial Comment: Small modification to the 'it' textmate snippet. The third tab trigger will allow the removal of the block, so that one can list a series of it "should ..." specifications, one after another. Two things: 1. I'm not exactly sure if anyone finds this useful, so please reject it if it isn't. 2. I couldn't figure out if this thing has specs to go along with it, and exactly how to add it to subversion, so I've attached the full bundle. ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-06-29 09:57 Message: You forgot to check the attachment checkbox. Can you attach a diff instead so I can see what you have changed? (Just svn add it locally before doing svn diff). ---------------------------------------------------------------------- Comment By: Scott Taylor (smtlaissezfaire) Date: 2007-06-29 09:46 Message: the bundle... ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3151&aid=11919&group_id=797 From noreply at rubyforge.org Fri Jun 29 09:41:32 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Fri, 29 Jun 2007 09:41:32 -0400 (EDT) Subject: [rspec-devel] [ rspec-Patches-11919 ] Making non-implemented specs easy in textmate Message-ID: <20070629134132.2795C5240A3C@rubyforge.org> Patches item #11919, was opened at 2007-06-29 09:43 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3151&aid=11919&group_id=797 Category: None Group: None Status: Open Resolution: None Priority: 3 Submitted By: Scott Taylor (smtlaissezfaire) Assigned to: Nobody (None) Summary: Making non-implemented specs easy in textmate Initial Comment: Small modification to the 'it' textmate snippet. The third tab trigger will allow the removal of the block, so that one can list a series of it "should ..." specifications, one after another. Two things: 1. I'm not exactly sure if anyone finds this useful, so please reject it if it isn't. 2. I couldn't figure out if this thing has specs to go along with it, and exactly how to add it to subversion, so I've attached the full bundle. ---------------------------------------------------------------------- >Comment By: Scott Taylor (smtlaissezfaire) Date: 2007-06-29 13:41 Message: No, actually I did check the checkbox, but for whatever reason it wouldn't upload. The svn diff also didn't work...I had to do it manually. Here is the diff of the "it" snippet (I'll also attach it) 6c6 < it "${2:should ${1:description}}" ${3:do --- > it "${2:should ${1:description}}" do 8c8 < end} --- > end ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-06-29 09:57 Message: You forgot to check the attachment checkbox. Can you attach a diff instead so I can see what you have changed? (Just svn add it locally before doing svn diff). ---------------------------------------------------------------------- Comment By: Scott Taylor (smtlaissezfaire) Date: 2007-06-29 09:46 Message: the bundle... ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3151&aid=11919&group_id=797 From noreply at rubyforge.org Fri Jun 29 09:56:54 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Fri, 29 Jun 2007 09:56:54 -0400 (EDT) Subject: [rspec-devel] [ rspec-Patches-11919 ] Making non-implemented specs easy in textmate Message-ID: <20070629135655.0805A5240A3C@rubyforge.org> Patches item #11919, was opened at 2007-06-29 09:43 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3151&aid=11919&group_id=797 Category: None Group: None Status: Open Resolution: None Priority: 3 Submitted By: Scott Taylor (smtlaissezfaire) Assigned to: Nobody (None) Summary: Making non-implemented specs easy in textmate Initial Comment: Small modification to the 'it' textmate snippet. The third tab trigger will allow the removal of the block, so that one can list a series of it "should ..." specifications, one after another. Two things: 1. I'm not exactly sure if anyone finds this useful, so please reject it if it isn't. 2. I couldn't figure out if this thing has specs to go along with it, and exactly how to add it to subversion, so I've attached the full bundle. ---------------------------------------------------------------------- >Comment By: Scott Taylor (smtlaissezfaire) Date: 2007-06-29 13:56 Message: Disregard the last diff. I figured out how to do it via. subversion's diff. ---------------------------------------------------------------------- Comment By: Scott Taylor (smtlaissezfaire) Date: 2007-06-29 13:41 Message: No, actually I did check the checkbox, but for whatever reason it wouldn't upload. The svn diff also didn't work...I had to do it manually. Here is the diff of the "it" snippet (I'll also attach it) 6c6 < it "${2:should ${1:description}}" ${3:do --- > it "${2:should ${1:description}}" do 8c8 < end} --- > end ---------------------------------------------------------------------- Comment By: Aslak Helles?y (aslak_hellesoy) Date: 2007-06-29 09:57 Message: You forgot to check the attachment checkbox. Can you attach a diff instead so I can see what you have changed? (Just svn add it locally before doing svn diff). ---------------------------------------------------------------------- Comment By: Scott Taylor (smtlaissezfaire) Date: 2007-06-29 09:46 Message: the bundle... ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3151&aid=11919&group_id=797 From noreply at rubyforge.org Fri Jun 29 10:31:43 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Fri, 29 Jun 2007 10:31:43 -0400 (EDT) Subject: [rspec-devel] [ rspec-Patches-11921 ] Adds the correct controller_name from derived_controller_name() to the ViewExampleController Message-ID: <20070629143144.017105240A99@rubyforge.org> Patches item #11921, was opened at 2007-06-29 10:41 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3151&aid=11921&group_id=797 Category: rails plugin Group: None Status: Open Resolution: None Priority: 3 Submitted By: Eloy Duran (alloy) Assigned to: Nobody (None) Summary: Adds the correct controller_name from derived_controller_name() to the ViewExampleController Initial Comment: Only the controller_path is being set on an instantiated ViewExampleController, in my case (working with Hobo) I needed the controller_name to return the derived_controller_name too. Unfortunately I was unable to locate the specs for the ViewExampleController, did I miss it? Cheers, Eloy ---------------------------------------------------------------------- >Comment By: Eloy Duran (alloy) Date: 2007-06-29 14:31 Message: Unfortunately I don't have the time atm to write examples for the complete ViewExampleController, but I've added 2 to the view_spec_spec.rb file. I'm not 100% sure about the reference to @controller, is there a better way? I created a folder called foo (I'll attach a zip) in: spec_resources/views/view_spec/ I did this to be able to really test controller_path and controller_name. Cheers, Eloy ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-06-29 12:19 Message: ViewExampleController is not described directly it seems, but what is in there was driven by view_spec_spec.rb. If you want to add more granular examples for the ViewExampleController, that would be great. Otherwise, you can simply add an example in view_spec_spec.rb that uses controller_name to drive the implementation. Cheers, David ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3151&aid=11921&group_id=797 From noreply at rubyforge.org Fri Jun 29 10:32:22 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Fri, 29 Jun 2007 10:32:22 -0400 (EDT) Subject: [rspec-devel] [ rspec-Patches-11921 ] Adds the correct controller_name from derived_controller_name() to the ViewExampleController Message-ID: <20070629143222.47C12A970002@rubyforge.org> Patches item #11921, was opened at 2007-06-29 10:41 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3151&aid=11921&group_id=797 Category: rails plugin Group: None Status: Open Resolution: None Priority: 3 Submitted By: Eloy Duran (alloy) Assigned to: Nobody (None) Summary: Adds the correct controller_name from derived_controller_name() to the ViewExampleController Initial Comment: Only the controller_path is being set on an instantiated ViewExampleController, in my case (working with Hobo) I needed the controller_name to return the derived_controller_name too. Unfortunately I was unable to locate the specs for the ViewExampleController, did I miss it? Cheers, Eloy ---------------------------------------------------------------------- >Comment By: Eloy Duran (alloy) Date: 2007-06-29 14:32 Message: And the spec_resource zip. ---------------------------------------------------------------------- Comment By: Eloy Duran (alloy) Date: 2007-06-29 14:31 Message: Unfortunately I don't have the time atm to write examples for the complete ViewExampleController, but I've added 2 to the view_spec_spec.rb file. I'm not 100% sure about the reference to @controller, is there a better way? I created a folder called foo (I'll attach a zip) in: spec_resources/views/view_spec/ I did this to be able to really test controller_path and controller_name. Cheers, Eloy ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-06-29 12:19 Message: ViewExampleController is not described directly it seems, but what is in there was driven by view_spec_spec.rb. If you want to add more granular examples for the ViewExampleController, that would be great. Otherwise, you can simply add an example in view_spec_spec.rb that uses controller_name to drive the implementation. Cheers, David ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3151&aid=11921&group_id=797 From noreply at rubyforge.org Fri Jun 29 10:33:11 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Fri, 29 Jun 2007 10:33:11 -0400 (EDT) Subject: [rspec-devel] [ rspec-Patches-11921 ] Adds the correct controller_name from derived_controller_name() to the ViewExampleController Message-ID: <20070629143311.42CFDA970006@rubyforge.org> Patches item #11921, was opened at 2007-06-29 10:41 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3151&aid=11921&group_id=797 Category: rails plugin Group: None Status: Open Resolution: None Priority: 3 Submitted By: Eloy Duran (alloy) Assigned to: Nobody (None) Summary: Adds the correct controller_name from derived_controller_name() to the ViewExampleController Initial Comment: Only the controller_path is being set on an instantiated ViewExampleController, in my case (working with Hobo) I needed the controller_name to return the derived_controller_name too. Unfortunately I was unable to locate the specs for the ViewExampleController, did I miss it? Cheers, Eloy ---------------------------------------------------------------------- >Comment By: Eloy Duran (alloy) Date: 2007-06-29 14:33 Message: ---------------------------------------------------------------------- Comment By: Eloy Duran (alloy) Date: 2007-06-29 14:32 Message: And the spec_resource zip. ---------------------------------------------------------------------- Comment By: Eloy Duran (alloy) Date: 2007-06-29 14:31 Message: Unfortunately I don't have the time atm to write examples for the complete ViewExampleController, but I've added 2 to the view_spec_spec.rb file. I'm not 100% sure about the reference to @controller, is there a better way? I created a folder called foo (I'll attach a zip) in: spec_resources/views/view_spec/ I did this to be able to really test controller_path and controller_name. Cheers, Eloy ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-06-29 12:19 Message: ViewExampleController is not described directly it seems, but what is in there was driven by view_spec_spec.rb. If you want to add more granular examples for the ViewExampleController, that would be great. Otherwise, you can simply add an example in view_spec_spec.rb that uses controller_name to drive the implementation. Cheers, David ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3151&aid=11921&group_id=797 From noreply at rubyforge.org Fri Jun 29 14:06:05 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Fri, 29 Jun 2007 14:06:05 -0400 (EDT) Subject: [rspec-devel] [ rspec-Patches-11921 ] Adds the correct controller_name from derived_controller_name() to the ViewExampleController Message-ID: <20070629180605.C764E5240B86@rubyforge.org> Patches item #11921, was opened at 2007-06-29 10:41 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3151&aid=11921&group_id=797 Category: rails plugin Group: None >Status: Closed >Resolution: Accepted Priority: 3 Submitted By: Eloy Duran (alloy) >Assigned to: David Chelimsky (dchelimsky) Summary: Adds the correct controller_name from derived_controller_name() to the ViewExampleController Initial Comment: Only the controller_path is being set on an instantiated ViewExampleController, in my case (working with Hobo) I needed the controller_name to return the derived_controller_name too. Unfortunately I was unable to locate the specs for the ViewExampleController, did I miss it? Cheers, Eloy ---------------------------------------------------------------------- >Comment By: David Chelimsky (dchelimsky) Date: 2007-06-29 18:06 Message: Applied to r2151. Welcome to the family of rspec contributors! ---------------------------------------------------------------------- Comment By: Eloy Duran (alloy) Date: 2007-06-29 14:33 Message: ---------------------------------------------------------------------- Comment By: Eloy Duran (alloy) Date: 2007-06-29 14:32 Message: And the spec_resource zip. ---------------------------------------------------------------------- Comment By: Eloy Duran (alloy) Date: 2007-06-29 14:31 Message: Unfortunately I don't have the time atm to write examples for the complete ViewExampleController, but I've added 2 to the view_spec_spec.rb file. I'm not 100% sure about the reference to @controller, is there a better way? I created a folder called foo (I'll attach a zip) in: spec_resources/views/view_spec/ I did this to be able to really test controller_path and controller_name. Cheers, Eloy ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-06-29 12:19 Message: ViewExampleController is not described directly it seems, but what is in there was driven by view_spec_spec.rb. If you want to add more granular examples for the ViewExampleController, that would be great. Otherwise, you can simply add an example in view_spec_spec.rb that uses controller_name to drive the implementation. Cheers, David ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3151&aid=11921&group_id=797 From noreply at rubyforge.org Fri Jun 29 14:28:04 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Fri, 29 Jun 2007 14:28:04 -0400 (EDT) Subject: [rspec-devel] [ rspec-Patches-11921 ] Adds the correct controller_name from derived_controller_name() to the ViewExampleController Message-ID: <20070629182804.E658C5240B6A@rubyforge.org> Patches item #11921, was opened at 2007-06-29 10:41 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3151&aid=11921&group_id=797 Category: rails plugin Group: None Status: Closed Resolution: Accepted Priority: 3 Submitted By: Eloy Duran (alloy) Assigned to: David Chelimsky (dchelimsky) Summary: Adds the correct controller_name from derived_controller_name() to the ViewExampleController Initial Comment: Only the controller_path is being set on an instantiated ViewExampleController, in my case (working with Hobo) I needed the controller_name to return the derived_controller_name too. Unfortunately I was unable to locate the specs for the ViewExampleController, did I miss it? Cheers, Eloy ---------------------------------------------------------------------- >Comment By: Eloy Duran (alloy) Date: 2007-06-29 18:28 Message: Woohoo, I like it! Thanks David. Cheers, Eloy ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-06-29 18:06 Message: Applied to r2151. Welcome to the family of rspec contributors! ---------------------------------------------------------------------- Comment By: Eloy Duran (alloy) Date: 2007-06-29 14:33 Message: ---------------------------------------------------------------------- Comment By: Eloy Duran (alloy) Date: 2007-06-29 14:32 Message: And the spec_resource zip. ---------------------------------------------------------------------- Comment By: Eloy Duran (alloy) Date: 2007-06-29 14:31 Message: Unfortunately I don't have the time atm to write examples for the complete ViewExampleController, but I've added 2 to the view_spec_spec.rb file. I'm not 100% sure about the reference to @controller, is there a better way? I created a folder called foo (I'll attach a zip) in: spec_resources/views/view_spec/ I did this to be able to really test controller_path and controller_name. Cheers, Eloy ---------------------------------------------------------------------- Comment By: David Chelimsky (dchelimsky) Date: 2007-06-29 12:19 Message: ViewExampleController is not described directly it seems, but what is in there was driven by view_spec_spec.rb. If you want to add more granular examples for the ViewExampleController, that would be great. Otherwise, you can simply add an example in view_spec_spec.rb that uses controller_name to drive the implementation. Cheers, David ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=3151&aid=11921&group_id=797