Sha256: a324256b7157ff17729abef270df4167ae61f20816bc77a2f2b7bc0ad8fcce30
Contents?: true
Size: 956 Bytes
Versions: 23
Compression:
Stored size: 956 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 } end it "may contain '::' in the string" do :'Some::Class'.should be_kind_of(Symbol) end end
Version data entries
23 entries across 23 versions & 1 rubygems