Sha256: cc2191b545bc21aa1029ed86fccf6c134d6769d30d69498694d772f9d1c5889e

Contents?: true

Size: 669 Bytes

Versions: 4

Compression:

Stored size: 669 Bytes

Contents

require File.expand_path('spec_helper.rb', File.dirname(__FILE__))
include CassandraCQL

describe "UUID" do
  it "should respond_to to_guid" do
    UUID.new.respond_to?(:to_guid)
  end

  it "should respond_to to_time" do
    UUID.new.respond_to?(:to_time)
  end
  
  it "should instantiate from raw bytes" do
    UUID.new("\252}\303\374\3137\021\340\237\214\251}\315\351 ]")
  end

  it "should instantiate from a Time object" do
    ts = Time.new
    UUID.new(ts).to_time.should eq(ts)
  end
  
  it "should turn have a to_time class method that takes bytes" do
    UUID.to_time("\252}\303\374\3137\021\340\237\214\251}\315\351 ]").should be_kind_of(Time)
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
hallelujah-cassandra-cql-1.0.4 spec/uuid_spec.rb
cassandra-cql-1.0.4 spec/uuid_spec.rb
cassandra-cql-1.0.2 spec/uuid_spec.rb
cassandra-cql-1.0.1 spec/uuid_spec.rb