1 require File.dirname(__FILE__) + '/../../spec_helper'
2 require File.dirname(__FILE__) + '/fixtures/classes'
4 describe "Kernel#to_a" do
5 it "is defined on Kernel" do
6 Kernel.instance_methods.should include('to_a')
10 describe "Kernel#to_a when the receiver is an Array" do
13 array.to_a.should equal(array)
17 describe "Kernel#to_a when the receiver is not an Array" do
18 it "returns an Array containing self" do
19 object = "I am not an array"
20 object.to_a.should == [object]