Permalink
Browse files

* Added generation of a testing project and running of tests for rubo…

…to-core and new projects
  • Loading branch information...
1 parent 5a6684e commit 50672b8cc98c7e9d5734797d461c788995deb8cc @donv donv committed Feb 13, 2011
View
7 .idea/.rakeTasks
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Settings><!--This file was automatically generated by Ruby plugin.
+You are allowed to:
+1. Remove rake task
+2. Add existing rake tasks
+To add existing rake tasks automatically delete this file and reload the project.
+--><RakeGroup description="" fullCmd="" taksId="rake"><RakeTask description="" fullCmd="default" taksId="default" /><RakeTask description="" fullCmd="gem" taksId="gem" /><RakeTask description="" fullCmd="release" taksId="release" /></RakeGroup></Settings>
View
5 .idea/encodings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+ <component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false" />
+</project>
+
View
11 .idea/misc.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+ <component name="DependencyValidationManager">
+ <option name="SKIP_IMPORT_STATEMENTS" value="false" />
+ </component>
+ <component name="ProjectResources">
+ <default-html-doctype>http://www.w3.org/1999/xhtml</default-html-doctype>
+ </component>
+ <component name="ProjectRootManager" version="2" project-jdk-name="JRuby SDK 1.6.0.RC2-p330" project-jdk-type="JRUBY_SDK" />
+</project>
+
View
9 .idea/modules.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+ <component name="ProjectModuleManager">
+ <modules>
+ <module fileurl="file://$PROJECT_DIR$/.idea/ruboto-core.iml" filepath="$PROJECT_DIR$/.idea/ruboto-core.iml" />
+ </modules>
+ </component>
+</project>
+
View
29 .idea/ruboto-core.iml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="RUBY_MODULE" version="4">
+ <component name="GemRequirementsHolder" version="3">
+ <requirement>
+ <requirement>
+ <dependency name="jruby-jars" version="0" bound="GREATER_OR_EQUAL" git="false" path="false" doRequire="true" />
+ </requirement>
+ <source from="Gemfile" />
+ </requirement>
+ <requirement>
+ <requirement>
+ <dependency name="main" version="0" bound="GREATER_OR_EQUAL" git="false" path="false" doRequire="true" />
+ </requirement>
+ <source from="Gemfile" />
+ </requirement>
+ </component>
+ <component name="NewModuleRootManager">
+ <content url="file://$MODULE_DIR$" />
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="library" scope="PROVIDED" name="[gem] rake (v0.8.7, /Library/Frameworks/JRuby.framework/Gems/1.8/gems/rake-0.8.7)" level="application" />
+ <orderEntry type="library" scope="PROVIDED" name="[gem] bundler (v1.0.7, /Library/Frameworks/JRuby.framework/Gems/1.8/gems/bundler-1.0.7)" level="application" />
+ <orderEntry type="library" scope="PROVIDED" name="[gem] main (v4.2.0, /Library/Frameworks/JRuby.framework/Gems/1.8/gems/main-4.2.0)" level="application" />
+ <orderEntry type="library" scope="PROVIDED" name="[gem] jruby-jars (v1.6.0.rc1, /Library/Frameworks/JRuby.framework/Gems/1.8/gems/jruby-jars-1.6.0.rc1)" level="application" />
+ <orderEntry type="library" scope="PROVIDED" name="[gem] fattr (v2.1.0, /Library/Frameworks/JRuby.framework/Gems/1.8/gems/fattr-2.1.0)" level="application" />
+ <orderEntry type="library" scope="PROVIDED" name="[gem] arrayfields (v4.7.4, /Library/Frameworks/JRuby.framework/Gems/1.8/gems/arrayfields-4.7.4)" level="application" />
+ </component>
+</module>
+
View
8 .idea/vcs.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+ <component name="VcsDirectoryMappings">
+ <mapping directory="" vcs="" />
+ <mapping directory="$PROJECT_DIR$" vcs="Git" />
+ </component>
+</project>
+
View
529 .idea/workspace.xml
@@ -0,0 +1,529 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+ <component name="ChangeListManager">
+ <list default="true" id="41ba96b7-79a4-44d3-bcca-0bdad016df56" name="Default" comment="">
+ <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/assets/src/InheritingTest.java" />
+ <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/test/ruboto_rb_test.rb" />
+ <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/test/test_helper.rb" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/Gemfile" afterPath="$PROJECT_DIR$/Gemfile" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/assets/Rakefile" afterPath="$PROJECT_DIR$/assets/Rakefile" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/assets/assets/scripts/ruboto.rb" afterPath="$PROJECT_DIR$/assets/assets/scripts/ruboto.rb" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/assets/samples/sample_activity.rb" afterPath="$PROJECT_DIR$/assets/samples/sample_activity.rb" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/bin/ruboto" afterPath="$PROJECT_DIR$/bin/ruboto" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/ruboto-core.gemspec" afterPath="$PROJECT_DIR$/ruboto-core.gemspec" />
+ </list>
+ <ignored path="ruboto-core.iws" />
+ <ignored path=".idea/workspace.xml" />
+ <ignored path=".idea/" />
+ <option name="TRACKING_ENABLED" value="true" />
+ <option name="SHOW_DIALOG" value="false" />
+ <option name="HIGHLIGHT_CONFLICTS" value="true" />
+ <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
+ <option name="LAST_RESOLUTION" value="IGNORE" />
+ </component>
+ <component name="ChangesViewManager" flattened_view="false" show_ignored="false" />
+ <component name="CreatePatchCommitExecutor">
+ <option name="PATCH_PATH" value="" />
+ <option name="REVERSE_PATCH" value="false" />
+ </component>
+ <component name="DaemonCodeAnalyzer">
+ <disable_hints />
+ </component>
+ <component name="FavoritesManager">
+ <favorites_list name="ruboto-core" />
+ </component>
+ <component name="FileColors" enabled="true" enabledForTabs="true" showNonProject="false" />
+ <component name="FileEditorManager">
+ <leaf>
+ <file leaf-file-name="ruboto_rb_test.rb" pinned="false" current="true" current-in-tab="true">
+ <entry file="file://$PROJECT_DIR$/test/ruboto_rb_test.rb">
+ <provider selected="true" editor-type-id="text-editor">
+ <state line="15" column="4" selection-start="587" selection-end="587" vertical-scroll-proportion="0.42035398">
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ </file>
+ <file leaf-file-name="sample_activity.rb" pinned="false" current="false" current-in-tab="false">
+ <entry file="file://$PROJECT_DIR$/assets/samples/sample_activity.rb">
+ <provider selected="true" editor-type-id="text-editor">
+ <state line="12" column="0" selection-start="382" selection-end="382" vertical-scroll-proportion="0.0">
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ </file>
+ <file leaf-file-name="ruboto.rb" pinned="false" current="false" current-in-tab="false">
+ <entry file="file://$PROJECT_DIR$/assets/assets/scripts/ruboto.rb">
+ <provider selected="true" editor-type-id="text-editor">
+ <state line="24" column="17" selection-start="807" selection-end="807" vertical-scroll-proportion="0.0">
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ </file>
+ <file leaf-file-name="ruboto" pinned="false" current="false" current-in-tab="false">
+ <entry file="file://$PROJECT_DIR$/bin/ruboto">
+ <provider selected="true" editor-type-id="text-editor">
+ <state line="613" column="0" selection-start="21205" selection-end="21205" vertical-scroll-proportion="0.0">
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ </file>
+ <file leaf-file-name="InheritingTest.java" pinned="false" current="false" current-in-tab="false">
+ <entry file="file://$PROJECT_DIR$/assets/src/InheritingTest.java">
+ <provider selected="true" editor-type-id="text-editor">
+ <state line="17" column="65" selection-start="657" selection-end="657" vertical-scroll-proportion="0.0">
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ </file>
+ <file leaf-file-name="InheritingClass.java" pinned="false" current="false" current-in-tab="false">
+ <entry file="file://$PROJECT_DIR$/assets/src/InheritingClass.java">
+ <provider selected="true" editor-type-id="text-editor">
+ <state line="9" column="58" selection-start="264" selection-end="309" vertical-scroll-proportion="0.0">
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ </file>
+ <file leaf-file-name="InheritingActivity.java" pinned="false" current="false" current-in-tab="false">
+ <entry file="file://$PROJECT_DIR$/assets/src/InheritingActivity.java">
+ <provider selected="true" editor-type-id="text-editor">
+ <state line="0" column="19" selection-start="8" selection-end="19" vertical-scroll-proportion="0.0">
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ </file>
+ </leaf>
+ </component>
+ <component name="FindManager">
+ <FindUsagesManager>
+ <setting name="OPEN_NEW_TAB" value="false" />
+ </FindUsagesManager>
+ </component>
+ <component name="Git.Branch.Configurations">
+ <option name="CURRENT" value="master" />
+ <option name="CONFIGURATIONS">
+ <array>
+ <BranchConfiguration>
+ <option name="IS_AUTO_DETECTED" value="true" />
+ <option name="NAME" value="master" />
+ <option name="BRANCHES">
+ <array>
+ <BranchInfo>
+ <option name="ROOT" value="$PROJECT_DIR$" />
+ <option name="REFERENCE" value="master" />
+ </BranchInfo>
+ </array>
+ </option>
+ </BranchConfiguration>
+ </array>
+ </option>
+ </component>
+ <component name="Git.Settings">
+ <option name="GIT_EXECUTABLE" value="/usr/local/git/bin/git" />
+ <option name="CHECKOUT_INCLUDE_TAGS" value="false" />
+ <option name="UPDATE_CHANGES_POLICY" value="STASH" />
+ </component>
+ <component name="IdeDocumentHistory">
+ <option name="changedFiles">
+ <list>
+ <option value="$PROJECT_DIR$/assets/assets/scripts/ruboto.rb" />
+ <option value="$PROJECT_DIR$/test/unit/ruboto_rb_test.rb" />
+ <option value="$PROJECT_DIR$/test/unit/test_helper.rb" />
+ <option value="$PROJECT_DIR$/test/test_helper.rb" />
+ <option value="$PROJECT_DIR$/ruboto-core.gemspec" />
+ <option value="$PROJECT_DIR$/assets/Rakefile" />
+ <option value="$PROJECT_DIR$/tmp/RubotoTestApp/Rakefile" />
+ <option value="$PROJECT_DIR$/tmp/RubotoTestApp/assets/scripts/ruboto_test_activity.rb" />
+ <option value="$PROJECT_DIR$/tmp/RubotoTestApp/test/src/org/ruboto/test/RubotoTestActivityTest.java" />
+ <option value="$PROJECT_DIR$/assets/samples/sample_activity.rb" />
+ <option value="$PROJECT_DIR$/Gemfile" />
+ <option value="$PROJECT_DIR$/assets/src/InheritingTest.java" />
+ <option value="$PROJECT_DIR$/bin/ruboto" />
+ <option value="$PROJECT_DIR$/test/ruboto_rb_test.rb" />
+ </list>
+ </option>
+ </component>
+ <component name="ProjectLevelVcsManager">
+ <OptionsSetting value="true" id="Add" />
+ <OptionsSetting value="true" id="Remove" />
+ <OptionsSetting value="true" id="Checkout" />
+ <OptionsSetting value="true" id="Update" />
+ <OptionsSetting value="true" id="Status" />
+ <OptionsSetting value="true" id="Edit" />
+ <ConfirmationsSetting value="0" id="Add" />
+ <ConfirmationsSetting value="0" id="Remove" />
+ </component>
+ <component name="ProjectReloadState">
+ <option name="STATE" value="0" />
+ </component>
+ <component name="ProjectView">
+ <navigator currentView="ProjectPane" proportions="" version="1" splitterProportion="0.5">
+ <flattenPackages />
+ <showMembers />
+ <showModules />
+ <showLibraryContents />
+ <hideEmptyPackages />
+ <abbreviatePackageNames />
+ <autoscrollToSource />
+ <autoscrollFromSource ProjectPane="true" />
+ <sortByType />
+ </navigator>
+ <panes>
+ <pane id="ProjectPane">
+ <subPane>
+ <PATH>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="ruboto-core" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
+ </PATH_ELEMENT>
+ </PATH>
+ <PATH>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="ruboto-core" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="ruboto-core" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ </PATH>
+ <PATH>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="ruboto-core" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="ruboto-core" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="tmp" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ </PATH>
+ <PATH>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="ruboto-core" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="ruboto-core" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="test" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ </PATH>
+ <PATH>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="ruboto-core" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="ruboto-core" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="bin" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ </PATH>
+ <PATH>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="ruboto-core" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="ruboto-core" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="assets" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ </PATH>
+ <PATH>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="ruboto-core" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="ruboto-core" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="assets" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="samples" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ </PATH>
+ </subPane>
+ </pane>
+ <pane id="Scope" />
+ <pane id="Favorites" />
+ </panes>
+ </component>
+ <component name="PropertiesComponent">
+ <property name="options.splitter.main.proportions" value="0.3" />
+ <property name="options.lastSelected" value="org.jetbrains.plugins.ruby.settings.RubyIdeSdkConfigurable" />
+ <property name="recentsLimit" value="5" />
+ <property name="options.searchVisible" value="true" />
+ <property name="options.splitter.details.proportions" value="0.2" />
+ </component>
+ <component name="RecentsManager">
+ <key name="CopyFile.RECENT_KEYS">
+ <recent name="$PROJECT_DIR$/assets/test/src/org/ruboto/test" />
+ </key>
+ </component>
+ <component name="RunManager" selected="Test::Unit/Shoulda.ruboto_rb_test">
+ <configuration default="false" name="ruboto_rb_test" type="TestUnitRunConfigurationType" factoryName="Test::Unit/Shoulda" temporary="true">
+ <predefined_log_file id="RUBY_TESTUNIT" enabled="true" />
+ <module name="ruboto-core" />
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="RUBY_ARGS" VALUE="-e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)" />
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="WORK DIR" VALUE="$PROJECT_DIR$/test" />
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="SHOULD_USE_SDK" VALUE="false" />
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="ALTERN_SDK_NAME" VALUE="" />
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="myPassParentEnvs" VALUE="true" />
+ <envs />
+ <EXTENSION ID="BundlerRunConfigurationExtension" bundleExecEnabled="false" />
+ <EXTENSION ID="RubyCoverageRunConfigurationExtension" enabled="false" track_test_folders="true" runner="rcov">
+ <COVERAGE_PATTERN ENABLED="true">
+ <PATTERN REGEXPS="/.rvm/" INCLUDED="false" />
+ </COVERAGE_PATTERN>
+ </EXTENSION>
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="TESTS_FOLDER_PATH" VALUE="" />
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_SCRIPT_PATH" VALUE="$PROJECT_DIR$/test/ruboto_rb_test.rb" />
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_CLASS_NAME" VALUE="" />
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_FILE_MASK" VALUE="" />
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_METHOD_NAME" VALUE="" />
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_TEST_TYPE" VALUE="TEST_SCRIPT" />
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="INHERITANCE_CHECK_DISABLED" VALUE="false" />
+ <RunnerSettings RunnerId="RubyRunner" />
+ <ConfigurationWrapper RunnerId="RubyRunner" />
+ <method />
+ </configuration>
+ <configuration default="true" type="RubyRunConfigurationType" factoryName="Ruby">
+ <module name="" />
+ <RUBY_RUN_CONFIG NAME="RUBY_ARGS" VALUE="-e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)" />
+ <RUBY_RUN_CONFIG NAME="WORK DIR" VALUE="" />
+ <RUBY_RUN_CONFIG NAME="SHOULD_USE_SDK" VALUE="false" />
+ <RUBY_RUN_CONFIG NAME="ALTERN_SDK_NAME" VALUE="" />
+ <RUBY_RUN_CONFIG NAME="myPassParentEnvs" VALUE="true" />
+ <envs />
+ <EXTENSION ID="BundlerRunConfigurationExtension" bundleExecEnabled="false" />
+ <EXTENSION ID="RubyCoverageRunConfigurationExtension" enabled="false" track_test_folders="true" runner="rcov">
+ <COVERAGE_PATTERN ENABLED="true">
+ <PATTERN REGEXPS="/.rvm/" INCLUDED="false" />
+ </COVERAGE_PATTERN>
+ </EXTENSION>
+ <RUBY_RUN_CONFIG NAME="SCRIPT_PATH" VALUE="" />
+ <RUBY_RUN_CONFIG NAME="SCRIPT_ARGS" VALUE="" />
+ <method />
+ </configuration>
+ <configuration default="true" type="TestUnitRunConfigurationType" factoryName="Test::Unit/Shoulda">
+ <predefined_log_file id="RUBY_TESTUNIT" enabled="true" />
+ <module name="" />
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="RUBY_ARGS" VALUE="-e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)" />
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="WORK DIR" VALUE="" />
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="SHOULD_USE_SDK" VALUE="false" />
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="ALTERN_SDK_NAME" VALUE="" />
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="myPassParentEnvs" VALUE="true" />
+ <envs />
+ <EXTENSION ID="BundlerRunConfigurationExtension" bundleExecEnabled="false" />
+ <EXTENSION ID="RubyCoverageRunConfigurationExtension" enabled="false" track_test_folders="true" runner="rcov">
+ <COVERAGE_PATTERN ENABLED="true">
+ <PATTERN REGEXPS="/.rvm/" INCLUDED="false" />
+ </COVERAGE_PATTERN>
+ </EXTENSION>
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="TESTS_FOLDER_PATH" VALUE="" />
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_SCRIPT_PATH" VALUE="" />
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_CLASS_NAME" VALUE="" />
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_FILE_MASK" VALUE="" />
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_METHOD_NAME" VALUE="" />
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_TEST_TYPE" VALUE="TEST_SCRIPT" />
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="INHERITANCE_CHECK_DISABLED" VALUE="false" />
+ <method />
+ </configuration>
+ <list size="1">
+ <item index="0" class="java.lang.String" itemvalue="Test::Unit/Shoulda.ruboto_rb_test" />
+ </list>
+ </component>
+ <component name="ShelveChangesManager" show_recycled="false" />
+ <component name="StructureViewFactory">
+ <option name="ACTIVE_ACTIONS" value="ALPHA_COMPARATOR" />
+ </component>
+ <component name="SvnConfiguration" maxAnnotateRevisions="500">
+ <option name="USER" value="" />
+ <option name="PASSWORD" value="" />
+ <option name="LAST_MERGED_REVISION" />
+ <option name="UPDATE_RUN_STATUS" value="false" />
+ <option name="MERGE_DRY_RUN" value="false" />
+ <option name="MERGE_DIFF_USE_ANCESTRY" value="true" />
+ <option name="UPDATE_LOCK_ON_DEMAND" value="false" />
+ <option name="IGNORE_SPACES_IN_MERGE" value="false" />
+ <option name="DETECT_NESTED_COPIES" value="true" />
+ <option name="CHECK_NESTED_FOR_QUICK_MERGE" value="false" />
+ <option name="IGNORE_SPACES_IN_ANNOTATE" value="true" />
+ <option name="SHOW_MERGE_SOURCES_IN_ANNOTATE" value="true" />
+ <configuration useDefault="true">$USER_HOME$/.subversion_IDEA</configuration>
+ <myIsUseDefaultProxy>false</myIsUseDefaultProxy>
+ </component>
+ <component name="TaskManager">
+ <task active="true" id="Default" summary="Default task">
+ <changelist id="41ba96b7-79a4-44d3-bcca-0bdad016df56" name="Default" comment="" />
+ <created>1297522972678</created>
+ <updated>1297522972678</updated>
+ </task>
+ <servers />
+ </component>
+ <component name="ToolWindowManager">
+ <frame x="4" y="22" width="1916" height="1178" extended-state="6" />
+ <editor active="true" />
+ <layout>
+ <window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
+ <window_info id="Changes" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.33395004" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
+ <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
+ <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.25" sideWeight="0.27104533" order="1" side_tool="true" content_ui="tabs" />
+ <window_info id="Dependency Viewer" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
+ <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.25" sideWeight="0.38852915" order="0" side_tool="false" content_ui="tabs" />
+ <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
+ <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.3293247" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
+ <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.3293247" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
+ <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
+ <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
+ <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
+ <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
+ <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
+ <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
+ <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
+ </layout>
+ </component>
+ <component name="VcsManagerConfiguration">
+ <option name="OFFER_MOVE_TO_ANOTHER_CHANGELIST_ON_PARTIAL_COMMIT" value="true" />
+ <option name="CHECK_CODE_SMELLS_BEFORE_PROJECT_COMMIT" value="true" />
+ <option name="PERFORM_UPDATE_IN_BACKGROUND" value="true" />
+ <option name="PERFORM_COMMIT_IN_BACKGROUND" value="true" />
+ <option name="PERFORM_EDIT_IN_BACKGROUND" value="true" />
+ <option name="PERFORM_CHECKOUT_IN_BACKGROUND" value="true" />
+ <option name="PERFORM_ADD_REMOVE_IN_BACKGROUND" value="true" />
+ <option name="PERFORM_ROLLBACK_IN_BACKGROUND" value="false" />
+ <option name="CHECK_LOCALLY_CHANGED_CONFLICTS_IN_BACKGROUND" value="false" />
+ <option name="ENABLE_BACKGROUND_PROCESSES" value="false" />
+ <option name="CHANGED_ON_SERVER_INTERVAL" value="60" />
+ <option name="SHOW_ONLY_CHANGED_IN_SELECTION_DIFF" value="true" />
+ <option name="FORCE_NON_EMPTY_COMMENT" value="false" />
+ <option name="LAST_COMMIT_MESSAGE" />
+ <option name="MAKE_NEW_CHANGELIST_ACTIVE" value="true" />
+ <option name="OPTIMIZE_IMPORTS_BEFORE_PROJECT_COMMIT" value="false" />
+ <option name="CHECK_FILES_UP_TO_DATE_BEFORE_COMMIT" value="false" />
+ <option name="REFORMAT_BEFORE_PROJECT_COMMIT" value="false" />
+ <option name="REFORMAT_BEFORE_FILE_COMMIT" value="false" />
+ <option name="FILE_HISTORY_DIALOG_COMMENTS_SPLITTER_PROPORTION" value="0.8" />
+ <option name="FILE_HISTORY_DIALOG_SPLITTER_PROPORTION" value="0.5" />
+ <option name="ACTIVE_VCS_NAME" />
+ <option name="UPDATE_GROUP_BY_PACKAGES" value="false" />
+ <option name="UPDATE_GROUP_BY_CHANGELIST" value="false" />
+ <option name="SHOW_FILE_HISTORY_AS_TREE" value="false" />
+ <option name="FILE_HISTORY_SPLITTER_PROPORTION" value="0.6" />
+ </component>
+ <component name="XDebuggerManager">
+ <breakpoint-manager />
+ </component>
+ <component name="editorHistoryManager">
+ <entry file="file://$PROJECT_DIR$/tmp/RubotoTestApp.bak/assets/scripts/ruboto_test_activity.rb">
+ <provider selected="true" editor-type-id="text-editor">
+ <state line="11" column="0" selection-start="335" selection-end="335" vertical-scroll-proportion="0.2859097">
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ <entry file="file://$PROJECT_DIR$/Gemfile">
+ <provider selected="true" editor-type-id="text-editor">
+ <state line="4" column="0" selection-start="46" selection-end="46" vertical-scroll-proportion="0.10026385">
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ <entry file="file://$PROJECT_DIR$/lib/java_class_gen/InheritingClass.java.erb">
+ <provider selected="true" editor-type-id="text-editor">
+ <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0">
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ <entry file="file://$PROJECT_DIR$/assets/src/InheritingClass.java">
+ <provider selected="true" editor-type-id="text-editor">
+ <state line="9" column="58" selection-start="264" selection-end="309" vertical-scroll-proportion="0.0">
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ <entry file="file://$PROJECT_DIR$/assets/src/InheritingActivity.java">
+ <provider selected="true" editor-type-id="text-editor">
+ <state line="0" column="19" selection-start="8" selection-end="19" vertical-scroll-proportion="0.0">
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ <entry file="file://$PROJECT_DIR$/assets/src/InheritingBroadcastReceiver.java">
+ <provider selected="true" editor-type-id="text-editor">
+ <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0">
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ <entry file="file://$PROJECT_DIR$/tmp/RubotoTestApp.bak/test/src/org/ruboto/test/RubotoTestActivityTest.java">
+ <provider selected="true" editor-type-id="text-editor">
+ <state line="13" column="40" selection-start="484" selection-end="484" vertical-scroll-proportion="0.08943089">
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ <entry file="file://$PROJECT_DIR$/assets/assets/scripts/ruboto.rb">
+ <provider selected="true" editor-type-id="text-editor">
+ <state line="24" column="17" selection-start="807" selection-end="807" vertical-scroll-proportion="0.0">
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ <entry file="file://$PROJECT_DIR$/bin/ruboto">
+ <provider selected="true" editor-type-id="text-editor">
+ <state line="613" column="0" selection-start="21205" selection-end="21205" vertical-scroll-proportion="0.0">
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ <entry file="file://$PROJECT_DIR$/assets/src/InheritingTest.java">
+ <provider selected="true" editor-type-id="text-editor">
+ <state line="17" column="65" selection-start="657" selection-end="657" vertical-scroll-proportion="0.0">
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ <entry file="file://$PROJECT_DIR$/assets/samples/sample_activity.rb">
+ <provider selected="true" editor-type-id="text-editor">
+ <state line="12" column="0" selection-start="382" selection-end="382" vertical-scroll-proportion="0.0">
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ <entry file="file://$PROJECT_DIR$/test/ruboto_rb_test.rb">
+ <provider selected="true" editor-type-id="text-editor">
+ <state line="15" column="4" selection-start="587" selection-end="587" vertical-scroll-proportion="0.42035398">
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ </component>
+</project>
+
View
2 Gemfile
@@ -1,4 +1,4 @@
-source :gemcutter
+source :rubygems
gem 'main'
gem 'jruby-jars'
View
7 assets/Rakefile
@@ -80,6 +80,13 @@ task :update_scripts do
end
end
+task :test do
+ Dir.chdir('test') do
+ puts 'Running tests'
+ system "ant run-tests"
+ end
+end
+
def manifest
@manifest ||= REXML::Document.new(File.read('AndroidManifest.xml'))
end
View
10 assets/assets/scripts/ruboto.rb
@@ -20,6 +20,16 @@ def confirm_ruboto_version(required_version, exact=true)
$package_name = "THE_PACKAGE"
+class Object
+ def self.android
+ Java::android
+ end
+
+ def android
+ self.class.android
+ end
+end
+
%w(Activity Dialog BroadcastReceiver Service).map do |klass|
java_import "org.ruboto.Ruboto#{klass}"
end
View
4 assets/samples/sample_activity.rb
@@ -7,8 +7,8 @@
setup_content do
linear_layout :orientation => LinearLayout::VERTICAL do
- @text_view = text_view :text => "What hath Matz wrought?"
- button :text => "M-x butterfly", :width => :wrap_content
+ @text_view = text_view :text => "What hath Matz wrought?", :id => 42
+ button :text => "M-x butterfly", :width => :wrap_content, :id => 43
end
end
View
48 assets/src/InheritingTest.java
@@ -0,0 +1,48 @@
+package THE_PACKAGE;
+
+import android.test.ActivityInstrumentationTestCase2;
+import android.widget.TextView;
+
+/**
+ * This is a simple framework for a test of an Application. See
+ * {@link android.test.ApplicationTestCase ApplicationTestCase} for more information on
+ * how to write and extend Application tests.
+ * <p/>
+ * To run this test, you can type:
+ * adb shell am instrument -w \
+ * -e class THE_PACKAGE.InheritingTestTest \
+ * org.ruboto.test.tests/android.test.InstrumentationTestRunner
+ */
+public class InheritingTestTest extends ActivityInstrumentationTestCase2<InheritingTest> {
+
+ private InheritingTest mActivity; // the activity under test
+ private TextView mView; // the activity's TextView (the only view)
+ private String resourceString;
+
+ public InheritingTestTest() {
+ super("THE_PACKAGE", InheritingTest.class);
+ }
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ mActivity = this.getActivity();
+ resourceString = "What hath Matz wrought?";
+ long start = System.currentTimeMillis();
+ while (mView == null) {
+ if (System.currentTimeMillis() - start > 60000) break;
+ Thread.sleep(1000);
+ mView = (TextView) mActivity.findViewById(42);
+ }
+ assertNotNull(mView);
+ }
+
+ public void testPreconditions() throws Exception {
+ assertNotNull(mView);
+ }
+
+ public void testText() throws Exception {
+ assertEquals(resourceString, (String) mView.getText());
+ }
+
+}
View
47 bin/ruboto
@@ -604,14 +604,9 @@ end
# Builds a script based subclass of Activity, Service, or BroadcastReceiver
#
-def generate_inheriting_file(klass, name, package, script_name, dest='.')
- to = File.join(dest, "src/#{package.gsub('.', '/')}")
-
- FileUtils.cp(File.expand_path(__FILE__ + "/../../assets/src/Inheriting#{klass}.java"), to)
- FileUtils.move(File.join(to, "Inheriting#{klass}.java"), File.join(to, "#{name}.java"))
-
- file = File.join(to, "#{name}.java")
- text = File.read(file)
+def generate_inheriting_file(klass, name, package, script_name, dest='.', filename = name)
+ file = File.join(dest, "src/#{package.gsub('.', '/')}", "#{filename}.java")
+ text = File.read(File.expand_path(__FILE__ + "/../../assets/src/Inheriting#{klass}.java"))
File.open(file, 'w') do |f|
f << text.gsub("THE_PACKAGE", package).gsub("Inheriting#{klass}", name).gsub("start.rb", script_name)
end
@@ -684,41 +679,41 @@ Main {
root = File.expand_path(path)
print "\nGenerating Android app #{name} in #{root}..."
- `android create project -n #{name} -t #{target} -p #{path} -k #{package} -a #{activity}`
+ system "android create project -n #{name} -t #{target} -p #{path} -k #{package} -a #{activity}"
+ puts "Done"
+
+ print "\nGenerating Android test project #{name} in #{root}..."
+ system "android create test-project -m .. -n #{name}Test -p #{path}/test"
puts "Done"
puts "\nCopying files:"
copier = AssetCopier.new $assets, root
- %w{Rakefile .gitignore assets}.each do |f|
+ %w{Rakefile .gitignore assets test}.each do |f|
log_action(f) {copier.copy f}
end
log_action("Ruboto java classes"){copier.copy "src/org/ruboto/*.java", "src/org/ruboto"}
- # Remember the current directory and chdir to the new app directory
- current_dir = Dir.pwd
- Dir.chdir root
+ Dir.chdir root do
+ update_jruby true
- update_jruby true
-
- log_action("\nAdding activities (RubotoActivity and RubotoDialog) and SDK versions to the manifest") do
- verify_manifest.elements['application'].add_element 'activity', {"android:name" => "org.ruboto.RubotoActivity"}
- verify_manifest.elements['application'].add_element 'activity', {"android:name" => "org.ruboto.RubotoDialog",
+ log_action("\nAdding activities (RubotoActivity and RubotoDialog) and SDK versions to the manifest") do
+ verify_manifest.elements['application'].add_element 'activity', {"android:name" => "org.ruboto.RubotoActivity"}
+ verify_manifest.elements['application'].add_element 'activity', {"android:name" => "org.ruboto.RubotoDialog",
"android:theme" => "@android:style/Theme.Dialog"}
- verify_manifest.add_element 'uses-sdk', {"android:minSdkVersion" => min_sdk[/\d+/], "android:targetSdkVersion" => target[/\d+/]}
- File.open("AndroidManifest.xml", 'w') {|f| verify_manifest.document.write(f, 4)}
- end
+ verify_manifest.add_element 'uses-sdk', {"android:minSdkVersion" => min_sdk[/\d+/], "android:targetSdkVersion" => target[/\d+/]}
+ File.open("AndroidManifest.xml", 'w') {|f| verify_manifest.document.write(f, 4)}
+ end
- update_ruboto true
+ update_ruboto true
- generate_core_classes(:class => "all", :method_base => "on", :method_include => "", :method_exclude => "", :force => true, :implements => "")
-
- # Go back to whence we came
- Dir.chdir current_dir
+ generate_core_classes(:class => "all", :method_base => "on", :method_include => "", :method_exclude => "", :force => true, :implements => "")
+ end
log_action("Generating the default Activity and script") do
generate_inheriting_file "Activity", activity, package, "#{underscore(activity)}.rb", path
+ generate_inheriting_file "Test", activity, package, "#{underscore(activity)}_test.rb", "#{path}/test", "#{activity}Test"
end
puts "\nHello, #{name}\n"
View
6 ruboto-core.gemspec
@@ -2,9 +2,9 @@ require 'rake'
Gem::Specification.new do |s|
s.name = %q{ruboto-core}
- s.version = "0.0.3"
- s.date = %q{2010-12-19}
- s.authors = ["Daniel Jackoway", "Charles Nutter", "Scott Moyer"]
+ s.version = "0.0.4"
+ s.date = %q{2011-02-14}
+ s.authors = ["Daniel Jackoway", "Charles Nutter", "Scott Moyer", 'Uwe Kubosch']
s.email = %q{ruboto@googlegroups.com}
s.summary = %q{Platform for writing Android apps in Ruby}
s.homepage = %q{http://ruboto.org/}
View
25 test/ruboto_rb_test.rb
@@ -0,0 +1,25 @@
+require File.expand_path("test_helper", File.dirname(__FILE__))
+require 'fileutils'
+
+class RubotoRbTest < Test::Unit::TestCase
+ APP_NAME = 'RubotoTestApp'
+ TMP_DIR = File.join PROJECT_DIR, 'tmp'
+ APP_DIR = File.join PROJECT_DIR, 'tmp', APP_NAME
+
+ def setup
+ Dir.mkdir TMP_DIR unless File.exists? TMP_DIR
+ system "jruby #{PROJECT_DIR}/bin/ruboto gen app --package org.ruboto.test --path #{APP_DIR} --name #{APP_NAME} --target android-8 --min_sdk android-8 --activity RubotoTestActivity"
+ raise "gen app failed with return code #$?" unless $? == 0
+ end
+
+ def teardown
+ FileUtils.rm_rf APP_DIR if File.exists? APP_DIR
+ end
+
+ def test_that_tests_work_on_new_project
+ Dir.chdir "#{APP_DIR}/test" do
+ system 'ant run-tests'
+ raise "installation failed with return code #$?" unless $? == 0
+ end
+ end
+end
View
4 test/test_helper.rb
@@ -0,0 +1,4 @@
+require "test/unit"
+
+PROJECT_DIR = File.expand_path('..', File.dirname(__FILE__))
+$LOAD_PATH << PROJECT_DIR

0 comments on commit 50672b8

Please sign in to comment.