Permalink
Browse files

added yasnippet-compatible versions of most* rSpec snippets from text…

…mate.

see the README for differences.
  • Loading branch information...
1 parent 00d867e commit c407d2a940b1f9351e7d09de0579183b5e38ef6a @gary committed Sep 7, 2008
Showing with 499 additions and 0 deletions.
  1. +4 −0 TODO
  2. +7 −0 rspec-snippets/aft
  3. +5 −0 rspec-snippets/annot
  4. +5 −0 rspec-snippets/anr
  5. +5 −0 rspec-snippets/anra
  6. +5 −0 rspec-snippets/anrb
  7. +5 −0 rspec-snippets/ant
  8. +3 −0 rspec-snippets/any
  9. +5 −0 rspec-snippets/atl
  10. +5 −0 rspec-snippets/atm
  11. +7 −0 rspec-snippets/bef
  12. +5 −0 rspec-snippets/conn
  13. +11 −0 rspec-snippets/des
  14. +11 −0 rspec-snippets/desc
  15. +11 −0 rspec-snippets/desrc.delete
  16. +11 −0 rspec-snippets/desrc.get
  17. +11 −0 rspec-snippets/desrc.post
  18. +11 −0 rspec-snippets/desrc.put
  19. +11 −0 rspec-snippets/dest
  20. +11 −0 rspec-snippets/dests
  21. +5 −0 rspec-snippets/ex
  22. +6 −0 rspec-snippets/fm
  23. +6 −0 rspec-snippets/fmar
  24. +7 −0 rspec-snippets/it
  25. +28 −0 rspec-snippets/mat
  26. +7 −0 rspec-snippets/mocw.flexmock
  27. +7 −0 rspec-snippets/mocw.mocha
  28. +7 −0 rspec-snippets/mocw.rr
  29. +5 −0 rspec-snippets/on
  30. +5 −0 rspec-snippets/resh
  31. +10 −0 rspec-snippets/sce
  32. +6 −0 rspec-snippets/sh=
  33. +6 −0 rspec-snippets/shb
  34. +6 −0 rspec-snippets/shbc
  35. +6 −0 rspec-snippets/shbio
  36. +6 −0 rspec-snippets/shbko
  37. +6 −0 rspec-snippets/shbr
  38. +6 −0 rspec-snippets/shbs
  39. +6 −0 rspec-snippets/she.eql
  40. +6 −0 rspec-snippets/she.equal
  41. +6 −0 rspec-snippets/shh
  42. +6 −0 rspec-snippets/shhal
  43. +6 −0 rspec-snippets/shham
  44. +6 −0 rspec-snippets/shhr
  45. +6 −0 rspec-snippets/shm.match
  46. +6 −0 rspec-snippets/shm.~
  47. +6 −0 rspec-snippets/shn=
  48. +6 −0 rspec-snippets/shnb
  49. +6 −0 rspec-snippets/shnbc
  50. +6 −0 rspec-snippets/shnbio
  51. +6 −0 rspec-snippets/shnbko
  52. +6 −0 rspec-snippets/shnbr
  53. +6 −0 rspec-snippets/shnbs
  54. +6 −0 rspec-snippets/shne.eql
  55. +6 −0 rspec-snippets/shne.equal
  56. +6 −0 rspec-snippets/shnm.match
  57. +6 −0 rspec-snippets/shnm.~
  58. +5 −0 rspec-snippets/shnp
  59. +5 −0 rspec-snippets/shnr
  60. +6 −0 rspec-snippets/shnre
  61. +6 −0 rspec-snippets/shnrt
  62. +6 −0 rspec-snippets/shns
  63. +6 −0 rspec-snippets/shnt
  64. +5 −0 rspec-snippets/shp
  65. +5 −0 rspec-snippets/shr
  66. +6 −0 rspec-snippets/shre
  67. +6 −0 rspec-snippets/shrt.redirect
  68. +6 −0 rspec-snippets/shrt.render
  69. +6 −0 rspec-snippets/shrt.respond
  70. +6 −0 rspec-snippets/shs
  71. +6 −0 rspec-snippets/sht
  72. +10 −0 rspec-snippets/sto
  73. +5 −0 rspec-snippets/tw
  74. +6 −0 rspec-snippets/wia
