Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CI] Fix the build on 3.0 #46

Open
wants to merge 23 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
0b1b94c
[CI] exhibit that the build is currently broken
sfgeorge Aug 24, 2019
a9d85a5
Use rake < 11.x until we upgrade RSpec past 2.x
sfgeorge Aug 24, 2019
2777ef3
[CI] Test more Rubies
sfgeorge Aug 24, 2019
3dbea15
Appease ruby-1.9.3 by holding cucumber back as < 3.0
sfgeorge Aug 24, 2019
4691580
[CI] Relax Bundler development dependency.
sfgeorge Aug 24, 2019
6a48e29
[CI] Always run cucumber in strict mode
sfgeorge Aug 25, 2019
c48b5a5
We don't use EventMachine
benlangfeld Dec 10, 2015
6581059
Bump copyright year
benlangfeld Jan 8, 2016
c987ee9
Typo
benlangfeld Jan 8, 2016
48da9cd
Make sure the test suite doesn't hang
benlangfeld Jan 9, 2016
f312242
[SPEC] Use simplified assertions from commit: "Make Stream usable in …
benlangfeld Jan 8, 2016
937ef57
We don't support Celluloid 0.17 yet
benlangfeld Jan 9, 2016
5c03334
Avoid rspec deprecations
benlangfeld Jan 9, 2016
39625ca
Missed some RSpec deprecations
benlangfeld Jan 9, 2016
ece2346
[SPEC] Don't error on RSpec deprecations.
sfgeorge Aug 25, 2019
7aecd91
The test server failing to shut down shouldn't itself fail specs
benlangfeld Jan 9, 2016
976e90f
Convert specs to RSpec 2.99.2 syntax with Transpec
sfgeorge Aug 25, 2019
6f33506
[SPEC] mark one skipped test as expected to fail
sfgeorge Aug 25, 2019
afd95f3
[SPEC] Replace undocumented, unsupported "feature" of #with
sfgeorge Aug 25, 2019
2f41c09
[SPEC] Upgrade to RSpec 3.x
sfgeorge Aug 25, 2019
ab343b6
[SPEC] Run transpec one more time to fix deprecations
sfgeorge Aug 25, 2019
c55ec91
Revert "Use rake < 11.x until we upgrade RSpec past 2.x"
sfgeorge Aug 25, 2019
fc812fc
Merge branch 'fix-the-build' into fix-the-build-on-3.0
sfgeorge Aug 25, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
dist: xenial
language: ruby
sudo: false
rvm:
- 2.2.5
- 2.3.1
- jruby-9.1.2.0
- 2.2.10
- 2.3.8
- 2.4.5
- 2.5.3
- 2.6.3
- jruby-9.1.17.0
- jruby
- ruby-head
jdk:
- openjdk8 # for jruby
matrix:
allow_failures:
- rvm: ruby-head
before_install: rvm list
notifications:
irc: "irc.freenode.org#adhearsion"
2 changes: 1 addition & 1 deletion cucumber.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
default: --tags ~@wip
default: --strict --tags ~@wip
wip: --wip --tags @wip
6 changes: 3 additions & 3 deletions ruby_ami.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ Gem::Specification.new do |s|
s.add_runtime_dependency %q<celluloid-io>, ["~> 0.13"]
s.add_runtime_dependency %q<celluloid>, ["~> 0.16.0"]

