diff --git a/spec/integration/settings_endpoint_spec.rb b/spec/integration/settings_endpoint_spec.rb index b53f2ca6..86d2a942 100644 --- a/spec/integration/settings_endpoint_spec.rb +++ b/spec/integration/settings_endpoint_spec.rb @@ -69,7 +69,7 @@ describe Travis::Api::App::SettingsEndpoint do response = get '/settings/items', { repository_id: repo.id }, headers json = JSON.parse(response.body) - json['items'].should have(1).items + json['items'].length.should == 1 item = json['items'].first item['name'].should == 'an item' item['id'].should_not be_nil @@ -165,7 +165,7 @@ describe Travis::Api::App::SettingsEndpoint do json['item']['id'].should == item.id json['item'].should_not have_key('secret') - repo.reload.settings.items.should have(0).items + repo.reload.settings.items.length.should == 0 end it 'returns 404 if item can\'t be found' do diff --git a/spec/integration/v2/hooks_spec.rb b/spec/integration/v2/hooks_spec.rb index c0a685de..29bfa977 100644 --- a/spec/integration/v2/hooks_spec.rb +++ b/spec/integration/v2/hooks_spec.rb @@ -37,7 +37,7 @@ describe 'Hooks' do GH.stubs(:[]).returns([]) GH.expects(:post).with(target, payload).returns(GH.load(PAYLOADS[:github][:hook_active])) response = put 'hooks', { hook: { id: hook.id, active: 'true' } }, headers - repo.reload.active?.should be_true + repo.reload.active?.should == true response.should be_successful end end diff --git a/spec/integration/v2/settings/env_vars_spec.rb b/spec/integration/v2/settings/env_vars_spec.rb index c7e2d789..ece91049 100644 --- a/spec/integration/v2/settings/env_vars_spec.rb +++ b/spec/integration/v2/settings/env_vars_spec.rb @@ -21,7 +21,7 @@ describe Travis::Api::App::SettingsEndpoint do json = JSON.parse(response.body) json['env_var']['name'].should == 'FOO' json['env_var']['id'].should == record.id - json['env_var']['public'].should be_false + json['env_var']['public'].should == false json['env_var']['repository_id'].should == repo.id json['env_var'].should_not have_key('value') end @@ -47,7 +47,8 @@ describe Travis::Api::App::SettingsEndpoint do key['name'].should == 'FOO' key['id'].should == record.id key['repository_id'].should == repo.id - key['public'].should be_false + + key['public'].should == false key.should_not have_key('value') end end @@ -165,7 +166,7 @@ describe Travis::Api::App::SettingsEndpoint do json['env_var']['id'].should == env_var.id json['env_var'].should_not have_key('value') - repo.reload.settings.env_vars.should have(0).env_vars + repo.reload.settings.env_vars.length.should == 0 end it 'returns 404 if env_var can\'t be found' do diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 508b6333..e41dbdf2 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -50,7 +50,7 @@ end RSpec.configure do |c| c.mock_framework = :mocha - c.expect_with :rspec, :stdlib + c.expect_with :rspec, :test_unit c.include TestHelpers c.before :suite do diff --git a/spec/unit/api/v2/http/build_spec.rb b/spec/unit/api/v2/http/build_spec.rb index 9968c3eb..5107c667 100644 --- a/spec/unit/api/v2/http/build_spec.rb +++ b/spec/unit/api/v2/http/build_spec.rb @@ -49,7 +49,7 @@ describe Travis::Api::V2::Http::Build do let(:data) { Travis::Api::V2::Http::Build.new(build).data } it 'returns pull request data' do - data['build']['pull_request'].should be_true + data['build']['pull_request'].should == true data['build']['pull_request_title'].should == 'A pull request' data['build']['pull_request_number'].should == 44 end diff --git a/spec/unit/api/v2/http/builds_spec.rb b/spec/unit/api/v2/http/builds_spec.rb index 19f526af..b59f7998 100644 --- a/spec/unit/api/v2/http/builds_spec.rb +++ b/spec/unit/api/v2/http/builds_spec.rb @@ -56,7 +56,7 @@ describe Travis::Api::V2::Http::Builds do end it 'returns pull request data' do - data['builds'].first['pull_request'].should be_true + data['builds'].first['pull_request'].should == true data['builds'].first['pull_request_number'].should == 44 end end diff --git a/spec/unit/endpoint/authorization_spec.rb b/spec/unit/endpoint/authorization_spec.rb index ad8ae799..e2cc59d1 100644 --- a/spec/unit/endpoint/authorization_spec.rb +++ b/spec/unit/endpoint/authorization_spec.rb @@ -30,11 +30,11 @@ describe Travis::Api::App::Endpoint::Authorization do end describe 'GET /auth/authorize' do - pending "not yet implemented" + skip "not yet implemented" end describe 'POST /auth/access_token' do - pending "not yet implemented" + skip "not yet implemented" end describe "GET /auth/handshake" do diff --git a/spec/unit/endpoint/users_spec.rb b/spec/unit/endpoint/users_spec.rb index 46e0ff7e..bbd776cf 100644 --- a/spec/unit/endpoint/users_spec.rb +++ b/spec/unit/endpoint/users_spec.rb @@ -40,7 +40,7 @@ describe Travis::Api::App::Endpoint::Users do response = post('/users/sync', { access_token: access_token.to_s }, 'HTTP_ACCEPT' => 'application/vnd.travis-ci.2+json, */*; q=0.01') response.status.should == 409 - JSON.parse(response.body).should be_true + JSON.parse(response.body).should == { 'message' => 'Sync already in progress. Try again later.' } end end end diff --git a/spec/unit/helpers/accept_spec.rb b/spec/unit/helpers/accept_spec.rb index cd41d0d3..6c32ef87 100644 --- a/spec/unit/helpers/accept_spec.rb +++ b/spec/unit/helpers/accept_spec.rb @@ -47,23 +47,23 @@ module Travis::Api::App::Helpers describe 'accepts?' do it 'accepts everything with */* type' do entry = Accept::Entry.new('*/*') - entry.accepts?('application/json').should be_true - entry.accepts?('foo/bar').should be_true + entry.accepts?('application/json').should == true + entry.accepts?('foo/bar').should == true end it 'accepts every subtype with application/* type' do entry = Accept::Entry.new('application/*') - entry.accepts?('application/foo').should be_true - entry.accepts?('application/bar').should be_true - entry.accepts?('text/plain').should be_false + entry.accepts?('application/foo').should == true + entry.accepts?('application/bar').should == true + entry.accepts?('text/plain').should == false end it 'accepts when type and subtype match' do entry = Accept::Entry.new('application/json') - entry.accepts?('application/json').should be_true - entry.accepts?('application/xml').should be_false + entry.accepts?('application/json').should == true + entry.accepts?('application/xml').should == false end end end diff --git a/spec/unit/responders/json_spec.rb b/spec/unit/responders/json_spec.rb index 5b43bbc1..c6b934d1 100644 --- a/spec/unit/responders/json_spec.rb +++ b/spec/unit/responders/json_spec.rb @@ -14,7 +14,7 @@ module Travis::Api::App::Responders context 'with resource not associated with Api data class' do it 'returns nil result' do - json.apply.should be_false + json.apply.should be_nil end end @@ -31,8 +31,8 @@ module Travis::Api::App::Responders let(:resource) { nil } it 'responds with 404' do - json.apply?.should be_false - json.apply.should be_false + json.apply?.should be_falsey + json.apply.should be_falsey end end end