Skip to content
This repository has been archived by the owner on May 19, 2022. It is now read-only.

Commit

Permalink
Removed old int cast tests.
Browse files Browse the repository at this point in the history
These tests didn't do what they claimed to and have been replaced
by tests in roundtrip_spec.
  • Loading branch information
psanford committed Sep 12, 2011
1 parent 2d0ff43 commit 37e1f7f
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions spec/column_family_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
}.to raise_error NoMethodError
end
end

context "with a standard column family" do
it "should be standard" do
standard_column_family.type.should eq("Standard")
Expand Down Expand Up @@ -55,14 +55,6 @@
ColumnFamily.cast(uuid.bytes, "org.apache.cassandra.db.marshal.UUIDType").should eq(uuid)
end

it "should turn a packed integer into a Fixnum" do
ColumnFamily.cast([0x7FFFFFFF].pack("N"), "org.apache.cassandra.db.marshal.IntegerType").should eq(0x7FFFFFFF)
end

it "should turn a packed negative integer into a negative Fixnum" do
ColumnFamily.cast([-68047].pack("N"), "org.apache.cassandra.db.marshal.IntegerType").should eq(-68047)
end

it "should turn a packed long into a number" do
number = 2**33
packed = [number >> 32, number].pack("N*")
Expand Down Expand Up @@ -90,19 +82,19 @@
obj.should_receive(:to_s)
ColumnFamily.cast(obj, "org.apache.cassandra.db.marshal.UTF8Type")
end

it "should return self with BytesType" do
obj = Object.new
ColumnFamily.cast(obj, "org.apache.cassandra.db.marshal.BytesType").object_id.should eq(obj.object_id)
end
end

context "validations classes" do
let(:column_family) { ColumnFamily.new(yaml_fixture(:standard_with_validations)) }
it "should have a hash of column_names and validations" do
column_family.columns.should be_kind_of(Hash)
end

it "should have a default validation class" do
column_family.columns.default.should eq(column_family.cf_def.default_validation_class)
end
Expand All @@ -112,4 +104,4 @@
column_family.columns[column_family.key_alias].should eq(column_family.key_validation_class)
end
end
end
end

0 comments on commit 37e1f7f

Please sign in to comment.