Skip to content

Instantly share code, notes, and snippets.

@jamesmartin
Forked from oleander/gist:819329
Created February 9, 2011 21:35
Show Gist options
  • Save jamesmartin/819341 to your computer and use it in GitHub Desktop.
Save jamesmartin/819341 to your computer and use it in GitHub Desktop.
module RadioChannels
def self.get_data(url)
# Some code
end
def mixed_in_method(url)
RadioChannels.get_data(url)
end
end
class Example
include RadioChannels
def call_mixed_in_method(arg)
mixed_in_method(arg)
end
end
describe "setting expectations on a Module's pseudo-self methods" do
before do
RadioChannels.should_receive(:get_data).with('foo')
end
it "calls 'pseudo-module-self' methods via a mixed in method" do
example = Example.new
example.mixed_in_method('foo')
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment