How To Install rubygem-mocha on Rocky Linux 8

In this tutorial we learn how to install rubygem-mocha on Rocky Linux 8. rubygem-mocha is Mocking and stubbing library

Introduction

In this tutorial we learn how to install rubygem-mocha on Rocky Linux 8.

What is rubygem-mocha

Mocking and stubbing library with JMock/SchMock syntax, which allows mocking and stubbing of methods on real (non-mock) classes.

We can use yum or dnf to install rubygem-mocha on Rocky Linux 8. In this tutorial we discuss both methods but you only need to choose one of method to install rubygem-mocha.

Install rubygem-mocha on Rocky Linux 8 Using dnf

Update yum database with dnf using the following command.

sudo dnf makecache --refresh

After updating yum database, We can install rubygem-mocha using dnf by running the following command:

sudo dnf -y install rubygem-mocha

Install rubygem-mocha on Rocky Linux 8 Using yum

Update yum database with yum using the following command.

sudo yum makecache --refresh

After updating yum database, We can install rubygem-mocha using yum by running the following command:

sudo yum -y install rubygem-mocha

How To Uninstall rubygem-mocha on Rocky Linux 8

To uninstall only the rubygem-mocha package we can use the following command:

sudo dnf remove rubygem-mocha

rubygem-mocha Package Contents on Rocky Linux 8

/usr/share/gems/gems/mocha-1.1.0
/usr/share/gems/gems/mocha-1.1.0/COPYING.md
/usr/share/gems/gems/mocha-1.1.0/MIT-LICENSE.md
/usr/share/gems/gems/mocha-1.1.0/README.md
/usr/share/gems/gems/mocha-1.1.0/RELEASE.md
/usr/share/gems/gems/mocha-1.1.0/bin
/usr/share/gems/gems/mocha-1.1.0/bin/build-matrix
/usr/share/gems/gems/mocha-1.1.0/lib
/usr/share/gems/gems/mocha-1.1.0/lib/mocha
/usr/share/gems/gems/mocha-1.1.0/lib/mocha.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/any_instance_method.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/api.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/argument_iterator.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/backtrace_filter.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/cardinality.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/central.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/change_state_side_effect.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/class_method.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/class_methods.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/configuration.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/debug.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/deprecation.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/detection
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/detection/mini_test.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/detection/test_unit.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/exception_raiser.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/expectation.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/expectation_error.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/expectation_error_factory.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/expectation_list.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/hooks.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/in_state_ordering_constraint.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/inspect.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/instance_method.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/integration
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/integration.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/integration/assertion_counter.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/integration/mini_test
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/integration/mini_test.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/integration/mini_test/adapter.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/integration/mini_test/exception_translation.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/integration/mini_test/nothing.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/integration/mini_test/version_13.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/integration/mini_test/version_140.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/integration/mini_test/version_141.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/integration/mini_test/version_142_to_172.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/integration/mini_test/version_200.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/integration/mini_test/version_201_to_222.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/integration/mini_test/version_2110_to_2111.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/integration/mini_test/version_2112_to_320.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/integration/mini_test/version_230_to_2101.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/integration/monkey_patcher.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/integration/test_unit
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/integration/test_unit.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/integration/test_unit/adapter.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/integration/test_unit/gem_version_200.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/integration/test_unit/gem_version_201_to_202.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/integration/test_unit/gem_version_203_to_220.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/integration/test_unit/gem_version_230_to_250.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/integration/test_unit/nothing.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/integration/test_unit/ruby_version_185_and_below.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/integration/test_unit/ruby_version_186_and_above.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/is_a.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/logger.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/method_matcher.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/mini_test.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/mock.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/mockery.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/module_method.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/module_methods.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/multiple_yields.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/names.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/no_yields.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/object_methods.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/parameter_matchers
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/parameter_matchers.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/parameter_matchers/all_of.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/parameter_matchers/any_of.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/parameter_matchers/any_parameters.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/parameter_matchers/anything.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/parameter_matchers/base.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/parameter_matchers/equals.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/parameter_matchers/has_entries.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/parameter_matchers/has_entry.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/parameter_matchers/has_key.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/parameter_matchers/has_value.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/parameter_matchers/includes.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/parameter_matchers/instance_of.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/parameter_matchers/is_a.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/parameter_matchers/kind_of.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/parameter_matchers/not.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/parameter_matchers/object.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/parameter_matchers/optionally.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/parameter_matchers/query_string.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/parameter_matchers/regexp_matches.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/parameter_matchers/responds_with.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/parameter_matchers/yaml_equivalent.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/parameters_matcher.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/pretty_parameters.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/receivers.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/return_values.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/sequence.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/setup.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/single_return_value.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/single_yield.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/standalone.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/state_machine.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/stubbing_error.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/test_unit.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/thrower.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/unexpected_invocation.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/version.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha/yield_parameters.rb
/usr/share/gems/gems/mocha-1.1.0/lib/mocha_standalone.rb
/usr/share/gems/specifications/mocha-1.1.0.gemspec

References

Summary

In this tutorial we learn how to install rubygem-mocha on Rocky Linux 8 using yum and dnf.