Permalink
Browse files

Merge pull request #2 from mitio/master

Add snippets and a syntax definition
  • Loading branch information...
2 parents 865cf58 + 4f013b4 commit 378224a315ed0e1f87e32610976975ed234d5bc5 @barneywilliams barneywilliams committed Jan 7, 2012
Showing with 1,323 additions and 0 deletions.
  1. +142 −0 RSpec.tmLanguage
  2. +39 −0 Snippets/Custom Matcher.tmSnippet
  3. +20 −0 Snippets/Describe.tmSnippet
  4. +20 −0 Snippets/Describe_type.tmSnippet
  5. +20 −0 Snippets/Describe_type_string.tmSnippet
  6. +18 −0 Snippets/It.tmSnippet
  7. +16 −0 Snippets/Require spec_helper.tmSnippet
  8. +16 −0 Snippets/Set Controller for Spec.tmSnippet
  9. +21 −0 Snippets/Story.tmSnippet
  10. +16 −0 Snippets/and_raise.tmSnippet
  11. +16 −0 Snippets/and_return_block.tmSnippet
  12. +16 −0 Snippets/and_return_value.tmSnippet
  13. +16 −0 Snippets/and_throw.tmSnippet
  14. +16 −0 Snippets/and_yield.tmSnippet
  15. +16 −0 Snippets/any_number_of_times.tmSnippet
  16. +16 −0 Snippets/at_least.tmSnippet
  17. +16 −0 Snippets/at_most.tmSnippet
  18. +18 −0 Snippets/context.tmSnippet
  19. +20 −0 Snippets/controller_context.tmSnippet
  20. +18 −0 Snippets/controller_context_RESTful.tmSnippet
  21. +16 −0 Snippets/exactly.tmSnippet
  22. +16 −0 Snippets/it_should_behave_like.tmSnippet
  23. +17 −0 Snippets/mock.tmSnippet
  24. +16 −0 Snippets/once.tmSnippet
  25. +16 −0 Snippets/ordered.tmSnippet
  26. +17 −0 Snippets/response_should_be_success.tmSnippet
  27. +17 −0 Snippets/response_should_not_be_success.tmSnippet
  28. +18 −0 Snippets/setup.tmSnippet
  29. +17 −0 Snippets/should ==.tmSnippet
  30. +17 −0 Snippets/should =~.tmSnippet
  31. +17 −0 Snippets/should eql.tmSnippet
  32. +17 −0 Snippets/should_be.tmSnippet
  33. +17 −0 Snippets/should_be_a_kind_of.tmSnippet
  34. +17 −0 Snippets/should_be_an_instance_of.tmSnippet
  35. +17 −0 Snippets/should_be_close.tmSnippet
  36. +17 −0 Snippets/should_be_redirect.tmSnippet
  37. +17 −0 Snippets/should_equal.tmSnippet
  38. +17 −0 Snippets/should_have.tmSnippet
  39. +17 −0 Snippets/should_have_at_least.tmSnippet
  40. +17 −0 Snippets/should_have_at_most.tmSnippet
  41. +17 −0 Snippets/should_have_records.tmSnippet
  42. +17 −0 Snippets/should_match.tmSnippet
  43. +17 −0 Snippets/should_not ==.tmSnippet
  44. +17 −0 Snippets/should_not =~.tmSnippet
  45. +17 −0 Snippets/should_not eql.tmSnippet
  46. +17 −0 Snippets/should_not_be.tmSnippet
  47. +17 −0 Snippets/should_not_be_a_kind_of.tmSnippet
  48. +17 −0 Snippets/should_not_be_an_instance_of.tmSnippet
  49. +17 −0 Snippets/should_not_be_close.tmSnippet
  50. +17 −0 Snippets/should_not_be_redirect.tmSnippet
  51. +17 −0 Snippets/should_not_equal.tmSnippet
  52. +17 −0 Snippets/should_not_match.tmSnippet
  53. +17 −0 Snippets/should_not_predicate.tmSnippet
  54. +17 −0 Snippets/should_not_raise.tmSnippet
  55. +16 −0 Snippets/should_not_receive.tmSnippet
  56. +17 −0 Snippets/should_not_respond_to.tmSnippet
  57. +17 −0 Snippets/should_not_satisfy.tmSnippet
  58. +17 −0 Snippets/should_not_throw.tmSnippet
  59. +17 −0 Snippets/should_predicate.tmSnippet
  60. +17 −0 Snippets/should_raise.tmSnippet
  61. +16 −0 Snippets/should_receive.tmSnippet
  62. +16 −0 Snippets/should_receive_with_args.tmSnippet
  63. +17 −0 Snippets/should_redirect_to.tmSnippet
  64. +17 −0 Snippets/should_render.tmSnippet
  65. +17 −0 Snippets/should_respond_to.tmSnippet
  66. +17 −0 Snippets/should_satisfy.tmSnippet
  67. +17 −0 Snippets/should_throw.tmSnippet
  68. +18 −0 Snippets/teardown.tmSnippet
  69. +16 −0 Snippets/twice.tmSnippet
