xplenty-jruby_sandbox 0.2.5-java → 0.2.6-java

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
  SHA1:
3
- metadata.gz: a773f53ac4da0e6ff7845dad8795168836fc3f13
4
- data.tar.gz: cbf3aa3d376e16a8405675454cfb5eea4249ba62
3
+ metadata.gz: a53b8c5b150b3f8869f85839e0f248ac2b24962e
4
+ data.tar.gz: c67be1f47c6fe9ab92b1f0b6247250886e3962d7
5
5
  SHA512:
6
- metadata.gz: ea1a9ff7248e89e44694978a85bbad84766601170d50aeb9933f5ee96987468a13b0f92d759f113778fb3e7626c74a1862f31bf0f08a5f51fe24b65f24c7209c
7
- data.tar.gz: 144140607f1432f36fd102c131fe9b1f15a99c4da7089b94079b0298c58695d23061db2b9ad5c80cfab0172f34d1b46c26b5dad66df3a1a487c846f318a33c0c
6
+ metadata.gz: 4b6a84730f01587919e12ff6cd200eb39d10dc7b0e3db65daadfcaa4765bead7a0c5fbfd63fa2ddc866825a705358d35a2a49c78d79e4a29ab5e30de51b06d66
7
+ data.tar.gz: 4fb479679fe4428bd3d7bf85cd7165eb8ef2658184e54964a2cd97b59211f770c241fd20f9aaf6fda398e38ce58951527a004f760abe07fe7542b9351078469e
data/lib/sandbox/safe.rb CHANGED
@@ -71,6 +71,11 @@ module Sandbox
71
71
  end
72
72
  end
73
73
 
74
+ # We do this here as some of the FakeFs classes require ENV in order to behave..
75
+ Object.class_eval do
76
+ remove_const(:ENV)
77
+ end
78
+
74
79
  [Dir, File, FileUtils, FileTest].each do |fake_class|
75
80
  fake_class.class_eval do
76
81
  def self.class_eval
Binary file
@@ -1,3 +1,3 @@
1
1
  module Sandbox
2
- VERSION = "0.2.5"
2
+ VERSION = "0.2.6"
3
3
  end
data/spec/sandbox_spec.rb CHANGED
@@ -58,6 +58,17 @@ describe Sandbox do
58
58
  subject.eval(%{FileUtils.cp("/bar.txt", "/baz.txt")})
59
59
  }.to_not raise_error(Sandbox::SandboxException, /NoMethodError/)
60
60
  end
61
+
62
+
63
+ it "should have an empty ENV" do
64
+ subject.eval(%{ENV.to_a}).should_not be_empty
65
+
66
+ subject.activate!
67
+
68
+ expect{
69
+ subject.eval(%{ENV.to_a})
70
+ }.to raise_error(Sandbox::SandboxException, /NameError: uninitialized constant ENV/)
71
+ end
61
72
  end
62
73
 
63
74
  describe ".current" do
@@ -137,12 +148,6 @@ describe Sandbox do
137
148
  subject.eval(operations).should == "foo"
138
149
  end
139
150
 
140
- # it "should have an empty ENV" do
141
- # pending do
142
- # subject.eval(%{ENV.to_a}).should be_empty
143
- # end
144
- # end
145
-
146
151
  it "should persist state between evaluations" do
147
152
  subject.eval(%|o = Object.new|)
148
153
  subject.eval(%|o|).should_not be_nil
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xplenty-jruby_sandbox
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 0.2.6
5
5
  platform: java
6
6
  authors:
7
7
  - Dray Lacy
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2017-07-24 00:00:00.000000000 Z
13
+ date: 2017-07-25 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: fakefs