My MiniTest extensions for macruby
class MiniTest::Unit def self.run_macruby_tests
module MiniTest::Assertions def find_ui_menu(*path) def find_ui_menu_items menu def assert_ui_menu menu, *items def find_ui_menu_item(*path) def assert_ui_action obj, target, action, key = nil def assert_ui_binding item, binding_name, target, path
Allowing me to write tests like:
def test_ui_wirings app = NSApplication.sharedApplication delegate = app.delegate
assert_kind_of AppController, delegate assert_kind_of NSWindow, delegate.window assert_kind_of NSOutlineView, delegate.sidebar assert_kind_of NSTextField, delegate.label assert_kind_of NSCollectionView, delegate.files
assert_ui_menu("File", "Restart Triage", "Empty Triage", "Update", "", "Reveal", "Group", "Ungroup", "Move to Triage", "Move to Trash")
has_selection = "sidebar.numberOfSelectedRows"
restart, empty, update, _, reveal, group, ungroup, triage, trash = find_ui_menu_items "File"
assert_ui_action restart, delegate, "restart:", ""
assert_ui_action empty, delegate, "empty:"
assert_ui_action update, delegate, "update:", "u"
assert_ui_action reveal, delegate, "reveal:", "r" assert_ui_binding reveal, :enabled, delegate, has_selection
assert_ui_action triage, delegate, "triage:", "t" assert_ui_binding triage, :enabled, delegate, has_selection
assert_ui_action group, delegate, "group:" assert_ui_binding group, :enabled, delegate, has_selection
# TODO: make it properly toggle later assert_ui_action ungroup, delegate, "ungroup:" assert_ui_binding ungroup, :enabled, delegate, has_selection
assert_ui_action trash, delegate, "trash:" assert_ui_binding trash, :enabled, delegate, has_selection end
On Jun 23, 2010, at 12:21 , Ryan Davis wrote:
class MiniTest::Unit def self.run_macruby_tests
module MiniTest::Assertions def find_ui_menu(*path) def find_ui_menu_items menu def assert_ui_menu menu, *items def find_ui_menu_item(*path) def assert_ui_action obj, target, action, key = nil def assert_ui_binding item, binding_name, target, path
I'm torn between releasing this as part of minitest or releasing it under a new gem called minitest-macruby (or something). I'd also love to see more ideas for assertions and helper methods and the like... the more the merrier.
I'd suggest to release a new gem. - Matt On Wed, Jun 23, 2010 at 1:05 PM, Ryan Davis <ryand-ruby@zenspider.com>wrote:
On Jun 23, 2010, at 12:21 , Ryan Davis wrote:
class MiniTest::Unit def self.run_macruby_tests
module MiniTest::Assertions def find_ui_menu(*path) def find_ui_menu_items menu def assert_ui_menu menu, *items def find_ui_menu_item(*path) def assert_ui_action obj, target, action, key = nil def assert_ui_binding item, binding_name, target, path
I'm torn between releasing this as part of minitest or releasing it under a new gem called minitest-macruby (or something).
I'd also love to see more ideas for assertions and helper methods and the like... the more the merrier.
_______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
I think we should just ship your gem with MacRuby, Laurent, what do you think? - Matt On Wed, Jun 23, 2010 at 1:19 PM, Ryan Davis <ryand-ruby@zenspider.com>wrote:
On Jun 23, 2010, at 13:13 , Matt Aimonetti wrote:
I'd suggest to release a new gem.
yeah... but the reason why I'm torn is that if it goes into minitest directly, it goes into macruby directly... easy-peasy for everyone.
_______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
Looks like it would make sense to bundle this in MacRuby directly, since these are extensions. This way it's easily available to everyone. Ryan, would you be willing to commit & maintain these bits in our SVN repository if we give you access? Laurent On Jun 23, 2010, at 1:25 PM, Matt Aimonetti wrote:
I think we should just ship your gem with MacRuby, Laurent, what do you think?
- Matt
On Wed, Jun 23, 2010 at 1:19 PM, Ryan Davis <ryand-ruby@zenspider.com> wrote:
On Jun 23, 2010, at 13:13 , Matt Aimonetti wrote:
I'd suggest to release a new gem.
yeah... but the reason why I'm torn is that if it goes into minitest directly, it goes into macruby directly... easy-peasy for everyone.
_______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
_______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
participants (3)
-
Laurent Sansonetti
-
Matt Aimonetti
-
Ryan Davis