Sha256: 28d68c3bd9a0508a9de2f0a3d00bf03f9d1362061c01a905cb450c4cd9c5b0d6
Contents?: true
Size: 977 Bytes
Versions: 19
Compression:
Stored size: 977 Bytes
Contents
describe "A Symbol literal" do it "is a ':' followed by any number of valid characters" do a = :foo a.should be_kind_of(Symbol) # FIXME: this doesnt work as Symbols are Strings #a.inspect.should == ':foo' end it "is a ':' followed by any valid variable, method, or constant name" do # Add more of these? [ :Foo, :foo, :@foo, :@@foo, :$foo, :_, :~, :-, :FOO, :_Foo, :&, :_9 ].each { |s| s.should be_kind_of(Symbol) } end it "is a ':' followed by a single- or double-quoted string that may contain otherwise invalid characters" do [ [:'foo bar', ':"foo bar"'], [:'++', ':"++"'], [:'9', ':"9"'], [:"foo #{1 + 1}", ':"foo 2"'] ].each { # FIXME: Symbols are Strings, so #inspect wont work 1.should == 1 } end it "may contain '::' in the string" do :'Some::Class'.should be_kind_of(Symbol) end end
Version data entries
19 entries across 19 versions & 2 rubygems