Skip to content

Commit

Permalink
Spec cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
ledermann committed Apr 23, 2014
1 parent 1432178 commit 25fa5af
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions spec/readable_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@
expect {
Email.unread_by(not_a_reader)
}.to raise_error(ArgumentError)

expect {
Email.with_read_marks_for(not_a_reader)
}.to raise_error(ArgumentError)
end
end

Expand All @@ -41,6 +37,20 @@
expect {
Email.unread_by(unsaved_reader)
}.to raise_error(ArgumentError)
end
end

describe :with_read_marks_for do
it "should not allow invalid parameter" do
[ 42, nil, 'foo', :foo, {} ].each do |not_a_reader|
expect {
Email.with_read_marks_for(not_a_reader)
}.to raise_error(ArgumentError)
end
end

it "should not allow unsaved reader" do
unsaved_reader = Reader.new

expect {
Email.with_read_marks_for(unsaved_reader)
Expand Down

0 comments on commit 25fa5af

Please sign in to comment.