• Stars
    star
    557
  • Rank 79,251 (Top 2 %)
  • Language
    Ruby
  • License
    MIT License
  • Created over 13 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

In-memory driver for redis-rb, useful for development and test environments

FakeRedis

Build Status

This a fake implementation of redis-rb for machines without Redis or test environments

Installation

Install the gem:

gem install fakeredis

Add it to your Gemfile:

gem "fakeredis"

Versions

FakeRedis currently supports redis-rb v3 or later, if you are using redis-rb v2.2 install the version 0.3.x:

gem install fakeredis -v "~> 0.3.0"

or use the branch 0-3-x on your Gemfile:

gem "fakeredis", :git => "git://github.com/guilleiguaran/fakeredis.git", :branch => "0-3-x"

Usage

You can use FakeRedis without any changes:

    require "fakeredis"

    redis = Redis.new

    >> redis.set "foo", "bar"
    => "OK"

    >> redis.get "foo"
    => "bar"

Read redis-rb documentation and Redis homepage for more info about commands

Usage with RSpec

Require this either in your Gemfile or in RSpec's support scripts. So either:

# Gemfile
group :test do
  gem "rspec"
  gem "fakeredis", :require => "fakeredis/rspec"
end

Or:

# spec/support/fakeredis.rb
require 'fakeredis/rspec'

Usage with Minitest

Require this either in your Gemfile or in Minitest's support scripts. So either:

# Gemfile
group :test do
  gem "minitest"
  gem "fakeredis", :require => "fakeredis/minitest"
end

Or:

# test/test_helper.rb (or test/minitest_config.rb)
require 'fakeredis/minitest'

Acknowledgements

Thanks to all contributors.

Contributing to FakeRedis

  • Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
  • Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
  • Fork the project
  • Start a feature/bugfix branch
  • Commit and push until you are happy with your contribution
  • Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
  • Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.

Copyright

Copyright (c) 2011-2023 Guillermo Iguaran. See LICENSE for further details.

More Repositories

1

xv6

mirror of the source code of the Xv6 operating system
C
476
star
2

nancy

Minimal Ruby microframework for web development inspired in Sinatra and Cuba.
Ruby
82
star
3

rails-htmx

htmx for Rails
Ruby
56
star
4

sinatra-template

My Sinatra template with Bundler, Rack config, Mongoid, RSpec2, SimpleCov and some useful Rake tasks.
Ruby
15
star
5

heroku-nginx-template

Template application for nginx heroku buildpack
14
star
6

httplacebo

The 'doing nothing' HTTP client for Elixir
Elixir
14
star
7

heroku-buildpack-ruby-alt

Heroku buildpack: Ruby + dep
Shell
11
star
8

dvra

Damn Vulnerable Rails app
10
star
9

rambutan

Ruby web microframework with Rails-ish controllers and routes.
Ruby
10
star
10

minitest-vw

Makes your failing Minitest test cases succeed under CI tools scrutiny
Ruby
8
star
11

rogue

Minimal HTTP server for Rack applications powered by the superpowers of others
Ruby
8
star
12

hermes

Minimal Path-finding Sinatra App using PostGIS/pgRouting
JavaScript
7
star
13

rails4-ws-test

A tiny demo using TubeSock WebSocket implementation
Ruby
7
star
14

hermes-server

Minimal Path-finding using Scala for processing and CassandraDB for storage
Scala
6
star
15

ex_pubnub

Elixir Pubnub clone
JavaScript
5
star
16

coffeescript-java

Java
5
star
17

hermes-client

Rails 3 web client for hermes-server
JavaScript
5
star
18

appengine-jruby

Git Mirror of https://code.google.com/p/appengine-jruby/
Ruby
5
star
19

heroku-config-rollback

Allow roll back of values of the environment variables to a past release.
Ruby
4
star
20

kasoba

Interactive tool for large scale code refactors
Ruby
3
star
21

atmoos

JavaScript
3
star
22

tweetranslate

Ruby
3
star
23

Todo

Demo
Ruby
3
star
24

tracking_link

Ruby
3
star
25

atmoos_server

Ruby
3
star
26

dynamita

Elixir
3
star
27

selene

Elixir
3
star
28

sicp

SICP Exercises
Scheme
3
star
29

minirails

ActionController + Tilt experiment
Ruby
3
star
30

rack-non-www-enforcer

Rack Middleware for redirect www requests to main domain in your app
2
star
31

taal-recipes

Recipes for Taal
Shell
2
star
32

lj

Haskell
2
star
33

hackaton

JavaScript
2
star
34

stairway_examples

Examples from the Odersky "Stairway" Book
Scala
2
star
35

microspec

Ruby
2
star
36

gogo

Go Game based in Sinatra and jGoBoard
JavaScript
2
star
37

taal

Simple build service on the cloud
Ruby
2
star
38

uglifier-rails

Uglifier adapter for the Rails asset pipeline.
Ruby
2
star
39

eroku

Elixir
2
star
40

ruby-ecosystem.showoff

Presentation for FLISOL '11
Shell
2
star
41

heroku-config-versions

Configuration management for Heroku environment variables
Ruby
2
star
42

activeresource

(Note: this is the temporary repository for extraction) REST on Rails. Wrap your RESTful web app with Ruby classes and work with them like Active Record models.
Ruby
2
star
43

nancy-examples

Nancy examples for Sitepoint Ruby article.
Ruby
1
star
44

rails-bar

Ruby
1
star
45

domino-server

Java
1
star
46

cramp-test

Cramp example
1
star
47

dotfiles

Shell
1
star
48

types-playground

Haskell
1
star
49

protected_attributes

Ruby
1
star
50

em_http_serv_demo

eventmachine_httpserver + http_parser.rb
Ruby
1
star
51

rack-mount-test

Ruby
1
star
52

stoplight-rjs-test

Stoplight Rails 3.1 RJS test app
Ruby
1
star
53

scylla-web

Scylla
JavaScript
1
star
54

rack-www-enforcer

Rack Middleware for redirect requests to an specific subdomain of your app
Ruby
1
star
55

spea2

Ruby
1
star
56

foo_rails_issue_2383

JavaScript
1
star
57

etomcrl2

Mirror of etomcrl2 project
Erlang
1
star
58

nancy-test

Ruby
1
star
59

whytypes

TeX
1
star
60

lang-benchmarks

Java
1
star
61

realboy

Assembly
1
star
62

youmustdo

Ruby
1
star
63

template-rack-embedded-jetty

Ruby
1
star
64

vapor

Vapor for Ruby
Ruby
1
star
65

nancy-app

Ruby
1
star
66

appp

Ruby
1
star
67

puppet-mactex

MacTeX Puppet Module for Boxen
Ruby
1
star
68

taal-cli

1
star