Created
February 27, 2012 17:27
-
-
Save developwithpassion/1925656 to your computer and use it in GitHub Desktop.
Revisions
-
developwithpassion revised this gist
Feb 27, 2012 . 1 changed file with 0 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,9 +1,4 @@ module RSpec Matchers.define :have_received do|symbol,*args| match do|fake| -
developwithpassion revised this gist
Feb 27, 2012 . 1 changed file with 0 additions and 6 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,10 +1,4 @@ module RSpec Matchers.define :end_with do|end_of_string| match do|string_element| string_element.end_with?(end_of_string) -
developwithpassion renamed this gist
Feb 27, 2012 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
developwithpassion created this gist
Feb 27, 2012 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,31 @@ module RSpec Matchers.define :start_with do|start_of_string| match do|string_element| string_element.start_with?(start_of_string) end end Matchers.define :end_with do|end_of_string| match do|string_element| string_element.end_with?(end_of_string) end end Matchers.define :have_received do|symbol,*args| match do|fake| result = true method = fake.received(symbol) result &= method != nil unless (args.count == 0) result &= method.called_with(*args) != nil end result end end Matchers.define :never_received do|symbol| match do|fake| fake.never_received?(symbol) end end end