travis-conditions 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 511bf5af9e9ff4684b09b23bdfb45c19cf16974b
4
- data.tar.gz: 18653ac8eb0886b3c797c25fe7af4eba1f13c6b8
3
+ metadata.gz: 3b6d3e53b4b901ce98eba3163f1032654784961c
4
+ data.tar.gz: d28a8be8838b6db1d8d6ce29ff51e592dbb60f43
5
5
  SHA512:
6
- metadata.gz: ab283b0406a10b95be7d9ab0ef7c7fd052cd6db37944bd592493e4990983534370354e7de29091465c97f59d244e3dd6703fb133e8dae30ed07167a5c4438188
7
- data.tar.gz: f98a63783c44fc3ddb29772d2e10290c9367fcb1b0bf63c71d31171c16f6156c3df92a92aacaee8ed1639b1d57bf1a5b6d96521683d6c21a76780f0ab5498763
6
+ metadata.gz: 518227b13beb67aa1fd7853de9fb51a398ead71f1d09ab40724299cd3e25b74d062c36a7c2045115b0804a780f65231a100050894edc932098ba81911b6fc23c
7
+ data.tar.gz: 22607b55555edf9f45f0b3ca9c2849717fd1d4cf36ca7a36f9939d5097fd9ec24a1b250e65cd9e9c290b9607cee5be7bbcea5bda04237834711cf03f93604600
@@ -71,7 +71,7 @@ module Travis
71
71
  end
72
72
 
73
73
  def call(name, args)
74
- send(name, *args.map { |arg| evl(arg) })
74
+ send(name.to_s.downcase, *args.map { |arg| evl(arg) })
75
75
  end
76
76
 
77
77
  def env(key)
@@ -1,5 +1,5 @@
1
1
  module Travis
2
2
  module Conditions
3
- VERSION = '1.0.0'
3
+ VERSION = '1.0.1'
4
4
  end
5
5
  end
data/spec/v1/eval_spec.rb CHANGED
@@ -109,6 +109,11 @@ describe Travis::Conditions::V1, 'eval' do
109
109
  it { should be true }
110
110
  end
111
111
 
112
+ context do
113
+ let(:str) { 'ENV(foo) = foo' }
114
+ it { should be true }
115
+ end
116
+
112
117
  context do
113
118
  let(:str) { 'env(foo) = bar' }
114
119
  it { should be false }
@@ -170,6 +175,11 @@ describe Travis::Conditions::V1, 'eval' do
170
175
  end
171
176
 
172
177
  describe 'in' do
178
+ context do
179
+ let(:str) { 'branch in (foo, master, bar)' }
180
+ it { should be true }
181
+ end
182
+
173
183
  context do
174
184
  let(:str) { 'branch IN (foo, master, bar)' }
175
185
  it { should be true }
@@ -192,6 +202,11 @@ describe Travis::Conditions::V1, 'eval' do
192
202
  end
193
203
 
194
204
  describe 'not in' do
205
+ context do
206
+ let(:str) { 'branch not in (foo, master, bar)' }
207
+ it { should be false }
208
+ end
209
+
195
210
  context do
196
211
  let(:str) { 'branch NOT IN (foo, master, bar)' }
197
212
  it { should be false }
@@ -214,11 +229,21 @@ describe Travis::Conditions::V1, 'eval' do
214
229
  end
215
230
 
216
231
  describe 'is' do
232
+ context do
233
+ let(:str) { 'branch is present' }
234
+ it { should be true }
235
+ end
236
+
217
237
  context do
218
238
  let(:str) { 'branch IS present' }
219
239
  it { should be true }
220
240
  end
221
241
 
242
+ context do
243
+ let(:str) { 'branch IS PRESENT' }
244
+ it { should be true }
245
+ end
246
+
222
247
  context do
223
248
  let(:str) { 'tag IS present' }
224
249
  it { should be false }
@@ -239,6 +264,11 @@ describe Travis::Conditions::V1, 'eval' do
239
264
  it { should be false }
240
265
  end
241
266
 
267
+ context do
268
+ let(:str) { 'branch IS BLANK' }
269
+ it { should be false }
270
+ end
271
+
242
272
  context do
243
273
  let(:str) { 'branch IS blank' }
244
274
  it { should be false }
@@ -266,6 +296,11 @@ describe Travis::Conditions::V1, 'eval' do
266
296
  end
267
297
 
268
298
  describe 'is not' do
299
+ context do
300
+ let(:str) { 'branch is not present' }
301
+ it { should be false }
302
+ end
303
+
269
304
  context do
270
305
  let(:str) { 'branch IS NOT present' }
271
306
  it { should be false }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: travis-conditions
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Travis CI
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-06-21 00:00:00.000000000 Z
11
+ date: 2018-06-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: parslet