build-environment 1.8.0 → 1.9.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d765ae7137acd3261bc930cef2d36665960fde94d0a3c847bfc0933d6c6c7f72
4
- data.tar.gz: 3e0855da0b94f31d73577e296635eb0836978d7b80f871cdced5174f670a316e
3
+ metadata.gz: 3a8dd61b3a7edbfb082c41dd36b2913a6544cf052febc1886ca6cc365fee3436
4
+ data.tar.gz: 5e0eb7d7f201065bba835d5b372bd218d0e48ba0ef78b1570c71d8e1a1bdd541
5
5
  SHA512:
6
- metadata.gz: 1c4bbdc188210aaaa92b7cddcecbad102bc2dd572015f706ccd599504c0dc62c6a129f29e604a9dedd291b69bcde96f14ced273e0abf4de5934bd4daecee45fb
7
- data.tar.gz: 44b7e72c085b8a0321ea4de298424fb7dd84ba6a09e98cf3bc23f88e99e48c10c9db502ce89cdb0bb7b0eabf2ad2a6f9880bd734df5469368a07195fcb015fc7
6
+ metadata.gz: 13d3d8cbc5d9f5ec2f04f1202cd6479acc5d185f7c9d065ee18d8ff438b2f098ec139dfe0c85957c68c42c5f9b5246f2c39cd60cab5068647ba95c896df7787c
7
+ data.tar.gz: '08c83885b28aa569dd7056eaa219c101642686413e119d8af15e474f98adbdfe6d76f4243d09d73d1ce165d20bb7f8d9a4f206a18d2558e0520093a0e6568726'
@@ -53,15 +53,11 @@ module Build
53
53
 
54
54
  def method_missing(name, *args, **options, &block)
55
55
  if options.empty?
56
- if args.empty?
57
- if block_given?
58
- @environment[name] = block
59
-
60
- return name
61
- else
62
- return @environment.fetch(name)
63
- end
64
- elsif !block_given?
56
+ if args.empty? and block_given?
57
+ @environment[name] = block
58
+
59
+ return name
60
+ elsif !args.empty?
65
61
  if args.count == 1
66
62
  @environment[name] = args.first
67
63
  else
@@ -1,5 +1,5 @@
1
1
  module Build
2
2
  class Environment
3
- VERSION = "1.8.0"
3
+ VERSION = "1.9.0"
4
4
  end
5
5
  end
@@ -31,6 +31,12 @@ RSpec.describe Build::Environment::Constructor do
31
31
  expect(environment[:foo]).to be == :bar
32
32
  end
33
33
 
34
+ it "should set value to array" do
35
+ subject.foo :bar, :baz
36
+
37
+ expect(environment[:foo]).to be == [:bar, :baz]
38
+ end
39
+
34
40
  it "should set value with block" do
35
41
  subject.foo {:bar}
36
42
 
@@ -53,12 +59,10 @@ RSpec.describe Build::Environment::Constructor do
53
59
  subject.build library: 'bar', &a_block
54
60
  end
55
61
 
56
- it "can get environment value" do
62
+ it "cannot get values" do
57
63
  subject.foo :bar
58
- expect(subject.foo).to be == :bar
59
- end
60
-
61
- it "raises error when trying to access non-existant value" do
62
- expect{subject.foo}.to raise_error(KeyError)
64
+ expect do
65
+ subject.foo
66
+ end.to raise_error(NoMethodError)
63
67
  end
64
68
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: build-environment
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.0
4
+ version: 1.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-03-25 00:00:00.000000000 Z
11
+ date: 2019-04-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: covered