Sha256: d92cdaa4ce99aadecfa35ea4fa3f64234994458a468b097cad4751534f0cd034

Contents?: true

Size: 489 Bytes

Versions: 5

Compression:

Stored size: 489 Bytes

Contents

require 'spec/spec_helper'

describe Scrooge::Core::String do
  
  before(:each) do
    @string = 'scrooge/base'
  end
  
  it "should be able to convert itself to a constant" do
    @string.to_const().should == 'Scrooge::Base'
  end
  
  it "should be able to convert itself to a class" do
    @string.to_const!( false ).should == Scrooge::Base
  end
  
  it "should return self if it's not able to constantize" do
    'not/defined'.to_const!( false ).should == 'not/defined'
  end
  
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
methodmissing-scrooge-1.0.0 spec/units/scrooge/core/string_spec.rb
methodmissing-scrooge-1.0.1 spec/units/scrooge/core/string_spec.rb
methodmissing-scrooge-1.0.2 spec/units/scrooge/core/string_spec.rb
methodmissing-scrooge-1.0.3 spec/units/scrooge/core/string_spec.rb
methodmissing-scrooge-1.0.4 spec/units/scrooge/core/string_spec.rb