Skip to content

Commit

Permalink
Merge pull request #53 from arthurgeek/fix_false_positive_tests
Browse files Browse the repository at this point in the history
Fix for false-positive tests
  • Loading branch information
jodosha committed Aug 21, 2014
2 parents b13d57a + 08ec785 commit 62718ee
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions test/model/adapters/memory_adapter_test.rb
Expand Up @@ -76,7 +76,7 @@
@adapter.persist(collection, entity)

entity.id.must_equal(id)
@adapter.find(collection, entity.id).must_equal entity
@adapter.find(collection, entity.id).name.must_equal entity.name
end
end
end
Expand Down Expand Up @@ -106,7 +106,7 @@
@adapter.update(collection, entity)

entity.id.must_equal id
@adapter.find(collection, entity.id).must_equal entity
@adapter.find(collection, entity.id).name.must_equal entity.name
end
end

Expand Down
24 changes: 12 additions & 12 deletions test/model/adapters/sql_adapter_test.rb
Expand Up @@ -97,7 +97,7 @@
@adapter.persist(collection, entity)

entity.id.must_equal(id)
@adapter.find(collection, entity.id).must_equal entity
@adapter.find(collection, entity.id).name.must_equal entity.name
end
end
end
Expand Down Expand Up @@ -127,7 +127,7 @@
@adapter.update(collection, entity)

entity.id.must_equal id
@adapter.find(collection, entity.id).must_equal entity
@adapter.find(collection, entity.id).name.must_equal entity.name
end
end

Expand Down Expand Up @@ -312,7 +312,7 @@
result = @adapter.query(collection, &query).all
result.must_equal [user1]
end

it 'can use lambda to describe where conditions' do
query = Proc.new {
where{ age > 31 }
Expand All @@ -321,7 +321,7 @@
result = @adapter.query(collection, &query).all
result.must_equal [user1]
end

it 'raises an error if you dont specify condition or block' do
-> {
query = Proc.new {
Expand Down Expand Up @@ -387,16 +387,16 @@
result = @adapter.query(collection, &query).all
result.must_equal [user3]
end

it 'can use lambda to describe exclude conditions' do
query = Proc.new {
exclude{ age > 31 }
}

result = @adapter.query(collection, &query).all
result.must_equal [user2, user3]
end

it 'raises an error if you dont specify condition or block' do
-> {
query = Proc.new {
Expand Down Expand Up @@ -436,22 +436,22 @@
result = @adapter.query(collection, &query).all
result.must_equal [user1, user2]
end

it 'can use lambda to describe or conditions' do
name1 = user1.name

query = Proc.new {
where(name: name1).or{ age < 32 }
}

result = @adapter.query(collection, &query).all
result.must_equal [user1, user2]
end

it 'raises an error if you dont specify condition or block' do
-> {
name1 = user1.name

query = Proc.new {
where(name: name1).or()
}
Expand Down

0 comments on commit 62718ee

Please sign in to comment.