![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 tiny mocking framework focused on the Arrage-Act-Assert test pattern. Grasshopper is heavily modeled after Mockito.
For more examples, see the unit tests
Mock is a person who listens carefully but never says anything. You can say anything to Mock, but you'll only get crickets back.
mock = Grasshopper::Mock.new
mock.hello #=> nil
mock.how_are_you? #=> nil
Grasshopper::Mock.verify(mock).hello # yes, someone did tell me hello.
Grasshopper::Mock.verify(mock).goodbye # wait(AssertionFailed)! they left without saying goodbye!
Stub is a person who holds something for you and gives it to anyone who knows how to ask. You can ask Stub for anything, but you'll only get out what you put into it.
stub = Grasshopper::Stub.new
Grasshopper::Stub.when(stub.keys).then_return([:door_key, :mail_key])
Grasshopper::Stub.when(stub.money("gimmie")).then_return(5)
stub.keys #=> [:door_key, :mail_key]
stub.money("gimmie") #=> 5
stub.monkey #=> nil
or you can use this shorter style if you prefer:
Grasshopper::Stub.like(:keys => [:door_key, :mail_key], :money => 5)
stub.keys #=> [:door_key, :mail_key]
stub.money("gimmie") #=> 5
stub.monkey #=> nil
Grasshopper is named for a restaurant in Allston, MA that serves up all sorts of great mocks.
Copyright 2011-2021 Position Development, LLC.
Grasshopper is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
Grasshopper is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with Grasshopper. If not, see http://www.gnu.org/licenses/.
FAQs
Unknown package
We found that grasshopper 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.