Skip to content
Browse files

Created specs.

  • Loading branch information...
1 parent b7cd900 commit 64e28fad67ac30cd9769fcf6178e5d804e1ecc99 @jugyo committed May 23, 2009
Showing with 22 additions and 11 deletions.
  1. +22 −11 spec/g_spec.rb
View
33 spec/g_spec.rb
@@ -1,14 +1,25 @@
$:.unshift File.dirname(__FILE__) + '/../lib'
require 'g'
-g 'foo', 'bar'
-g 1
-g self
-g %w(foo bar)
-g ({:a=>"aaaaaaaaaaaaaaaaaa",
- :b=>"bbbbbbbbbbbbbbbbbbb",
- :c=>
- ["cccccccccccccccc",
- "CCCCCCCCCCCCCCCCC",
- "c c c c c ",
- "C C C C C C C C C "]})
+describe 'g' do
+ it 'calls with a arg' do
+ Kernel::GROWL.should_receive(:notify).with("Kernel.g", $0, 'foo'.pretty_inspect)
+ g 'foo'
+ end
+
+ it 'calls with args' do
+ Kernel::GROWL.should_receive(:notify).twice
+ g 'foo', 'bar'
+ end
+
+ it 'calls without args' do
+ Kernel::GROWL.should_receive(:notify).with("Kernel.g", $0, nil.pretty_inspect)
+ g
+ end
+
+ it 'should return original args' do
+ g('foo').should == 'foo'
+ g('foo', 'bar').should == ['foo', 'bar']
+ g().should == nil
+ end
+end

0 comments on commit 64e28fa

Please sign in to comment.
Something went wrong with that request. Please try again.