Skip to content

Commit

Permalink
RubyMotionQuery::RMQ
Browse files Browse the repository at this point in the history
  • Loading branch information
austinseraphin committed Jun 6, 2015
1 parent d102961 commit 0c468e0
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
13 changes: 13 additions & 0 deletions lib/project/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,14 @@ def self.quiet=(q)
options: {
test: :rmq_app
}
},
:"RubyMotionQuery::RMQ" => {
accessibility_label: :ignore,
is_accessibility_element: :ignore,
options: {
test: :rmq_rmq,
recurse: false
}
}
}

Expand Down Expand Up @@ -428,6 +436,11 @@ def self.rmq_app(app)
self.run_tests(app.window)
end

def self.rmq_rmq(rmq_obj)
rmq_obj.each {|obj| return false unless obj.accessible?}
true
end

def self.find_tests(obj)
return Tests[obj] if obj.kind_of?(Symbol)
return Tests[obj.to_s.to_sym] if obj.is_a?(Class)
Expand Down
12 changes: 12 additions & 0 deletions spec/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -260,5 +260,17 @@ def pickerView(view, numberOfRowsInComponent: component)
window.should.be.accessible
end

describe "RMQ" do
tests TestController
it "RubyMotionQuery::RMQ" do
buttons=rmq(UIButton)
buttons.count.should.be>0
buttons.should.be.accessible
rmq.append(UIButton)
buttons=rmq(UIButton)
buttons.should.not.be.accessible
end
end

end

0 comments on commit 0c468e0

Please sign in to comment.