/
trpl002.rb
55 lines (39 loc) · 946 Bytes
/
trpl002.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
describe "Some Ruby Classes" do
#----- String, Fixnum, Float ------
it "Should be a String" do
"Joe".class.should == String
end
it "Should be a Fixnum" do
9.class.should == Fixnum
end
it "Should be a Float" do
8.7.class.should == Float
end
#----- Collection Types -----------
it "Should be an Array" do
[].class.should == Array
end
it "Should be a Hash" do
{}.class.should == Hash
end
it "Should be a Range" do
(0..9).class.should == Range
end
#----- Regex, Symbol --------------
it "Should be a Regexp" do
//.class.should == Regexp
end
it "Should be a Symbol" do
:name.class.should == Symbol
end
#----- True, False, Nil -----------
it "Should be a TrueClass" do
true.class.should == TrueClass
end
it "Should be a FalseClass" do
false.class.should == FalseClass
end
it "Should be a NilClass" do
nil.class.should == NilClass
end
end