![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
A nice assert_difference method similar to the one provided by Rails but with some improvements. For example:
assert_difference "Company.count" => +1, "User.count" => +5, "Slot.count" => -1 do
post :something
end
will assert that a company and 5 users were create (the plus sign is only for the visual aid) and a slot was removed.
Rails' assert_difference would require a more verbose syntax:
assert_difference "Company.count" do
assert_difference "User.count", +5 do
assert_difference "Article.count", -1 do
post :something
end
end
end
Expectations can also be ranges, for example:
assert_difference "Blog.count" => +1, "Post.count" => 2..5 do # Generate some sample posts when creating a blog
post :create
end
On top of that, error reporting is improved by displaying all the counters that didn't match.
To use it with Test::Unit add this code:
class Test::Unit::TestCase
include AssertDifference
end
or in Rails:
class ActiveSupport::TestCase
# ...
include AssertDifference
end
and to use it with RSpec:
RSpec.configure do |config|
config.include AssertDifference
end
This gem should work without Rails but it does depend on active support >= 3.0.0 and it's tested with active support 3.0, 3.1, 3.2, 4.0 and 4.1 as well as Ruby 1.9.3, 2.0 and 2.1.
This gem is being used by:
git checkout -b my-new-feature
)git commit -am "Add some feature"
)git push origin my-new-feature
)Copyright (c) 2010, 2011, 2012, 2014 José Pablo Fernández. See LICENSE for details.
FAQs
Unknown package
We found that assert_difference demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.