Pathogen and new bundles
git-svn-id: http://photonzero.com/dotfiles/trunk@65 23f722f6-122a-0410-8cef-c75bd312dd78
This commit is contained in:
parent
9b767aed56
commit
96a93bce9e
78 changed files with 10717 additions and 0 deletions
41
.vim/bundle/command-t/spec/vim_formatter.rb
Normal file
41
.vim/bundle/command-t/spec/vim_formatter.rb
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
require 'spec/runner/formatter/base_text_formatter'
|
||||
require 'pathname'
|
||||
|
||||
# Format spec results for display in the Vim quickfix window
|
||||
# Use this custom formatter like this:
|
||||
# spec -r spec/vim_formatter.rb -f Spec::Runner::Formatter::VimFormatter spec
|
||||
module Spec
|
||||
module Runner
|
||||
module Formatter
|
||||
class VimFormatter < BaseTextFormatter
|
||||
|
||||
# TODO: handle pending issues
|
||||
# TODO: vim-side function for printing progress
|
||||
def dump_failure counter, failure
|
||||
path = failure.exception.backtrace.find do |frame|
|
||||
frame =~ %r{\bspec/.*_spec\.rb:\d+\z}
|
||||
end
|
||||
message = failure.exception.message.gsub("\n", ' ')
|
||||
@output.puts "#{relativize_path(path)}: #{message}" if path
|
||||
end
|
||||
|
||||
def dump_pending; end
|
||||
|
||||
def dump_summary duration, example_count, failure_count, pending_count
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def relativize_path path
|
||||
@wd ||= Pathname.new Dir.getwd
|
||||
begin
|
||||
return Pathname.new(path).relative_path_from(@wd)
|
||||
rescue ArgumentError
|
||||
# raised unless both paths relative, or both absolute
|
||||
return path
|
||||
end
|
||||
end
|
||||
end # class VimFormatter
|
||||
end # module Formatter
|
||||
end # module Runner
|
||||
end # module Spec
|
||||
Loading…
Add table
Add a link
Reference in a new issue