build_eval 0.0.13 → 0.0.14

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MWJiNTEyNDFmYTUxNmZmMGE3NjRhZWQ2MjVjNWFkMDFiNGUwZGVkYw==
4
+ OTdkYTU0YWU2NWVlN2EzMjcxYTg4NjdkMDQ0MjQ1MDcwZjdiMzBiOQ==
5
5
  data.tar.gz: !binary |-
6
- YWYyYTUxYjZlNDM2M2VlNzQ1YmY1NWIxZjdiM2YxOTQ0NmQyNDE3Yg==
6
+ NTc2OGJjMWIyOTY3YTQ5ODBlNWJjMTk3MjM4ZWU0NWU5NWYzM2M3Nw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MDI3YTlmMGI0NzI4ZGMwZjYzMjM4NjllYjcyZTBjM2RhYTcxMDA1MDc0MjM4
10
- ZWFhYjhhMjgxNGU0ZDA0NjkxMzViZTFkMjM2YmJiZGVhNmFlNjJiYjE5YjJm
11
- MDNlZGYxMDY1YTljODQ5YmQwNGFmYTU1MGQxNmYxNjZkM2ZkYTg=
9
+ NzM1OTUxNjIzZjYzZWNkYmFlNTczYTNjNjlkMDlkZjM4NTg5ODNlMTg1Yjli
10
+ ODZkZTBlOGYyYjM1OTQyMTdiZGRjMzlmYTkwODYxZTlkYjUxOTQyZDFlNzdj
11
+ Y2YxNzFiZGJkMTk3MTE5NTM3NWYwM2JiMTZiMzNlMGY1NDQ3MTE=
12
12
  data.tar.gz: !binary |-
13
- Y2JmMjJhODM4MzJmNzc5OTE0M2M1NjUwMmIyYjBhNWI0N2Y5NTFlZmE1MjU1
14
- NTFkM2FmZWM0ODViMTA0ZWE0OThhMmE1MjE2Y2MwZTE4OGY2ZmI1ZDhhODdl
15
- MzgxOTM1ODJlYmQ5Yjc1YjYwNDJjMTlhMzAyZjQyYzIxZmVlYjc=
13
+ Y2I1ZTBiYTNkZDRlMTdhNzc3YzBkM2ViMDQxYWQzMTlhMDQxNTM5MjhjYzU5
14
+ MDhkOTZjMGI1ZjJiMDg5YTZlMWRjODRiYjhmNTYwNjE4MjFmZTRlNjg1ZjA2
15
+ ZDRiZmFjZDk3NTc1YjE3MmUwNGFiNjBlODg2OTI3YjBlZjI3ODc=
@@ -16,7 +16,7 @@ module BuildEval
16
16
  private
17
17
 
18
18
  def find_session(github_token)
19
- sessions[github_token]
19
+ sessions[github_token].tap { |session| session.clear_cache if session }
20
20
  end
21
21
 
22
22
  def create_session(github_token)
@@ -1,3 +1,3 @@
1
1
  module BuildEval
2
- VERSION = "0.0.13".freeze
2
+ VERSION = "0.0.14".freeze
3
3
  end
@@ -5,7 +5,7 @@ describe BuildEval::Travis::SessionFactory do
5
5
  let(:github_token) { nil }
6
6
  let(:travis_session) { instance_double(::Travis::Client::Session) }
7
7
 
8
- subject { described_class.create(github_token) }
8
+ subject { create_session }
9
9
 
10
10
  before(:example) { allow(::Travis::Client::Session).to receive(:new).and_return(travis_session) }
11
11
  after(:example) { described_class.clear_cache }
@@ -72,7 +72,11 @@ describe BuildEval::Travis::SessionFactory do
72
72
 
73
73
  context "when a session for the GitHub token has been retrieved previously" do
74
74
 
75
- before(:example) { subject }
75
+ before(:example) do
76
+ create_session
77
+
78
+ allow(travis_session).to receive(:clear_cache)
79
+ end
76
80
 
77
81
  it "does not create a new session" do
78
82
  expect(::Travis::Client::Session).to_not receive(:new)
@@ -80,12 +84,22 @@ describe BuildEval::Travis::SessionFactory do
80
84
  subject
81
85
  end
82
86
 
87
+ it "clears the cache of the previously retrieved session to ensure no stale data is returned" do
88
+ expect(travis_session).to receive(:clear_cache)
89
+
90
+ subject
91
+ end
92
+
83
93
  it "returns the previously retrieved session" do
84
94
  expect(subject).to eql(travis_session)
85
95
  end
86
96
 
87
97
  end
88
98
 
99
+ def create_session
100
+ described_class.create(github_token)
101
+ end
102
+
89
103
  end
90
104
 
91
105
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: build_eval
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.13
4
+ version: 0.0.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthew Ueckerman
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2016-06-23 00:00:00.000000000 Z
13
+ date: 2016-06-24 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: nokogiri