def METHOD_NAME():
    mock = MagicMock(return_value={"retcode": 0, "stdout": ""})
    with patch.dict(
        gem.__salt__,
        {
            "rvm.is_installed": MagicMock(return_value=False),
            "rbenv.is_installed": MagicMock(return_value=False),
            "cmd.run_all": mock,
        },
    ), patch.object(gem, "_has_rubygems_3", MagicMock(return_value=False)):
        gem.install("rails", pre_releases=True)
        mock.assert_called_once_with(
            ["gem", "install", "rails", "--no-rdoc", "--no-ri", "--pre"],
            runas=None,
            python_shell=False,
        )