code-ruby 1.9.8 → 1.9.9
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 +4 -4
- data/Gemfile.lock +1 -1
- data/VERSION +1 -1
- data/lib/code/object/identifier_list.rb +1 -1
- data/spec/code/object/identifier_list_spec.rb +26 -0
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0f787d4f359dec1127a7029174900ad6b5c5846942d189ec1379e661fa403195
|
|
4
|
+
data.tar.gz: 490d58386533fedab171549fc5dfbad22f406040f245c83ee85d84214bed8e69
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1b06b4a5f6f2003c7c3ab49426ecb17aa2fb4191d2ba1ab573d8614b47d0231c349f7ac894b9f7d459e772c9197fba01d12c393c66da02274bd09b74d77c935d
|
|
7
|
+
data.tar.gz: 94d7ccbc7ca7c782878cf275d5d2f65b1d7a061ce2fe4e2e82b30c8882f55bd5ad0f5fce318834659c55db0375dd80b0616269b1dc534449ad2ed227dcdaa064
|
data/Gemfile.lock
CHANGED
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.9.
|
|
1
|
+
1.9.9
|
|
@@ -3,6 +3,32 @@
|
|
|
3
3
|
require "spec_helper"
|
|
4
4
|
|
|
5
5
|
RSpec.describe Code::Object::IdentifierList do
|
|
6
|
+
it "assigns square bracket keys in parent context from nested scopes" do
|
|
7
|
+
parent_context = Code::Object::Context.new
|
|
8
|
+
child_context = Code::Object::Context.new({}, parent_context)
|
|
9
|
+
code_identifier = Code::Object::String.new("github")
|
|
10
|
+
code_index = Code::Object::Integer.new(1)
|
|
11
|
+
|
|
12
|
+
parent_context.code_set(code_identifier, Code::Object::Dictionary.new(a: 1))
|
|
13
|
+
|
|
14
|
+
identifier_list = described_class.new([code_identifier, code_index])
|
|
15
|
+
|
|
16
|
+
identifier_list.call(
|
|
17
|
+
operator: "=",
|
|
18
|
+
arguments: Code::Object::List.new([Code::Object::Integer.new(2)]),
|
|
19
|
+
context: child_context,
|
|
20
|
+
error: StringIO.new,
|
|
21
|
+
input: StringIO.new,
|
|
22
|
+
object: Code::Object::Global.new,
|
|
23
|
+
output: StringIO.new,
|
|
24
|
+
source: ""
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
expect(parent_context.code_fetch(code_identifier).code_fetch(code_index)).to eq(
|
|
28
|
+
Code::Object::Integer.new(2)
|
|
29
|
+
)
|
|
30
|
+
end
|
|
31
|
+
|
|
6
32
|
it "keeps context for ||= assignments in nested context receivers" do
|
|
7
33
|
code_context = Code::Object::Context.new
|
|
8
34
|
code_identifier = Code::Object::String.new("value")
|