diff --git a/RSpec (all specs).sublime-build b/RSpec (all specs).sublime-build index 4a8e019..8be67d9 100644 --- a/RSpec (all specs).sublime-build +++ b/RSpec (all specs).sublime-build @@ -2,13 +2,16 @@ "cmd": [ "bundle", "exec", - "rspec" + "rspec", + "--format", + "failures", ], "keyfiles": [ "Gemfile", "Gemfile.lock" ], "selector": "source.ruby", - "file_regex": "rspec ([A-Za-z0-9_.\/ ]+rb):([0-9]+) #()(.+)$", + "file_regex": "([A-Za-z0-9_.\/ ]+rb):([0-9]+):", + "syntax": "Packages/RSpec/RSpec output.sublime-syntax", "working_dir": "${project_path:${folder:${file_path}}}", } diff --git a/RSpec (open spec).sublime-build b/RSpec (open spec).sublime-build index 89143f8..828c5be 100644 --- a/RSpec (open spec).sublime-build +++ b/RSpec (open spec).sublime-build @@ -3,9 +3,12 @@ "bundle", "exec", "rspec", + "--format", + "failures", "$file" ], - "file_regex": "rspec ([A-Za-z0-9_.\/ ]+rb):([0-9]+) #()(.+)$", + "file_regex": "([A-Za-z0-9_.\/ ]+rb):([0-9]+):", "working_dir": "${project_path:${folder:${file_path}}}", + "syntax": "Packages/RSpec/RSpec output.sublime-syntax", "selector": "source.ruby.rspec", } diff --git a/RSpec output.sublime-syntax b/RSpec output.sublime-syntax new file mode 100644 index 0000000..1f37a0e --- /dev/null +++ b/RSpec output.sublime-syntax @@ -0,0 +1,15 @@ +%YAML 1.2 +--- +# See http://www.sublimetext.com/docs/syntax.html +scope: text.build-output.rspec +version: 2 +hidden: true + +contexts: + main: + - match: "([A-Za-z0-9_.\/ ]+rb):([0-9]+):" + captures: + 1: entity.name.filename.build-output + 2: constant.numeric.line-number.build-output + - match: '^\[.+\]$' + scope: comment.line.result.build-output diff --git a/tests/syntax_test_rspec_output b/tests/syntax_test_rspec_output new file mode 100644 index 0000000..8c2a556 --- /dev/null +++ b/tests/syntax_test_rspec_output @@ -0,0 +1,10 @@ +# SYNTAX TEST "Packages/RSpec/RSpec output.sublime-syntax" +./spec/myapp/under_test_spec.rb:16:will return all sorts of things +#<- entity.name.filename.build-output +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ entity.name.filename.build-output +# ^^ constant.numeric.line-number.build-output + + +[Finished in 705ms with exit code 1] +#<- comment.line.result.build-output +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.line.result.build-output