Skip to content

Commit

Permalink
Move engine specs into separate files.
Browse files Browse the repository at this point in the history
  • Loading branch information
jcoglan committed Dec 13, 2011
1 parent 5971108 commit c90926e
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 17 deletions.
17 changes: 0 additions & 17 deletions spec/ruby/engine_spec.rb → spec/ruby/engine.rb
Expand Up @@ -416,22 +416,5 @@ def create_engine
end
end
end

describe Faye::Engine::Memory do
let(:engine_opts) { {:type => Faye::Engine::Memory} }
it_should_behave_like "faye engine"
end

describe Faye::Engine::Redis do
let(:engine_opts) { {:type => Faye::Engine::Redis, :password => "foobared", :namespace => Time.now.to_i.to_s} }
after { clean_redis_db }
it_should_behave_like "faye engine"
it_should_behave_like "distributed engine"

describe "using a Unix socket" do
before { engine_opts[:socket] = "/tmp/redis.sock" }
it_should_behave_like "faye engine"
end
end
end

7 changes: 7 additions & 0 deletions spec/ruby/engine/memory_spec.rb
@@ -0,0 +1,7 @@
require "spec_helper"

describe Faye::Engine::Memory do
let(:engine_opts) { {:type => Faye::Engine::Memory} }
it_should_behave_like "faye engine"
end

21 changes: 21 additions & 0 deletions spec/ruby/engine/redis_spec.rb
@@ -0,0 +1,21 @@
require "spec_helper"

describe Faye::Engine::Redis do
let(:engine_opts) { {:type => Faye::Engine::Redis, :password => "foobared", :namespace => Time.now.to_i.to_s} }

after do
engine.disconnect
redis = EM::Hiredis::Client.connect('localhost', 6379)
redis.auth(engine_opts[:password])
redis.flushall
end

it_should_behave_like "faye engine"
it_should_behave_like "distributed engine"

describe "using a Unix socket" do
before { engine_opts[:socket] = "/tmp/redis.sock" }
it_should_behave_like "faye engine"
end
end

3 changes: 3 additions & 0 deletions spec/spec_helper.rb
Expand Up @@ -22,3 +22,6 @@ def parse(bytes)
@parser.parse(bytes.map { |b| b.chr } * '')
end
end

require "ruby/engine"

0 comments on commit c90926e

Please sign in to comment.