I would like to remove some unused helpers from the app/helpers dir, but when I do so my specs fail. Why is this? I don''t see where those helpers are referenced within the tests. Is there a way to delete these unused files? Thanks -- Posted via http://www.ruby-forum.com/.
A stacktrace would help On 11/1/07, Chris Olsen <lists at ruby-forum.com> wrote:> I would like to remove some unused helpers from the app/helpers dir, but > when I do so my specs fail. > > Why is this? I don''t see where those helpers are referenced within the > tests. Is there a way to delete these unused files? > > Thanks > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >
> A stacktrace would help/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -S script/spec -O spec/spec.opts spec/views/addresses/show.rhtml_spec.rb spec/helpers/addresses_helper_spec.rb spec/views/addresses/index.rhtml_spec.rb spec/views/addresses/edit.rhtml_spec.rb spec/views/addresses/new.rhtml_spec.rb /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:249:in `load_missing_constant'': Expected /Users/chris/Documents/Projects/Rails/MyProject/trunk/config/../app/helpers/addresses_helper.rb to define AddressesHelper (LoadError) from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:452:in `const_missing'' from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:464:in `const_missing'' from ./spec/views/addresses/show.rhtml_spec.rb:4 from /Users/chris/Documents/Projects/Rails/MyProject/trunk/vendor/plugins/rspec/lib/spec/dsl/behaviour.rb:54:in `class_eval'' from /Users/chris/Documents/Projects/Rails/MyProject/trunk/vendor/plugins/rspec/lib/spec/dsl/behaviour.rb:54:in `eval_behaviour'' from /Users/chris/Documents/Projects/Rails/MyProject/trunk/vendor/plugins/rspec/lib/spec/dsl/behaviour.rb:31:in `initialize'' from /Users/chris/Documents/Projects/Rails/MyProject/trunk/vendor/plugins/rspec/lib/spec/dsl/behaviour_factory.rb:36:in `new'' from /Users/chris/Documents/Projects/Rails/MyProject/trunk/vendor/plugins/rspec/lib/spec/dsl/behaviour_factory.rb:36:in `create'' ... 21 levels... from /Users/chris/Documents/Projects/Rails/MyProject/trunk/vendor/plugins/rspec/lib/spec/runner/option_parser.rb:155:in `parse'' from /Users/chris/Documents/Projects/Rails/MyProject/trunk/vendor/plugins/rspec/lib/spec/runner/option_parser.rb:88:in `create_behaviour_runner'' from /Users/chris/Documents/Projects/Rails/MyProject/trunk/vendor/plugins/rspec/lib/spec/runner/command_line.rb:14:in `run'' from script/spec:4 -- Posted via http://www.ruby-forum.com/.
On Fri, 2007-11-02 at 00:39 +0100, Chris Olsen wrote:> > A stacktrace would help > > /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -S > script/spec -O spec/spec.opts spec/views/addresses/show.rhtml_spec.rb > spec/helpers/addresses_helper_spec.rbLooks like you still have a (possibly generated?) spec for this helper. Kind regards, Hans -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://rubyforge.org/pipermail/rspec-users/attachments/20071102/2f55c50a/attachment.bin
Hans de Graaff wrote:> Looks like you still have a (possibly generated?) spec for this helper. > > Kind regards, > > HansI do, but the issue is that it requires the app/helpers/addresses_helper.rb file, which is that one that I am trying to delete. `load_missing_constant'': Expected /Users/chris/Documents/Projects/Rails/MyProject/trunk/config/../app/helpers/addresses_helper.rb to define AddressesHelper (LoadError) I seem to remember being able to delete helpers. I would think that these auto references that exist would check if the file exists before trying to include them. Is this not possible? Thanks for the help. -- Posted via http://www.ruby-forum.com/.
On Fri, 2007-11-02 at 15:58 +0100, Chris Olsen wrote:> Hans de Graaff wrote: > > Looks like you still have a (possibly generated?) spec for this helper. > > > > Kind regards, > > > > Hans > > I do, but the issue is that it requires the > app/helpers/addresses_helper.rb file, which is that one that I am trying > to delete.If there is still a spec file that references the helper then it can''t be removed without causing spec failures. You should also remove the spec for the helper for the specs to run without problems. If that sounds obvious then you might be trying to do something more complicated in which case some more explanation of what you are trying to achieve would be helpful. Kind regards, Hans -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://rubyforge.org/pipermail/rspec-users/attachments/20071103/16c08807/attachment.bin