s.add_development_dependency %q<bundler>, ["~> 1.0"]
s.add_development_dependency %q<rspec>, ["~> 2.5"]
s.add_development_dependency %q<cucumber>, [">= 0"]
s.add_development_dependency %q<bundler>, [">= 1.0"]
s.add_development_dependency %q<rspec>, [">= 3.0"]
s.add_development_dependency %q<cucumber>, ["< 3.0"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like this was done to make Ruby 1.9.3 happy, but we no longer need to support that ancient version. Should this restriction be lifted?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bklang I was thinking about that too (actually, I completed the cuke upgrade locally and confirmed it's a small effort).

Reason for possibly not doing it.. a handful of cucumber features fail unless we fully embrace cucumber >= 3.0n syntax. But since the syntax is not backwards compatible, it means that the same features will have to remain different on support/2.x vs. develop.

I'd lean towards having the two branches have a common denominator, unless it drags down develop in some way.

But I can be swayed - I can update this branch to embrace cuke 3.0 if you like it. What do you think?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your answer makes sense to me. There's no urgency to upgrade cucumber, so let's leave it for now. As you say, we can do this work whenever we have a better reason to do it, and in the meantime we benefit from keeping backports simple. 👍

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Meant to reply back earlier... ... thanks man.

s.add_development_dependency %q<yard>, ["~> 0.6"]
s.add_development_dependency %q<rake>, [">= 0"]
s.add_development_dependency %q<guard-rspec>
Expand Down
48 changes: 24 additions & 24 deletions spec/ruby_ami/action_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,30 +12,30 @@ module RubyAMI
end
end

it { should_not be_complete }
it { is_expected.not_to be_complete }

describe "SIPPeers actions" do
it "has causal events" do
Action.new('SIPPeers').has_causal_events?.should be true
expect(Action.new('SIPPeers').has_causal_events?).to be true
end
end

describe "the ParkedCalls terminator event" do
it "knows its causal event terminator name" do
Action.new('ParkedCalls').causal_event_terminator_name.should == "parkedcallscomplete"
expect(Action.new('ParkedCalls').causal_event_terminator_name).to eq("parkedcallscomplete")
end
end

it "should properly convert itself into a String when additional headers are given" do
string = Action.new("Hawtsawce", "Monkey" => "Zoo").to_s
string.should =~ /^Action: Hawtsawce\r\n/i
string.should =~ /[^\n]\r\n\r\n$/
string.should =~ /^(\w+:\s*[\w-]+\r\n){3}\r\n$/
expect(string).to match(/^Action: Hawtsawce\r\n/i)
expect(string).to match(/[^\n]\r\n\r\n$/)
expect(string).to match(/^(\w+:\s*[\w-]+\r\n){3}\r\n$/)
end

it "should properly convert itself into a String when no additional headers are given" do
Action.new("Ping").to_s.should =~ /^Action: Ping\r\nActionID: [\w-]+\r\n\r\n$/i
Action.new("ParkedCalls").to_s.should =~ /^Action: ParkedCalls\r\nActionID: [\w-]+\r\n\r\n$/i
expect(Action.new("Ping").to_s).to match(/^Action: Ping\r\nActionID: [\w-]+\r\n\r\n$/i)
expect(Action.new("ParkedCalls").to_s).to match(/^Action: ParkedCalls\r\nActionID: [\w-]+\r\n\r\n$/i)
end

describe '#<<' do
Expand All @@ -46,14 +46,14 @@ module RubyAMI
before { subject << response }

it 'should set the response' do
subject.response.should be response
expect(subject.response).to be response
end

it 'should call the callback' do
@callback_result.should be response
expect(@callback_result).to be response
end

it { should be_complete }
it { is_expected.to be_complete }
end

context 'with an error' do
Expand All @@ -62,15 +62,15 @@ module RubyAMI
before { subject << error }

it 'should set the response' do
subject.response.should == error
expect(subject.response).to eq(error)
end

it { should be_complete }
it { is_expected.to be_complete }
end

context 'with an event' do
it 'should raise an error' do
lambda { subject << Event.new('foo') }.should raise_error StandardError, /causal action/
expect { subject << Event.new('foo') }.to raise_error StandardError, /causal action/
end
end
end
Expand All @@ -82,7 +82,7 @@ module RubyAMI
context 'with a response' do
before { subject << response }

it { should_not be_complete }
it { is_expected.not_to be_complete }
end

context 'with an event' do
Expand All @@ -91,7 +91,7 @@ module RubyAMI
before { subject << response << event }

it "should add the events to the response" do
subject.response.events.should == [event]
expect(subject.response.events).to eq([event])
end
end

Expand All @@ -100,17 +100,17 @@ module RubyAMI

before do
subject << response
subject.should_not be_complete
expect(subject).not_to be_complete
subject << event
end

it "should add the events to the response" do
subject.response.events.should == [event]
expect(subject.response.events).to eq([event])
end

it { should be_complete }
it { is_expected.to be_complete }

it { subject.response.should be response }
it { expect(subject.response).to be response }
end
end
end
Expand All @@ -119,21 +119,21 @@ module RubyAMI
describe 'with another Action' do
context 'with identical name and headers' do
let(:other) { Action.new name, headers }
it { should == other }
it { is_expected.to eq(other) }
end

context 'with identical name and different headers' do
let(:other) { Action.new name, 'boo' => 'baz' }
it { should_not == other }
it { is_expected.not_to eq(other) }
end

context 'with different name and identical headers' do
let(:other) { Action.new 'BARBAZ', headers }
it { should_not == other }
it { is_expected.not_to eq(other) }
end
end

it { should_not == :foo }
it { is_expected.not_to eq(:foo) }
end
end # Action
end # RubyAMI
40 changes: 20 additions & 20 deletions spec/ruby_ami/agi_result_parser_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,46 +16,46 @@ module RubyAMI
context 'with a simple result with no data' do
let(:result_string) { "200%20result=123%0A" }

it { subject.code.should == 200 }
it { subject.result.should == 123 }
it { subject.data.should == '' }
it { subject.data_hash.should == nil }
it { expect(subject.code).to eq(200) }
it { expect(subject.result).to eq(123) }
it { expect(subject.data).to eq('') }
it { expect(subject.data_hash).to eq(nil) }
end

context 'with a simple unescaped result with no data' do
let(:result_string) { "200 result=123" }

it { subject.code.should == 200 }
it { subject.result.should == 123 }
it { subject.data.should == '' }
it { subject.data_hash.should == nil }
it { expect(subject.code).to eq(200) }
it { expect(subject.result).to eq(123) }
it { expect(subject.data).to eq('') }
it { expect(subject.data_hash).to eq(nil) }
end

context 'with a result and data in parens' do
let(:result_string) { "200%20result=-123%20(timeout)%0A" }

it { subject.code.should == 200 }
it { subject.result.should == -123 }
it { subject.data.should == 'timeout' }
it { subject.data_hash.should == nil }
it { expect(subject.code).to eq(200) }
it { expect(subject.result).to eq(-123) }
it { expect(subject.data).to eq('timeout') }
it { expect(subject.data_hash).to eq(nil) }
end

context 'with a result and key-value data' do
let(:result_string) { "200%20result=123%20foo=bar%0A" }

it { subject.code.should == 200 }
it { subject.result.should == 123 }
it { subject.data.should == 'foo=bar' }
it { subject.data_hash.should == {'foo' => 'bar'} }
it { expect(subject.code).to eq(200) }
it { expect(subject.result).to eq(123) }
it { expect(subject.data).to eq('foo=bar') }
it { expect(subject.data_hash).to eq({'foo' => 'bar'}) }
end

context 'with a 5xx error' do
let(:result_string) { "510%20Invalid%20or%20unknown%20command%0A" }

it { subject.code.should == 510 }
it { subject.result.should be_nil }
it { subject.data.should == 'Invalid or unknown command' }
it { subject.data_hash.should be_nil }
it { expect(subject.code).to eq(510) }
it { expect(subject.result).to be_nil }
it { expect(subject.data).to eq('Invalid or unknown command') }
it { expect(subject.data_hash).to be_nil }
end
end
end
10 changes: 5 additions & 5 deletions spec/ruby_ami/async_agi_environment_parser_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ module RubyAMI

subject { described_class.new environment_string }

it { subject.to_s.should == environment_string }
it { subject.to_s.should_not be environment_string }
it { expect(subject.to_s).to eq(environment_string) }
it { expect(subject.to_s).not_to be environment_string }

describe 'retrieving a hash representation' do
it "should return a hash of attributes" do
subject.to_hash.should == {
expect(subject.to_hash).to eq({
:agi_request => 'async',
:agi_channel => 'SIP/1234-00000000',
:agi_language => 'en',
Expand All @@ -35,11 +35,11 @@ module RubyAMI
:agi_enhanced => '0.0',
:agi_accountcode => '',
:agi_threadid => '4366221312'
}
})
end

it "should not return the same hash object every time" do
subject.to_hash.should_not be subject.to_hash
expect(subject.to_hash).not_to be subject.to_hash
end
end
end
Expand Down
18 changes: 9 additions & 9 deletions spec/ruby_ami/event_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ module RubyAMI
describe "#receipt_time" do
before do
@now = DateTime.now
DateTime.stub now: @now
allow(DateTime).to receive_messages now: @now
end

it "should be the time the object was created (event receipt time)" do
subject.receipt_time.should == @now
expect(subject.receipt_time).to eq(@now)
end
end

Expand All @@ -21,27 +21,27 @@ module RubyAMI

describe "#timestamp" do
it "should be a time object representing the event's timestamp (assuming UTC)" do
subject.timestamp.should == DateTime.new(2014, 2, 25, 22, 46, 20)
expect(subject.timestamp).to eq(DateTime.new(2014, 2, 25, 22, 46, 20))
end
end

describe "#best_time" do
it "should be the timestamp" do
subject.best_time.should == subject.timestamp
expect(subject.best_time).to eq(subject.timestamp)
end
end
end

context "when the event does not have a timestamp" do
describe "#timestamp" do
it "should be nil" do
subject.timestamp.should be_nil
expect(subject.timestamp).to be_nil
end
end

describe "#best_time" do
it "should be the receipt_time" do
subject.best_time.should == subject.receipt_time
expect(subject.best_time).to eq(subject.receipt_time)
end
end
end
Expand All @@ -63,7 +63,7 @@ module RubyAMI
end

it "should be equal" do
event1.should be == event2
expect(event1).to eq(event2)
end
end

Expand All @@ -83,7 +83,7 @@ module RubyAMI
end

it "should not be equal" do
event1.should_not be == event2
expect(event1).not_to eq(event2)
end
end

Expand All @@ -103,7 +103,7 @@ module RubyAMI
end

it "should not be equal" do
event1.should_not be == event2
expect(event1).not_to eq(event2)
end
end
end
Expand Down
4 changes: 2 additions & 2 deletions spec/ruby_ami/response_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module RubyAMI
end

it "should be equal" do
event1.should be == event2
expect(event1).to eq(event2)
end
end

Expand All @@ -36,7 +36,7 @@ module RubyAMI
end

it "should not be equal" do
event1.should_not be == event2
expect(event1).not_to eq(event2)
end
end
end
Expand Down
Loading