Skip to content

Commit

Permalink
update tests for rspec 3
Browse files Browse the repository at this point in the history
  • Loading branch information
bogdanRada committed Aug 28, 2015
2 parents 85f9197 + 2e39be9 commit be602a4
Show file tree
Hide file tree
Showing 8 changed files with 285 additions and 284 deletions.
16 changes: 8 additions & 8 deletions celluloid_pubsub.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,21 @@ Gem::Specification.new do |s|
s.add_runtime_dependency 'celluloid-websocket-client', '0.0.1'
s.add_runtime_dependency 'activesupport', '>= 4.1', '>= 4.1.0'

s.add_development_dependency 'rspec-rails', '~> 2.0', '>= 2.0'
s.add_development_dependency 'guard', '~> 2.6', '>= 2.6'
s.add_development_dependency 'guard-rspec', '~> 4.2', '>= 4.2'
s.add_development_dependency 'simplecov', '~> 0.9', '>= 0.9'
s.add_development_dependency 'rspec-rails', '~> 3.3', '>= 3.3'
s.add_development_dependency 'guard', '~> 2.13', '>= 2.13'
s.add_development_dependency 'guard-rspec', '~> 4.6', '>= 4.6'
s.add_development_dependency 'simplecov', '~> 0.10', '>= 0.10'
s.add_development_dependency 'simplecov-summary', '~> 0.0.4', '>= 0.0.4'
s.add_development_dependency 'mocha', '~> 1.1', '>= 1.1'
s.add_development_dependency 'coveralls', '~> 0.7', '>= 0.7'
s.add_development_dependency 'rvm-tester', '~> 1.1', '>= 1.1'

s.add_development_dependency 'rubocop', '0.29'
s.add_development_dependency 'phare', '~> 0.6', '>= 0.6'
s.add_development_dependency 'rubocop', '~> 0.33', '>= 0.33'
s.add_development_dependency 'phare', '~> 0.7', '>= 0.7'
s.add_development_dependency 'yard', '~> 0.8', '>= 0.8.7'
s.add_development_dependency 'yard-rspec', '~> 0.1', '>= 0.1'
s.add_development_dependency 'redcarpet', '~> 3.2', '>= 3.2.2'
s.add_development_dependency 'redcarpet', '~> 3.3', '>= 3.3'
s.add_development_dependency 'github-markup', '~> 1.3', '>= 1.3.3'
s.add_development_dependency 'inch', '~> 0.5', '>= 0.5.10'
s.add_development_dependency 'inch', '~> 0.6', '>= 0.6'
s.add_development_dependency 'guard-inch', '~> 0.1', '>= 0.1.0'
end
1 change: 1 addition & 0 deletions lib/celluloid_pubsub.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
require 'celluloid/current'
require 'celluloid/io'
require 'reel'
require 'celluloid/websocket/client'
Expand Down
1 change: 1 addition & 0 deletions lib/celluloid_pubsub/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ module VERSION
MINOR = 1
# tiny release version
TINY = 0

# prelease version ( set this only if it is a prelease)
PRE = nil

Expand Down
28 changes: 14 additions & 14 deletions spec/lib/celluloid_pubsub/client_pubsub_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
expected = nil
CelluloidPubsub::Client::PubSubWorker.stubs(:new).returns(expected)
res = CelluloidPubsub::Client.connect(options, &blk)
res.should eq expected
expect(res).to eq expected
end
end

Expand All @@ -33,8 +33,8 @@

describe '#initialize' do
it 'creates a object' do
@worker.channel.should eq channel
@worker.actor.should eq actor
expect(@worker.channel).to eq channel
expect(@worker.actor).to eq actor
end
end

Expand All @@ -47,25 +47,25 @@

it 'parses options' do
@worker.parse_options(custom_options)
@worker.actor.should eq(actor)
@worker.hostname.should eq(hostname)
@worker.port.should eq(port)
@worker.path.should eq(path)
expect(@worker.actor).to eq(actor)
expect(@worker.hostname).to eq(hostname)
expect(@worker.port).to eq(port)
expect(@worker.path).to eq(path)
end

it 'sets defaults' do
@worker.parse_options({})
@worker.actor.should eq(nil)
@worker.hostname.should eq('0.0.0.0')
@worker.port.should eq(1234)
@worker.path.should eq('/ws')
expect(@worker.actor).to eq(nil)
expect(@worker.hostname).to eq('0.0.0.0')
expect(@worker.port).to eq(1234)
expect(@worker.path).to eq('/ws')
end
end

describe '#debug_enabled?' do
it 'checks if debug is enabled' do
act = @worker.debug_enabled?
act.should eq(true)
expect(act).to eq(true)
end
end

Expand All @@ -90,14 +90,14 @@
message.expects(:present?).returns(true)
message.stubs(:[]).with('client_action').returns('successful_subscription')
actual = @worker.succesfull_subscription?(message)
actual.should eq(true)
expect(actual).to eq(true)
end

it 'checks the message and returns false' do
message.expects(:present?).returns(true)
message.stubs(:[]).with('client_action').returns('something_else')
actual = @worker.succesfull_subscription?(message)
actual.should eq(false)
expect(actual).to eq(false)
end
end

Expand Down
Loading

0 comments on commit be602a4

Please sign in to comment.