View
4 TODO
@@ -0,0 +1,4 @@
+elunit
+
+missing conversions:
+moc: mock
View
@@ -0,0 +1,7 @@
+#-*- require-final-newline: nil -*-
+#contributor: gary <ge.iams@gmail.com>
+#name : after
+# --
+after(${1::each}) do
+ $0
+end
View
@@ -0,0 +1,5 @@
+#-*- require-final-newline: nil -*-
+#contributor: gary <ge.iams@gmail.com>
+#name : any_number_of_times
+# --
+any_number_of_times
View
@@ -0,0 +1,5 @@
+#-*- require-final-newline: nil -*-
+#contributor: gary <ge.iams@gmail.com>
+#name : and_raise
+# --
+and_raise(${1:exception})
View
@@ -0,0 +1,5 @@
+#-*- require-final-newline: nil -*-
+#contributor: gary <ge.iams@gmail.com>
+#name : and_return with args
+# --
+and_return(${1:value})
View
@@ -0,0 +1,5 @@
+#-*- require-final-newline: nil -*-
+#contributor: gary <ge.iams@gmail.com>
+#name : and_return with block
+# --
+and_return { $1 }
View
@@ -0,0 +1,5 @@
+#-*- require-final-newline: nil -*-
+#contributor: gary <ge.iams@gmail.com>
+#name : and_throw
+# --
+and_throw(${1:sym})
View
@@ -0,0 +1,3 @@
+#name : any? { |...| ... }
+# --
+any? { |${e}| $0 }
View
@@ -0,0 +1,5 @@
+#-*- require-final-newline: nil -*-
+#contributor: gary <ge.iams@gmail.com>
+#name : at_least
+# --
+at_least(${1:n}).times
View
@@ -0,0 +1,5 @@
+#-*- require-final-newline: nil -*-
+#contributor: gary <ge.iams@gmail.com>
+#name : at_most
+# --
+at_most(${1:n}).times
View
@@ -0,0 +1,7 @@
+#-*- require-final-newline: nil -*-
+#contributor: gary <ge.iams@gmail.com>
+#name : before
+# --
+before(${1::each}) do
+ $0
+end
View
@@ -0,0 +1,5 @@
+#-*- require-final-newline: nil -*-
+#contributor: gary <ge.iams@gmail.com>
+#name : controller_name
+# --
+controller_name :${1:controller}
View
@@ -0,0 +1,11 @@
+#-*- require-final-newline: nil -*-
+#contributor: gary <ge.iams@gmail.com>
+#name : describe (String)
+# --
+describe '${1:description}' do
+
+ it 'should ${2:description}' do
+ $0
+ end
+
+end
View
@@ -0,0 +1,11 @@
+#-*- require-final-newline: nil -*-
+#contributor: gary <ge.iams@gmail.com>
+#name : describe (Controller)
+# --
+require File.dirname(__FILE__) + '/../spec_helper'
+
+describe ${1:controller} do
+
+ $0
+
+end
@@ -0,0 +1,11 @@
+#-*- require-final-newline: nil -*-
+#contributor: gary <ge.iams@gmail.com>
+#name : describe (RESTful Controller): DELETE
+# --
+require File.direname(__FILE__) + '/.../spec_helper'
+
+describe ${1:controller}, 'DELETE ${3:/some/path}${4: with some parameters}' do
+
+ $0
+
+end
View
@@ -0,0 +1,11 @@
+#-*- require-final-newline: nil -*-
+#contributor: gary <ge.iams@gmail.com>
+#name : describe (RESTful Controller): GET
+# --
+require File.direname(__FILE__) + '/.../spec_helper'
+
+describe ${1:controller}, 'GET ${3:/some/path}${4: with some parameters}' do
+
+ $0
+
+end
View
@@ -0,0 +1,11 @@
+#-*- require-final-newline: nil -*-
+#contributor: gary <ge.iams@gmail.com>
+#name : describe (RESTful Controller): POST
+# --
+require File.direname(__FILE__) + '/.../spec_helper'
+
+describe ${1:controller}, 'POST ${3:/some/path}${4: with some parameters}' do
+
+ $0
+
+end
View
@@ -0,0 +1,11 @@
+#-*- require-final-newline: nil -*-
+#contributor: gary <ge.iams@gmail.com>
+#name : describe (RESTful Controller): PUT
+# --
+require File.direname(__FILE__) + '/.../spec_helper'
+
+describe ${1:controller}, 'PUT ${3:/some/path}${4: with some parameters}' do
+
+ $0
+
+end
View
@@ -0,0 +1,11 @@
+#-*- require-final-newline: nil -*-
+#contributor: gary <ge.iams@gmail.com>
+#name : describe (type)
+# --
+describe ${1:Type} do
+
+ it 'should ${2:description}' do
+ $0
+ end
+
+end
View
@@ -0,0 +1,11 @@
+#-*- require-final-newline: nil -*-
+#contributor: gary <ge.iams@gmail.com>
+#name : describe (type, string)
+# --
+describe ${1:Type}, '${2:description}' do
+
+ it 'should ${3:description}' do
+ $0
+ end
+
+end
View
@@ -0,0 +1,5 @@
+#-*- require-final-newline: nil -*-
+#contributor: gary <ge.iams@gmail.com>
+#name : exactly
+# --
+exactly(${1:n}).times
View
@@ -0,0 +1,6 @@
+#-*- require-final-newline: nil -*-
+#contributor: gary <ge.iams@gmail.com>
+#name : flexmock mock object w/name
+# --
+${1:var} = flexmock('${2:mock_name}')
+$0
View
@@ -0,0 +1,6 @@
+#-*- require-final-newline: nil -*-
+#contributor: gary <ge.iams@gmail.com>
+#name : flexmock mock object, ActiveRecord
+# --
+${1:var} = flexmock(:model, ${2:YourModel})
+$0
View
@@ -0,0 +1,7 @@
+#-*- require-final-newline: nil -*-
+#contributor: gary <ge.iams@gmail.com>
+#it ... end
+# --
+it 'should ${1:description}' do
+ $0
+end
View
@@ -0,0 +1,28 @@
+#-*- require-final-newline: nil -*-
+#contributor: gary <ge.iams@gmail.com>
+#name : custom matcher
+# --
+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
@@ -0,0 +1,7 @@
+#-*- require-final-newline: nil -*-
+#contributor: gary <ge.iams@gmail.com>
+#name : mock_with flexmock
+# --
+Spec::Runner.configure do |config|
+ config.mock_with :flexmock
+end
@@ -0,0 +1,7 @@
+#-*- require-final-newline: nil -*-
+#contributor: gary <ge.iams@gmail.com>
+#name : mock_with mocha
+# --
+Spec::Runner.configure do |config|
+ config.mock_with :mocha
+end
View
@@ -0,0 +1,7 @@
+#-*- require-final-newline: nil -*-
+#contributor: gary <ge.iams@gmail.com>
+#name : mock_with rr
+# --
+Spec::Runner.configure do |config|
+ config.mock_with :rr
+end
View
@@ -0,0 +1,5 @@
+#-*- require-final-newline: nil -*-
+#contributor: gary <ge.iams@gmail.com>
+#name : once
+# --
+once
View
@@ -0,0 +1,5 @@
+#-*- require-final-newline: nil -*-
+#contributor: gary <ge.iams@gmail.com>
+#name : Require spec_helper
+# --
+require File.dirname(__FILE__) + '/../spec_helper'
View
@@ -0,0 +1,10 @@
+#-*- require-final-newline: nil -*-
+#contributor: gary <ge.iams@gmail.com>
+#name : Scenario
+# --
+Scenario '${1:title}' do
+ Given '${2:given}'
+ When '${3:when}'
+ Then '${4:then}'
+end
+$0
View
@@ -0,0 +1,6 @@
+#-*- require-final-newline: nil -*-
+#contributor: gary <ge.iams@gmail.com>
+#name : should ==
+# --
+${1:target}.should == ${2:value}
+$0
View
@@ -0,0 +1,6 @@
+#-*- require-final-newline: nil -*-
+#contributor: gary <ge.iams@gmail.com>
+#name : should be
+# --
+${1:target}.should be(${2:result})
+$0
View
@@ -0,0 +1,6 @@
+#-*- require-final-newline: nil -*-
+#contributor: gary <ge.iams@gmail.com>
+#name : should be_close
+# --
+${1:target}.should be_close(${2:result}, ${3:tolerance})
+$0
View
@@ -0,0 +1,6 @@
+#-*- require-final-newline: nil -*-
+#contributor: gary <ge.iams@gmail.com>
+#name : should be_instance_of
+# --
+${1:target}.should be_instance_of(${2:klass})
+$0
View
@@ -0,0 +1,6 @@
+#-*- require-final-newline: nil -*-
+#contributor: gary <ge.iams@gmail.com>
+#name : should be_kind_of
+# --
+${1:target}.should be_a_kind_of(${2:klass})
+$0
View
@@ -0,0 +1,6 @@
+#-*- require-final-newline: nil -*-
+#contributor: gary <ge.iams@gmail.com>
+#name : should be_redirect
+# --
+response.should be_redirect
+$0
View
@@ -0,0 +1,6 @@
+#-*- require-final-newline: nil -*-
+#contributor: gary <ge.iams@gmail.com>
+#name : should be_success
+# --
+response.should be_success
+$0
View
@@ -0,0 +1,6 @@
+#-*- require-final-newline: nil -*-
+#contributor: gary <ge.iams@gmail.com>
+#name : should eql
+# --
+${1:target}.should eql(${2:value})
+$0
View
@@ -0,0 +1,6 @@
+#-*- require-final-newline: nil -*-
+#contributor: gary <ge.iams@gmail.com>
+#name : should equal
+# --
+${1:target}.should equal(${2:value})
+$0
View
@@ -0,0 +1,6 @@
+#-*- require-final-newline: nil -*-
+#contributor: gary <ge.iams@gmail.com>
+#name : should have
+# --
+${1:target}.should have(${2:num}).${3:things}
+$0
View
@@ -0,0 +1,6 @@
+#-*- require-final-newline: nil -*-
+#contributor: gary <ge.iams@gmail.com>
+#name : should have_at_least
+# --
+${1:target}.should have_at_least(${2:num}).${3:things}
+$0
View
@@ -0,0 +1,6 @@
+#-*- require-final-newline: nil -*-
+#contributor: gary <ge.iams@gmail.com>
+#name : should have_at_most
+# --
+${1:target}.should have_at_most(${2:num}).${3:things}
+$0
Oops, something went wrong.

0 comments on commit c407d2a

Please sign in to comment.