Sha256: 794ce3ea57e3471692b652e096004b88c7c433843cdf7eb370bc34fb3f90b67f

Contents?: true

Size: 1.19 KB

Versions: 7

Compression:

Stored size: 1.19 KB

Contents

require File.dirname(__FILE__) + '/../spec_helper'
require 'aquarium/extensions/symbol'

describe "Symbol#empty?" do
  
  it "should return true for an empty symbol with whitespace" do
    :" \t ".empty?.should be_true
  end
  
  it "should return false for a non-empty symbol" do
    :x.empty?.should be_false
  end
end

describe "Symbol#strip" do
  it "should return equivalent Symbol if there is no leading or trailing whitespace." do
    :a.strip.should == :a
  end

  it "should return new Symbol with removed leading and/or trailing whitespace, when present." do
    :" \ta\t ".strip.should == :a
  end
end

describe "Symbol#<=>" do
  it "should return < 0 if the string representation of the left-hand side symbol is less than the string representation of the right-hand side symbol." do
    (:a <=> :b).should == -1
  end

  it "should return > 0 if the string representation of the left-hand side symbol is greater than the string representation of the right-hand side symbol." do
    (:b <=> :a).should == 1
  end

  it "should return 0 if the string representation of the left-hand side symbol is equal to the string representation of the right-hand side symbol." do
    (:a <=> :a).should == 0
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
aquarium-0.4.4 spec/aquarium/extensions/symbol_spec.rb
aquarium-0.3.0 spec/aquarium/extensions/symbol_spec.rb
aquarium-0.3.1 spec/aquarium/extensions/symbol_spec.rb
aquarium-0.4.1 spec/aquarium/extensions/symbol_spec.rb
aquarium-0.4.2 spec/aquarium/extensions/symbol_spec.rb
aquarium-0.4.3 spec/aquarium/extensions/symbol_spec.rb
aquarium-0.4.0 spec/aquarium/extensions/symbol_spec.rb