Trevor Squires
2007-Sep-21 18:07 UTC
[rspec-users] TextMate Bundle and exception when switching to alternate file.
Hey, sorry if this is something better suited to another list. I''ve encountered a strange problem with the RSpec.tmbundle in trunk - namely that it was raising an exception when pressing ctrl-shift-downarrow (switch between spec and source - "Alternate File"). I tracked down the issue to be handling of the file_type in switch_command.rb#content_for() - the code expected the type string to be just ''spec'' when it can be ''view spec'' or ''model spec'' etc. Unfortunately I don''t know whether this is just an issue with my local textmate install or if it is, in fact, a bug. Here is a diff showing how I solved the problem for myself - if it''s valid across-the-board it would be great if it could be applied to trunk. Index: RSpec.tmbundle/Support/lib/spec/mate/switch_command.rb ==================================================================--- RSpec.tmbundle/Support/lib/spec/mate/switch_command.rb (revision 2607) +++ RSpec.tmbundle/Support/lib/spec/mate/switch_command.rb (working copy) @@ -63,7 +63,7 @@ def content_for(file_type, relative_path) case file_type - when ''spec'' then + when /spec$/ then spec(relative_path) else klass(relative_path) Thanks for your attention, Trevor -- -- Trevor Squires http://somethinglearned.com
David Chelimsky
2007-Sep-21 19:55 UTC
[rspec-users] TextMate Bundle and exception when switching to alternate file.
Please submit this to the tracker as a patch. http://rubyforge.org/tracker/index.php?group_id=797 Thanks, David On 9/21/07, Trevor Squires <trevor at protocool.com> wrote:> Hey, > > sorry if this is something better suited to another list. > > I''ve encountered a strange problem with the RSpec.tmbundle in trunk - > namely that it was raising an exception when pressing > ctrl-shift-downarrow (switch between spec and source - "Alternate > File"). > > I tracked down the issue to be handling of the file_type in > switch_command.rb#content_for() - the code expected the type string to > be just ''spec'' when it can be ''view spec'' or ''model spec'' etc. > > Unfortunately I don''t know whether this is just an issue with my local > textmate install or if it is, in fact, a bug. > > Here is a diff showing how I solved the problem for myself - if it''s > valid across-the-board it would be great if it could be applied to > trunk. > > Index: RSpec.tmbundle/Support/lib/spec/mate/switch_command.rb > ==================================================================> --- RSpec.tmbundle/Support/lib/spec/mate/switch_command.rb (revision 2607) > +++ RSpec.tmbundle/Support/lib/spec/mate/switch_command.rb (working copy) > @@ -63,7 +63,7 @@ > > def content_for(file_type, relative_path) > case file_type > - when ''spec'' then > + when /spec$/ then > spec(relative_path) > else > klass(relative_path) > > Thanks for your attention, > Trevor > > -- > -- > Trevor Squires > http://somethinglearned.com > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >
Scott Taylor
2007-Sep-21 21:44 UTC
[rspec-users] TextMate Bundle and exception when switching to alternate file.
>> >> sorry if this is something better suited to another list. >> >> I''ve encountered a strange problem with the RSpec.tmbundle in trunk - >> namely that it was raising an exception when pressing >> ctrl-shift-downarrow (switch between spec and source - "Alternate >> File"). >> >> I tracked down the issue to be handling of the file_type in >> switch_command.rb#content_for() - the code expected the type >> string to >> be just ''spec'' when it can be ''view spec'' or ''model spec'' etc. >> >> Unfortunately I don''t know whether this is just an issue with my >> local >> textmate install or if it is, in fact, a bug.Nope - it''s a bug. I''ve experienced the same thing too. Scott
Trevor Squires
2007-Sep-21 23:29 UTC
[rspec-users] TextMate Bundle and exception when switching to alternate file.
Yeah, I''ve filed a patch for it - #14140 Regards, Trevor On 9/21/07, Scott Taylor <mailing_lists at railsnewbie.com> wrote:> > Nope - it''s a bug. I''ve experienced the same thing too. > > Scott-- -- Trevor Squires http://somethinglearned.com