Skip to content

Commit

Permalink
Fix test run to wait for completion prior to assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisroberts committed Jun 10, 2015
1 parent 48c6308 commit ffdfe49
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions test/specs/git_hub.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@
archive_path = Dir[File.join(@obj_store, bucket, '*.zip')].first
[repo_path, archive_path].all? { |f| f && File.exists?(f) }
end
source_wait(1, &exists_fn)
source_wait(10) do
!MessageStore.messages.empty?
end
MessageStore.messages.pop.wont_be_nil
exists_fn.call.must_equal true

# and that it contains proper data
Expand All @@ -54,12 +57,16 @@
private

def payload(type = :commit)
h = {:code_fetcher => {
:info => {
:url => 'https://github.com/carnivore-rb/jackal-code-fetcher.git',
:owner => ASSET_OWNER,
:name => ASSET_NAME,
:commit_sha => COMMIT_SHA }}}
h = {
:code_fetcher => {
:info => {
:url => 'https://github.com/carnivore-rb/jackal-code-fetcher.git',
:owner => ASSET_OWNER,
:name => ASSET_NAME,
:commit_sha => COMMIT_SHA
}
}
}
Jackal::Utils.new_payload('test', h)
end

Expand Down

0 comments on commit ffdfe49

Please sign in to comment.