Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 474a85431a
Fetching contributors…

Cannot retrieve contributors at this time

27 lines (22 sloc) 0.724 kb
$:.unshift File.dirname(__FILE__) + '/../lib'
require 'g'
describe 'g' do
it 'calls with a arg' do
GNTP.should_receive(:notify).with(:app_name => $0, :title => "g", :text => "foo")
g('foo').should == 'foo'
end
it 'calls with args' do
GNTP.should_receive(:notify).exactly(2).times
g('foo', 1).should == ['foo', 1]
end
it 'calls for instance' do
object = Object.new
GNTP.should_receive(:notify).with(:app_name => $0, :title => "g", :text => object.pretty_inspect)
object.g.should == object
end
it 'calls with &block' do
object = "foo"
GNTP.should_receive(:notify).with(:app_name => $0, :title => "g", :text => "FOO")
object.g {|i| i.upcase}.should == object
end
end
Jump to Line
Something went wrong with that request. Please try again.