Skip to content
This repository has been archived by the owner on Feb 28, 2021. It is now read-only.

Commit

Permalink
Fixed two specs.
Browse files Browse the repository at this point in the history
  • Loading branch information
postmodern committed Jun 24, 2011
1 parent 4f27ecb commit 25b09a7
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions spec/unit/checksumed_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,21 @@
require 'models/url'

describe DataMapper::Is::Checksumed do
describe "Checksumed[]" do
subject { DataMapper::Is::Checksumed }
subject { Url }
before(:all) { subject.auto_migrate! }

describe "checksum" do
let(:expected) { '2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824' }

it "should calculate SHA256 checksums" do
subject.checksum('hello').should == expected
DataMapper::Is::Checksumed.checksum('hello').should == expected
end

it "should convert non-Strings to Strings" do
subject.checksum(:hello).should == expected
DataMapper::Is::Checksumed.checksum(:hello).should == expected
end
end

subject { Url }
before(:all) { subject.auto_migrate! }

it "should record which properties are checksumed" do
subject.checksumed_properties.should include(:url)
end
Expand Down

0 comments on commit 25b09a7

Please sign in to comment.