View
@@ -0,0 +1,142 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>fileTypes</key>
+ <array>
+ <string>spec.rb</string>
+ </array>
+ <key>foldingStartMarker</key>
+ <string>(?x)^
+ (\s*+
+ (module|class|def
+ |unless|if
+ |case
+ |begin
+ |for|while|until
+ |^=begin
+ |( "(\\.|[^"])*+" # eat a double quoted string
+ | '(\\.|[^'])*+' # eat a single quoted string
+ | [^#"'] # eat all but comments and strings
+ )*
+ ( \s (do|begin|case)
+ | (?&lt;!\$)[-+=&amp;|*/~%^&lt;&gt;~] \s*+ (if|unless)
+ )
+ )\b
+ (?! [^;]*+ ; .*? \bend\b )
+ |( "(\\.|[^"])*+" # eat a double quoted string
+ | '(\\.|[^'])*+' # eat a single quoted string
+ | [^#"'] # eat all but comments and strings
+ )*
+ ( \{ (?! [^}]*+ \} )
+ | \[ (?! [^\]]*+ \] )
+ )
+ ).*$
+ | [#] .*? \(fold\) \s*+ $ # Sune’s special marker
+ </string>
+ <key>foldingStopMarker</key>
+ <string>(?x)
+ ( (^|;) \s*+ end \s*+ ([#].*)? $
+ | (^|;) \s*+ end \. .* $
+ | ^ \s*+ [}\]] \s*+ ([#].*)? $
+ | [#] .*? \(end\) \s*+ $ # Sune’s special marker
+ | ^=end
+ )</string>
+ <key>keyEquivalent</key>
+ <string>^~R</string>
+ <key>name</key>
+ <string>RSpec</string>
+ <key>patterns</key>
+ <array>
+ <dict>
+ <key>match</key>
+ <string>(?&lt;!\.)\b(before|after)\b(?![?!])</string>
+ <key>name</key>
+ <string>keyword.other.special-method.ruby.rspec</string>
+ </dict>
+ <dict>
+ <key>include</key>
+ <string>#behaviour</string>
+ </dict>
+ <dict>
+ <key>include</key>
+ <string>#example</string>
+ </dict>
+ <dict>
+ <key>include</key>
+ <string>source.ruby</string>
+ </dict>
+ </array>
+ <key>repository</key>
+ <dict>
+ <key>behaviour</key>
+ <dict>
+ <key>begin</key>
+ <string>^\s*(describe)\b</string>
+ <key>beginCaptures</key>
+ <dict>
+ <key>1</key>
+ <dict>
+ <key>name</key>
+ <string>keyword.other.behaviour.ruby.rspec</string>
+ </dict>
+ </dict>
+ <key>end</key>
+ <string>\b(do)\s*$</string>
+ <key>endCaptures</key>
+ <dict>
+ <key>1</key>
+ <dict>
+ <key>name</key>
+ <string>keyword.control.start-block.ruby.rspec</string>
+ </dict>
+ </dict>
+ <key>name</key>
+ <string>meta.behaviour.ruby.rspec</string>
+ <key>patterns</key>
+ <array>
+ <dict>
+ <key>include</key>
+ <string>source.ruby</string>
+ </dict>
+ </array>
+ </dict>
+ <key>example</key>
+ <dict>
+ <key>begin</key>
+ <string>^\s*(it)\b</string>
+ <key>beginCaptures</key>
+ <dict>
+ <key>1</key>
+ <dict>
+ <key>name</key>
+ <string>keyword.other.example.ruby.rspec</string>
+ </dict>
+ </dict>
+ <key>end</key>
+ <string>\b(do)\s*$</string>
+ <key>endCaptures</key>
+ <dict>
+ <key>1</key>
+ <dict>
+ <key>name</key>
+ <string>keyword.control.start-block.ruby.rspec</string>
+ </dict>
+ </dict>
+ <key>name</key>
+ <string>meta.example.ruby.rspec</string>
+ <key>patterns</key>
+ <array>
+ <dict>
+ <key>include</key>
+ <string>source.ruby</string>
+ </dict>
+ </array>
+ </dict>
+ </dict>
+ <key>scopeName</key>
+ <string>source.ruby.rspec</string>
+ <key>uuid</key>
+ <string>923F0A10-96B9-4792-99A4-94FEF66E0B8C</string>
+</dict>
+</plist>
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>content</key>
+ <string>class ${1:ReverseTo}
+ def initialize($3)
+ @$3 = $3
+ end
+
+ def matches?(actual)
+ @actual = actual
+ # Satisfy expectation here. Return false or raise an error if it's not met.
+ ${0:@actual.reverse.should == @$3}
+ true
+ end
+
+ def failure_message
+ "expected #{@actual.inspect} to $2 #{@$3.inspect}, but it didn't"
+ end
+
+ def negative_failure_message
+ "expected #{@actual.inspect} not to $2 #{@$3.inspect}, but it did"
+ end
+end
+
+def ${2:reverse_to}(${3:expected})
+ $1.new($3)
+end</string>
+ <key>name</key>
+ <string>Custom Matcher</string>
+ <key>scope</key>
+ <string>source.ruby.rspec</string>
+ <key>tabTrigger</key>
+ <string>mat</string>
+ <key>uuid</key>
+ <string>55BF6C99-B4C4-4772-B7DC-0A18407E429C</string>
+</dict>
+</plist>
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>content</key>
+ <string>describe "${1:description}" do
+ it "should ${2:description}" do
+ $0
+ end
+end</string>
+ <key>name</key>
+ <string>describe (String)</string>
+ <key>scope</key>
+ <string>source.ruby.rspec</string>
+ <key>tabTrigger</key>
+ <string>des</string>
+ <key>uuid</key>
+ <string>34CBBD13-CE8E-4601-9968-C2CB0D771CA5</string>
+</dict>
+</plist>
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>content</key>
+ <string>describe ${1:Type} do
+ it "should ${2:description}" do
+ $0
+ end
+end</string>
+ <key>name</key>
+ <string>describe (type)</string>
+ <key>scope</key>
+ <string>source.ruby.rspec</string>
+ <key>tabTrigger</key>
+ <string>dest</string>
+ <key>uuid</key>
+ <string>2ED94046-DAF7-4C91-8D98-771513BB3804</string>
+</dict>
+</plist>
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>content</key>
+ <string>describe ${1:Type}, "${2:description}" do
+ it "should ${3:description}" do
+ $0
+ end
+end</string>
+ <key>name</key>
+ <string>describe (type, string)</string>
+ <key>scope</key>
+ <string>source.ruby.rspec</string>
+ <key>tabTrigger</key>
+ <string>dests</string>
+ <key>uuid</key>
+ <string>ACFE21E0-902B-45C4-BF54-D137718FF61C</string>
+</dict>
+</plist>
View
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>content</key>
+ <string>it "${1:description}" do
+ $0
+end</string>
+ <key>name</key>
+ <string>it</string>
+ <key>scope</key>
+ <string>source.ruby.rspec</string>
+ <key>tabTrigger</key>
+ <string>it</string>
+ <key>uuid</key>
+ <string>AD51AA2B-09C9-40DE-9720-2FD43C967FA9</string>
+</dict>
+</plist>
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>content</key>
+ <string>require File.dirname(__FILE__) + '/../spec_helper'</string>
+ <key>name</key>
+ <string>Require spec_helper</string>
+ <key>scope</key>
+ <string>source.ruby.rspec</string>
+ <key>tabTrigger</key>
+ <string>resh</string>
+ <key>uuid</key>
+ <string>DAD2B74D-2105-42B0-9FC5-466F3B3D0DB7</string>
+</dict>
+</plist>
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>content</key>
+ <string>controller_name :${1:controller}</string>
+ <key>name</key>
+ <string>controller_name</string>
+ <key>scope</key>
+ <string>source.ruby.rspec</string>
+ <key>tabTrigger</key>
+ <string>conn</string>
+ <key>uuid</key>
+ <string>57374EB7-6CCE-4281-97A7-289905315351</string>
+</dict>
+</plist>
View
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>content</key>
+ <string>Story "${1:title}", %{
+ As a${2:role}
+ I want ${3:feature}
+ So that ${4:value}
+} do
+end</string>
+ <key>name</key>
+ <string>Story</string>
+ <key>scope</key>
+ <string>source.ruby.rspec</string>
+ <key>tabTrigger</key>
+ <string>st</string>
+ <key>uuid</key>
+ <string>73A67D49-CA5B-4B8A-9B62-003506276CDD</string>
+</dict>
+</plist>
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>content</key>
+ <string>and_raise(${1:exception})</string>
+ <key>name</key>
+ <string>and_raise</string>
+ <key>scope</key>
+ <string>source.ruby.rspec</string>
+ <key>tabTrigger</key>
+ <string>anr</string>
+ <key>uuid</key>
+ <string>65B85B0D-26FC-4A08-8D6A-7BF00AA787FC</string>
+</dict>
+</plist>
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>content</key>
+ <string>and_return { $1 }</string>
+ <key>name</key>
+ <string>and_return with block</string>
+ <key>scope</key>
+ <string>source.ruby.rspec</string>
+ <key>tabTrigger</key>
+ <string>anrb</string>
+ <key>uuid</key>
+ <string>C57E9EFD-3FE7-40ED-832E-DD812D1FB769</string>
+</dict>
+</plist>
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>content</key>
+ <string>and_return(${1:value})</string>
+ <key>name</key>
+ <string>and_return with args</string>
+ <key>scope</key>
+ <string>source.ruby.rspec</string>
+ <key>tabTrigger</key>
+ <string>anra</string>
+ <key>uuid</key>
+ <string>804A1B15-0756-438F-892F-2B72BE4490F0</string>
+</dict>
+</plist>
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>content</key>
+ <string>and_throw(${1:sym})</string>
+ <key>name</key>
+ <string>and_throw</string>
+ <key>scope</key>
+ <string>source.ruby.rspec</string>
+ <key>tabTrigger</key>
+ <string>ant</string>
+ <key>uuid</key>
+ <string>2CC293EE-496A-4B66-928C-332DDCBEE884</string>
+</dict>
+</plist>
Oops, something went wrong.

0 comments on commit 378224a

Please sign in to comment.