Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fix rubinius toolset constant scoping

also replace mocks/stubs with doubles
  • Loading branch information...
commit 9627d7c98bb83c765555387b7ed9428311770358 1 parent 8200232
Alex Suraci authored
2  lib/atomy/pattern.rb
View
@@ -6,7 +6,7 @@ class Pattern
def ===(v)
singleton_class.dynamic_method(:===) do |gen|
- gen.push_state Rubinius::AST::ClosedScope.new(0)
+ gen.push_state Rubinius::ToolSet.current::TS::AST::ClosedScope.new(0)
gen.total_args = gen.required_args = gen.local_count = 1
gen.push_local(0)
2  spec/atomy/compiler_spec.rb
View
@@ -159,7 +159,7 @@ def expand(_)
gen.push_nil
end
- expect(generator).to(be_a(Rubinius::Generator))
+ expect(generator).to(be_a(Rubinius::ToolSet.current::TS::Generator))
end
it "has the file set to the module's file" do
2  spec/atomy/grammar_spec.rb
View
@@ -30,7 +30,7 @@
let(:source) { "#language foo" }
it "switches the language being parsed" do
- foolang = mock
+ foolang = double
foolang.should_receive(:external_invoke).with(anything, :_root)
grammar.should_receive(:set_lang).with(:foo) do
3  spec/atomy/locals_spec.rb
View
@@ -5,7 +5,8 @@
describe Atomy::LocalState do
describe "#new_local" do
it "returns the new variable" do
- expect(subject.new_local(:a)).to be_a(Rubinius::Compiler::LocalVariable)
+ expect(subject.new_local(:a)).to be_a(
+ Rubinius::ToolSet.current::TS::Compiler::LocalVariable)
end
it "increases the local count" do
4 spec/atomy/module_spec.rb
View
@@ -220,8 +220,8 @@ def foo
describe "#compile" do
let(:apply) { ast("foo(1)") }
- let(:generator) { mock }
- let(:expansion) { mock }
+ let(:generator) { double :generator }
+ let(:expansion) { double :expansion }
it "expands the node and compiles the expansion" do
# TODO: less stubby
2  spec/atomy/pattern/wildcard_spec.rb
View
@@ -61,7 +61,7 @@
describe "#precludes?" do
it "returns true" do
- expect(subject.precludes?(stub)).to eq(true)
+ expect(subject.precludes?(double)).to eq(true)
end
end
end
6 spec/atomy/pattern_spec.rb
View
@@ -114,7 +114,7 @@ def deconstruct(gen)
context "when a local is found" do
context "and its depth is zero" do
let(:gen) do
- g = Rubinius::Generator.new
+ g = Rubinius::ToolSet.current::TS::Generator.new
g.push_state(Atomy::LocalState.new)
@local = g.state.scope.new_local(:a)
g
@@ -129,7 +129,7 @@ def deconstruct(gen)
context "and its depth is greater than zero" do
let(:gen) do
- g = Rubinius::Generator.new
+ g = Rubinius::ToolSet.current::TS::Generator.new
parent = Atomy::LocalState.new
@local = parent.new_local(:a)
@@ -160,7 +160,7 @@ def deconstruct(gen)
context "when a local is NOT found" do
let(:gen) do
- g = Rubinius::Generator.new
+ g = Rubinius::ToolSet.current::TS::Generator.new
g.push_state(Atomy::LocalState.new)
g
end
4 spec/spec_helper.rb
View
@@ -39,7 +39,7 @@
SPEC_ROOT = File.dirname(__FILE__)
-Rubinius::Generator.class_eval do
+Rubinius::ToolSet.current::TS::Generator.class_eval do
def debug(str)
dup
push_cpath_top
@@ -246,7 +246,7 @@ def state
# TODO: put TestGenerator under Rubinius
def push_state(scope)
- @state << Rubinius::AST::State.new(scope)
+ @state << Rubinius::ToolSet.current::TS::AST::State.new(scope)
end
def pop_state
Please sign in to comment.
Something went wrong with that request. Please try again.