Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add new Matcher DSL snippet

  • Loading branch information...
commit b6f62fb426005a5e0e6368076e330f27d93ad288 1 parent 874cd73
@dchelimsky dchelimsky authored
View
10 Snippets/Custom Matcher.tmSnippet → Snippets/Matcher (Custom).tmSnippet
@@ -1,5 +1,5 @@
<?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">
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>content</key>
@@ -15,11 +15,11 @@
true
end
- def failure_message
+ def failure_message_for_should
"expected #{@actual.inspect} to $2 #{@$3.inspect}, but it didn't"
end
- def negative_failure_message
+ def failure_message_for_should_not
"expected #{@actual.inspect} not to $2 #{@$3.inspect}, but it did"
end
end
@@ -28,11 +28,11 @@ def ${2:reverse_to}(${3:expected})
$1.new($3)
end</string>
<key>name</key>
- <string>Custom Matcher</string>
+ <string>Matcher (Custom)</string>
<key>scope</key>
<string>source.ruby.rspec</string>
<key>tabTrigger</key>
- <string>mat</string>
+ <string>matc</string>
<key>uuid</key>
<string>55BF6C99-B4C4-4772-B7DC-0A18407E429C</string>
</dict>
View
21 Snippets/Matcher (DSL).tmSnippet
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>content</key>
+ <string>Spec::Matchers.create ${1::look_like} do |meringue|
+ match do |substance|
+ substance.looks_like?(meringue)
+ end
+end
+</string>
+ <key>name</key>
+ <string>Matcher (DSL)</string>
+ <key>scope</key>
+ <string>source.ruby.rspec</string>
+ <key>tabTrigger</key>
+ <string>mat</string>
+ <key>uuid</key>
+ <string>15CE9873-2B79-44C5-8B20-2DA3BBF97E9E</string>
+</dict>
+</plist>
View
3  info.plist
@@ -218,6 +218,7 @@
<string>ED8BDE00-5FD7-4E47-84FD-4B971557FD73</string>
<string>7D960FC5-4859-4328-A06B-73A3CF6763E0</string>
<string>1201777F-3AC4-4B2A-9A46-C215F891B07A</string>
+ <string>15CE9873-2B79-44C5-8B20-2DA3BBF97E9E</string>
<string>55BF6C99-B4C4-4772-B7DC-0A18407E429C</string>
<string>520CA137-E4FC-4DB0-92DA-980DFE54A35B</string>
<string>AF99B458-D589-414D-87C7-8FACD2EF9FD5</string>
@@ -276,8 +277,6 @@
<string>E79DAF3F-8960-47C1-A34C-3D0E4B0AF926</string>
<string>96F0A193-32F1-4A75-9093-5D20E36593EC</string>
<string>647C94D6-42FE-40F0-8618-73F7725BF59E</string>
- <string>73A67D49-CA5B-4B8A-9B62-003506276CDD</string>
- <string>FCB3248F-0AFD-4CB5-BF4F-1B7CDB807981</string>
<string>AC7FD3DD-A904-4B5B-8B02-4D6F04CD8ED4</string>
<string>240FDD9D-CD49-4917-9003-80A3E1DADFBA</string>
<string>B5906021-8E54-4863-A13B-EA46333DB5F1</string>
Please sign in to comment.
Something went wrong with that request. Please try again.