Skip to content

Commit

Permalink
Avoid Polluting Global Class Namespace With Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
fundamental committed Jul 6, 2017
1 parent e07aeac commit a3e6871
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions mrblib/test.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#Dummy classes
dummy_class = %{
class Rectangle
attr_accessor :children
def initialize()
Expand Down Expand Up @@ -48,7 +48,12 @@ def initialize()
end
end
class Radio; attr_accessor :options end
class TextBox; attr_accessor :label end
class TextBox; attr_accessor :label end}

#Dummy classes
def setup_classes
eval(dummy_class)
end

$test_counter = 0
$test_err = 0
Expand Down Expand Up @@ -90,6 +95,7 @@ def test_summary
end

def mruby_qml_parse_test_parse(path)
setup_classes
puts "#Creating Parser..."
l = Parser.new
prog = l.load_qml_from_file(path)
Expand Down

0 comments on commit a3e6871

Please sign in to comment.