Skip to content

Instantly share code, notes, and snippets.

@developwithpassion
Created February 27, 2012 17:27
Show Gist options
  • Select an option

  • Save developwithpassion/1925656 to your computer and use it in GitHub Desktop.

Select an option

Save developwithpassion/1925656 to your computer and use it in GitHub Desktop.

Revisions

  1. developwithpassion revised this gist Feb 27, 2012. 1 changed file with 0 additions and 5 deletions.
    5 changes: 0 additions & 5 deletions gistfile1.rb
    Original file line number Diff line number Diff line change
    @@ -1,9 +1,4 @@
    module RSpec
    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|
  2. developwithpassion revised this gist Feb 27, 2012. 1 changed file with 0 additions and 6 deletions.
    6 changes: 0 additions & 6 deletions gistfile1.rb
    Original file line number Diff line number Diff line change
    @@ -1,10 +1,4 @@
    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)
  3. developwithpassion renamed this gist Feb 27, 2012. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  4. developwithpassion created this gist Feb 27, 2012.
    31 changes: 31 additions & 0 deletions gistfile1.txt
    Original 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