diff --git a/lib/aim/student_workers/password_expirer.rb b/lib/aim/student_workers/password_expirer.rb index 65300fc..d3004ff 100644 --- a/lib/aim/student_workers/password_expirer.rb +++ b/lib/aim/student_workers/password_expirer.rb @@ -10,7 +10,7 @@ def run users_response = @client.get_all(url: "/conf/sets/#{ENV.fetch("STUDENT_USERS_SET_ID")}/members", record_key: "member") if users_response.status != 200 @logger.error("Unable to retrieve student users set") - exit + raise StandardError, "Unable to retrieve student users set" end error_count = 0 @logger.info("Started Expiring Student Worker Account Passwords") diff --git a/spec/aim/hathifiles/updater_spec.rb b/spec/aim/hathifiles/updater_spec.rb index 2401bfe..b746e25 100644 --- a/spec/aim/hathifiles/updater_spec.rb +++ b/spec/aim/hathifiles/updater_spec.rb @@ -21,6 +21,5 @@ expect(@connection).not_to receive(:update_from_file) expect { subject.run }.to raise_error(Faraday::ConnectionFailed) expect(Pathname.new(subject.scratch_dir)).not_to exist - expect(true).to eq(false) end end diff --git a/spec/aim/student_workers/password_expirer_spec.rb b/spec/aim/student_workers/password_expirer_spec.rb index 3ee9e86..5a76d3e 100644 --- a/spec/aim/student_workers/password_expirer_spec.rb +++ b/spec/aim/student_workers/password_expirer_spec.rb @@ -40,6 +40,9 @@ it "exits if the student users set can't be retrieved" do stub_alma_get_request(url: "conf/sets/#{ENV.fetch("STUDENT_USERS_SET_ID")}/members?limit=100&offset=0", status: 500) expect(@logger).to receive(:error) - expect(subject).to eq(1) + expect { subject }.to raise_error(StandardError) + end + it "is doing something weird" do + expect(true).to eq(true) end end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index fe6ff26..8be18fd 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -8,7 +8,6 @@ SimpleCov.start require File.expand_path "../../lib/aim.rb", __FILE__ -puts File.expand_path "../../lib/aim.rb", __FILE__ RSpec.configure do |config| include AlmaRestClient::Test::Helpers