mirror of
https://github.com/awesome-print/awesome_print
synced 2023-03-27 23:22:34 -04:00
Merge branch 'master' of git://github.com/shageman/awesome_print into shageman/master
This commit is contained in:
commit
52bb3e7adb
3 changed files with 17 additions and 0 deletions
|
@ -129,6 +129,14 @@ Supported color names:
|
||||||
[19] upcase!() String
|
[19] upcase!() String
|
||||||
]
|
]
|
||||||
|
|
||||||
|
$ cat > 6.rb
|
||||||
|
require "ap"
|
||||||
|
ap(42 == ap(42))
|
||||||
|
^D
|
||||||
|
$ ruby 6.rb
|
||||||
|
42
|
||||||
|
true
|
||||||
|
|
||||||
### Example (Rails console) ###
|
### Example (Rails console) ###
|
||||||
$ ruby script/console
|
$ ruby script/console
|
||||||
Loading development environment (Rails 2.3.5)
|
Loading development environment (Rails 2.3.5)
|
||||||
|
|
|
@ -13,6 +13,7 @@ module Kernel
|
||||||
|
|
||||||
def ap(object, options = {})
|
def ap(object, options = {})
|
||||||
puts object.ai(options)
|
puts object.ai(options)
|
||||||
|
object
|
||||||
end
|
end
|
||||||
alias :awesome_print :ap
|
alias :awesome_print :ap
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,14 @@ describe "AwesomePrint" do
|
||||||
stub_dotfile!
|
stub_dotfile!
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe "ap method" do
|
||||||
|
it "return value" do
|
||||||
|
object = rand
|
||||||
|
self.stub!(:puts)
|
||||||
|
(ap object).should eql(object)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
describe "Array" do
|
describe "Array" do
|
||||||
before(:each) do
|
before(:each) do
|
||||||
@arr = [ 1, :two, "three", [ nil, [ true, false] ] ]
|
@arr = [ 1, :two, "three", [ nil, [ true, false] ] ]
|
||||||
|
|
Loading…
Reference in a new issue