Sha256: 9e367d4aaf140b8b73b5ad67848eff352167a0c69554396e38635e80b7143d9b

Contents?: true

Size: 703 Bytes

Versions: 9

Compression:

Stored size: 703 Bytes

Contents

require 'spec_helper'

describe 'Primitives for symbols' do
  describe 'intern' do
    it 'converts a string to its corresponding symbol' do
      kl_eval('(intern "foo")').should == :foo
    end

    it 'supports characters not allowed in symbol literals' do
      kl_eval('(intern "[{|}]")').should == :"[{|}]"
    end

    it 'converts the string "true" to boolean true' do
      kl_eval('(intern "true")').should == true
    end

    it 'converts the string "false" to boolean false' do
      kl_eval('(intern "false")').should == false
    end

    include_examples 'argument types', %w(intern "foo"), 1 => [:string]
    include_examples 'partially-applicable function', %w(intern "foo")
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
shen-ruby-0.10.0 k_lambda_spec/primitives/symbols_spec.rb
shen-ruby-0.9.0 k_lambda_spec/primitives/symbols_spec.rb
shen-ruby-0.8.1 k_lambda_spec/primitives/symbols_spec.rb
shen-ruby-0.8.0 k_lambda_spec/primitives/symbols_spec.rb
shen-ruby-0.7.0 k_lambda_spec/primitives/symbols_spec.rb
shen-ruby-0.6.0 k_lambda_spec/primitives/symbols_spec.rb
shen-ruby-0.5.0 k_lambda_spec/primitives/symbols_spec.rb
shen-ruby-0.4.1 k_lambda_spec/primitives/symbols_spec.rb
shen-ruby-0.4.0 k_lambda_spec/primitives/symbols_spec.rb