Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question for RubyMotion users: How to test in RubyMotion? #7

Open
lassebunk opened this issue Mar 1, 2014 · 7 comments
Open

Question for RubyMotion users: How to test in RubyMotion? #7

lassebunk opened this issue Mar 1, 2014 · 7 comments

Comments

@lassebunk
Copy link
Owner

Right now we don't have any tests for the project in RubyMotion.
Anybody have ideas on how to automatically test the project with RubyMotion?
Thanks.

@tommyschaefer
Copy link

I'm not super familiar with RubyMotion, but I know it uses a miniature version of RSpec called Bacon to run tests. This is the RubyMotion documentation on testing.

Beyond that, I think there are a couple different ways you can go. First, you could just write a little RubyMotion app hit the endpoints that we want to test and then just write Bacon tests to test that the views render properly or something. I think this is kind of cumbersum though, because then you have two completely different test pools to maintain.

It looks like you can also set up your rakefile like:

$:.unshift("/Library/RubyMotion/lib")
require 'motion/project'

$:.unshift("./lib/")
require './lib/dish'

Motion::Project::App.setup do |app|
end

task :spec do
  App.config.spec_mode = true
  spec_files = App.config.spec_files
  App.config.instance_variable_set("@spec_files", spec_files)
  Rake::Task["simulator"].invoke
end

and then run rake spec. I have no idea how accurate this is though.

@lassebunk
Copy link
Owner Author

Yeah. Thanks.
Hmm, I'd like an automatic/continous service like Travis-CI for RubyMotion. Know if something like this exists?

@tommyschaefer
Copy link

We would also have to switch over to RSpec, which I think would be a good move. It's up to you though. If it is something that you think is worthwhile, we should probably do it sooner rather than later... our test pool is only going to grow! I do a ton of work with RSpec, so I could probably move over all the tests pretty quickly.

I agree using Travis CI is a good idea. Here is there blog post discussing testing of RubyMotion apps/gems.

@lassebunk
Copy link
Owner Author

That's great.
RSpec is fine by me.
Do you have the time for helping with this?

@tommyschaefer
Copy link

Definitely! I'm pretty swamped right now but I'll work in it over the next few says and then open a PR

@lassebunk
Copy link
Owner Author

Great. Thanks man 👍

@lassebunk lassebunk reopened this Oct 22, 2014
@lassebunk
Copy link
Owner Author

@tommyschaefer did you make any progress on converting the tests to RSpec?
I'd like to be able to test with Travis so we can make changes ensured it will work. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants