Skip to content

Commit

Permalink
don't blow up on nil reports
Browse files Browse the repository at this point in the history
  • Loading branch information
balvig committed Oct 23, 2015
1 parent 9b23382 commit 422090c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/capistrano/fiesta/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Capistrano
module Fiesta
VERSION = "1.0.0"
VERSION = "1.0.1"
end
end
2 changes: 1 addition & 1 deletion lib/capistrano/tasks/fiesta.rake
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ namespace :fiesta do
report = Capistrano::Fiesta::Report.new(repo_url, last_release: fetch(:last_release))
result = report.write

if !result.empty?
if result && !result.empty?
Slackistrano.post(
team: fetch(:slack_team),
token: fetch(:slack_token),
Expand Down
7 changes: 7 additions & 0 deletions test/capistrano/fiesta/report_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ def test_write
end
end

def test_no_new_stories
response = { items: [] }
github = stub_request(:get, /github.com/).to_return_json(response)
assert true, report.write.nil?
assert_requested github
end

private

def report
Expand Down

0 comments on commit 422090c

Please sign in to comment.