Skip to content
This repository has been archived by the owner on May 25, 2018. It is now read-only.

Commit

Permalink
Bump to 0.8.5 and start improving test coverage.
Browse files Browse the repository at this point in the history
  • Loading branch information
jimsynz committed Oct 2, 2012
1 parent 0320436 commit f3291c1
Show file tree
Hide file tree
Showing 8 changed files with 190 additions and 82 deletions.
14 changes: 14 additions & 0 deletions Guardfile
@@ -0,0 +1,14 @@
# A sample Guardfile
# More info at https://github.com/guard/guard#readme

guard 'bundler' do
watch('Gemfile')
watch(/^.+\.gemspec/)
end

guard 'rspec', :version => 2 do
watch(%r{^spec/.+_spec\.rb$})
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
watch('spec/spec_helper.rb') { "spec" }
end

9 changes: 8 additions & 1 deletion faye-rails.gemspec
Expand Up @@ -12,14 +12,21 @@ Gem::Specification.new do |s|
s.summary = "Faye bindings for Rails 3.1+."
s.license = 'MIT'

s.add_dependency "faye", ["~> 0.8.2"]
s.add_dependency "faye", ["~> 0.8.5"]
s.add_dependency 'eventmachine', ['~> 1.0.0']
s.add_development_dependency "rails", ["~> 3.1"]
s.add_development_dependency "sqlite3"
s.add_development_dependency "rspec"
s.add_development_dependency 'rspec-core'
s.add_development_dependency 'rspec-mocks'
s.add_development_dependency 'rspec-expectations'
s.add_development_dependency "rspec-rails"
s.add_development_dependency "database_cleaner"
s.add_development_dependency "mocha"
s.add_development_dependency "thin"
s.add_development_dependency "guard-rspec"
s.add_development_dependency "guard-bundler"
s.add_development_dependency 'rb-fsevent', ['~> 0.9.1']

s.files = %w(README.md) + Dir["lib/**/*", "vendor/**/*"]

Expand Down
2 changes: 1 addition & 1 deletion lib/faye-rails/controller/channel.rb
Expand Up @@ -14,7 +14,7 @@ def client
end

def publish(message)
FayeRails.client(endpoint).publish(channel, message)
client.publish(channel, message)
end

def monitor(event, &block)
Expand Down
34 changes: 34 additions & 0 deletions spec/lib/faye-rails/controller/channel_spec.rb
@@ -0,0 +1,34 @@
require 'spec_helper'

describe FayeRails::Controller::Channel do

let(:channel) { stub(:channel) }
let(:endpoint) { stub(:endpoint) }
let(:client) { stub(:client) }
subject { FayeRails::Controller::Channel.new(channel,endpoint) }

describe '#client' do
example do
FayeRails.should_receive(:client).with(endpoint)
subject.client
end
end

describe '#publish' do
example do
subject.should_receive(:client).and_return(client)
client.should_receive(:publish).with(channel, "Hello bob")
subject.publish("Hello bob")
end
end

describe "#monitor" do
it "raises ArgumentError for unknown event" do
expect { subject.monitor(:blarg) }.to raise_error(ArgumentError, /^Unknown event/)
end

example do
end
end

end
File renamed without changes.
3 changes: 2 additions & 1 deletion spec/spec_helper.rb
Expand Up @@ -24,7 +24,8 @@
# config.mock_with :mocha
# config.mock_with :flexmock
# config.mock_with :rr
config.mock_with :mocha
#config.mock_with :mocha
config.mock_with :rspec

# Include the Within Module
config.include(Within)
Expand Down
2 changes: 1 addition & 1 deletion vendor/assets/javascripts/faye-browser-min.js

Large diffs are not rendered by default.

0 comments on commit f3291c1

Please sign in to comment.