Sha256: 454dcd5924a87e1a55550c5f6465fbb11e901ab0d5ed5135842e6f788de72607

Contents?: true

Size: 604 Bytes

Versions: 83

Compression:

Stored size: 604 Bytes

Contents

describe :string_to_sym, :shared => true do
  it "returns the symbol corresponding to self" do
    "Koala".send(@method).should == :Koala
    'cat'.send(@method).should == :cat
    '@cat'.send(@method).should == :@cat
    'cat and dog'.send(@method).should == :"cat and dog"
    "abc=".send(@method).should == :abc=
  end

  ruby_version_is ""..."1.9" do
    it "raises an ArgumentError when self can't be converted to symbol" do
      lambda { "".send(@method)           }.should raise_error(ArgumentError)
      lambda { "foo\x00bar".send(@method) }.should raise_error(ArgumentError)
    end
  end
end

Version data entries

83 entries across 83 versions & 1 rubygems

Version Path
rhodes-3.1.1 spec/framework_spec/app/spec/core/string/shared/to_sym.rb
rhodes-3.1.1.beta spec/framework_spec/app/spec/core/string/shared/to_sym.rb
rhodes-3.1.0 spec/framework_spec/app/spec/core/string/shared/to_sym.rb
rhodes-3.1.0.beta.5 spec/framework_spec/app/spec/core/string/shared/to_sym.rb
rhodes-3.1.0.beta.4 spec/framework_spec/app/spec/core/string/shared/to_sym.rb
rhodes-3.1.0.beta.3 spec/framework_spec/app/spec/core/string/shared/to_sym.rb
rhodes-3.1.0.beta.2 spec/framework_spec/app/spec/core/string/shared/to_sym.rb
rhodes-3.1.0.beta.1 spec/framework_spec/app/spec/core/string/shared/to_sym.rb
rhodes-3.0.2 spec/framework_spec/app/spec/core/string/shared/to_sym.rb
rhodes-3.0.2.beta.1 spec/framework_spec/app/spec/core/string/shared/to_sym.rb
rhodes-3.0.1 spec/framework_spec/app/spec/core/string/shared/to_sym.rb
rhodes-3.0.1.beta.8 spec/framework_spec/app/spec/core/string/shared/to_sym.rb
rhodes-3.0.1.beta.7 spec/framework_spec/app/spec/core/string/shared/to_sym.rb
rhodes-3.0.1.beta.6 spec/framework_spec/app/spec/core/string/shared/to_sym.rb
rhodes-3.0.1.beta.5 spec/framework_spec/app/spec/core/string/shared/to_sym.rb
rhodes-3.0.1.beta.4 spec/framework_spec/app/spec/core/string/shared/to_sym.rb
rhodes-3.0.1.beta.3 spec/framework_spec/app/spec/core/string/shared/to_sym.rb
rhodes-3.0.1.beta.2 spec/framework_spec/app/spec/core/string/shared/to_sym.rb
rhodes-3.0.0 spec/framework_spec/app/spec/core/string/shared/to_sym.rb
rhodes-3.0.0.beta.7 spec/framework_spec/app/spec/core/string/shared/to_sym.rb