Sha256: 486bf09acb36282f8205d1d2ef4e48a90222332d44b4709246dc346c8962892f

Contents?: true

Size: 547 Bytes

Versions: 2

Compression:

Stored size: 547 Bytes

Contents

require 'spec_helper'
require 'r10k/util/monkey_patches'

describe Symbol, "comparison operator", :if => RUBY_VERSION == '1.8.7' do
  it "returns nil if the other value is incomparable" do
    expect(:aaa <=> 'bbb').to be_nil
  end

  it "returns -1 if the value sorts lower than the compared value" do
    expect(:aaa <=> :bbb).to eq(-1)
  end

  it "returns 0 if the values are equal" do
    expect(:aaa <=> :aaa).to eq(0)
  end

  it "returns 1 if the value sorts higher than the compared value" do
    expect(:bbb <=> :aaa).to eq(1)
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
r10k-1.5.1 spec/unit/util/monkey_patches_spec.rb
r10k-1.4.2 spec/unit/util/monkey_patches_spec.rb