{"id":48248,"date":"2013-07-08T11:54:39","date_gmt":"2013-07-08T08:54:39","guid":{"rendered":"https:\/\/www.altoros.com\/blog\/?p=48248"},"modified":"2020-10-14T17:00:55","modified_gmt":"2020-10-14T14:00:55","slug":"speeding-up-ruby-tests","status":"publish","type":"post","link":"https:\/\/www.altoros.com\/blog\/speeding-up-ruby-tests\/","title":{"rendered":"Speeding Up Ruby Tests"},"content":{"rendered":"<p><a href=\"https:\/\/en.wikipedia.org\/wiki\/Test-driven_development\" rel=\"noopener noreferrer\" target=\"_blank\">Test-driven development<\/a> (TDD) aims at creating stable projects that survive changes over time. By following best practices of TDD, it is possible to stay on the safe side and ensure proper operation of the system. One of the most important things in this process is getting test results as fast as possible (ideally right after the source code changes). However, there are some routines that slow down testing in Ruby.<\/p>\n<p>In this post, we provide recommendations on how to save some precious seconds when you start Ruby-on-Rails tests. You will learn how to avoid re-starting tests each time a change to a file is made, as well as how to check the test coverage of your app.<\/p>\n<p>&nbsp;<\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-transparent ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.altoros.com\/blog\/speeding-up-ruby-tests\/#Profiling\" >Profiling<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.altoros.com\/blog\/speeding-up-ruby-tests\/#Spork\" >Spork<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.altoros.com\/blog\/speeding-up-ruby-tests\/#Guard\" >Guard<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.altoros.com\/blog\/speeding-up-ruby-tests\/#Bonus_Tests_coverage\" >Bonus: Tests coverage<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.altoros.com\/blog\/speeding-up-ruby-tests\/#Further_reading\" >Further reading<\/a><\/li><\/ul><\/nav><\/div>\n<h3><span class=\"ez-toc-section\" id=\"Profiling\"><\/span>Profiling<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>The easiest way to improve testing speed is to find the slowest tests and optimize them. To do this, you need to add the <code style=\"color: black; background-color: #e6e6e6;\">--profile<\/code> option to you command line <code style=\"color: black; background-color: #e6e6e6;\">\/ .rspec<\/code> file. After successful test execution, it will print 10 slowest tests.<\/p>\n<p>&nbsp;<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Spork\"><\/span>Spork<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Unfortunately, test optimizing doesn\u2019t solve the problem with slow Rails startup. For example, for <a href=\"https:\/\/github.com\/borovsky\/lvee\" rel=\"noopener noreferrer\" target=\"_blank\">LVEE<\/a> tests, it adds 15 seconds to testing time (all tests pass in 35 seconds).<\/p>\n<p>To solve this problem, <a href=\"https:\/\/github.com\/sporkrb\/spork\" rel=\"noopener noreferrer\" target=\"_blank\">Spork<\/a> was created. It preloads an application and runs tests in this state.<\/p>\n<p>To integrate Spork with your Ruby (Rails) application, you need to add<\/p>\n<pre class=\"brush: ruby; title: ; notranslate\" title=\"\">gem 'spork' #gem &quot;spork-rails&quot;<\/pre>\n<p>to your <code style=\"color: black; background-color: #e6e6e6;\">Gemfile<\/code> file, execute <code style=\"color: black; background-color: #e6e6e6;\">bundler install<\/code>, and bootstrap config with the following.<\/p>\n<pre class=\"brush: ruby; title: ; notranslate\" title=\"\">spork rspec --bootstrap # if you use RSpec for your tests\r\nspork cucumber --bootstrap  # if you use Cucumber for your tests<\/pre>\n<p>For RSpec, it will generate the config illustrated below (some comments ommited).<\/p>\n<pre class=\"brush: ruby; title: ; notranslate\" title=\"\">require 'rubygems'\r\nrequire 'spork'\r\n#uncomment the following line to use spork with the debugger\r\n#require 'spork\/ext\/ruby-debug'\r\n\r\nSpork.prefork do\r\n  # Loading more in this block will cause your tests to run faster. However,\r\n  # if you change any configuration or code from libraries loaded here, you'll\r\n  # need to restart spork for it take effect.\r\n\r\nend\r\n\r\nSpork.each_run do\r\n  # This code will be run each time you run your specs.\r\n\r\nend\r\n\r\n# Your spec_helper.rb content here<\/pre>\n<p>Here, the <code style=\"color: black; background-color: #e6e6e6;\">Spork.prefork<\/code> part will be run only once (during Spork loading) and <code style=\"color: black; background-color: #e6e6e6;\">Spork.each_run<\/code> will be executed during each test restart. So, it\u2019s good idea to move as much as possible to the prefork block to speed up test running.<\/p>\n<p>For Rails (in addition to your <code style=\"color: black; background-color: #e6e6e6;\">spec_helper<\/code> content), you will need the following input (some lines depend on your gems).<\/p>\n<pre class=\"brush: ruby; title: ; notranslate\" title=\"\">Spork.prefork do\r\n  # Preloading Rails\r\n  require &quot;rails\/application&quot;\r\n  # This line required to proper routes reloading in Rails 3.1+\r\n  Spork.trap_method(Rails::Application::RoutesReloader, :reload!)\r\n\r\n  # Preloading your application\r\n  require File.dirname(__FILE__) + &quot;\/..\/config\/environment.rb&quot;\r\n\r\n  # Preloading RSpec\r\n  require 'rspec\/rails'\r\n\r\n  require 'shoulda\/matchers\/integrations\/rspec' # after require 'rspec\/rails'\r\n\r\n  RSpec.configure do |config|\r\n    # Your RSpec config here\r\n  end\r\nend\r\n\r\nSpork.each_run do\r\n  # Reloading support files each run\r\n  Dir&#x5B;Rails.root.join(&quot;spec\/support\/**\/*.rb&quot;)].each {|f| require f}\r\n\r\n  # Reload FactoryGirl2 factories\r\n  FactoryGirl.reload\r\n\r\n  # Reload locales\r\n  I18n.backend.reload!\r\nend<\/pre>\n<p><b>Note:<\/b> If you change your initializer scripts, you need to reload Spork.<\/p>\n<p>To learn more about Spork, check out <a href=\"https:\/\/github.com\/sporkrb\/spork\/\" rel=\"noopener noreferrer\" target=\"_blank\">the project&#8217;s GitHub repo<\/a>.<\/p>\n<p>&nbsp;<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Guard\"><\/span>Guard<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Now, we can start our tests really fast, but after each file change we need to rerun tests (from command line or using key binding), and it\u2019s boring!<\/p>\n<p><a href=\"https:\/\/github.com\/guard\/guard\" rel=\"noopener noreferrer\" target=\"_blank\">Guard<\/a> automatically tracks changes in your project and runs tests or reloads Spork if the initializer changes. It can also run <code style=\"color: black; background-color: #e6e6e6;\">bundler<\/code> if <code style=\"color: #222222; background-color: #e6e6e6; padding: 1px 2px;\">Gemfile<\/code> changes.<\/p>\n<p>To add it to your application, you need to modify your Gemfile.<\/p>\n<pre class=\"brush: ruby; title: ; notranslate\" title=\"\">group :development do\r\n    gem &quot;guard&quot;\r\n    gem &quot;guard-rspec&quot; # plugin to automate RSpec testing\r\n    gem &quot;guard-cucumber&quot; # plugin to automate Cucumber testing\r\n    gem 'guard-spork' # plugin to automate Spork reload\r\n    gem 'guard-bundler' # plugin to automate Bundler tasks\r\n  end<\/pre>\n<p>For a typical Ruby-on-Rails application, you can use the configuration shown below.<\/p>\n<pre class=\"brush: ruby; title: ; notranslate\" title=\"\"># Guardfile\r\n\r\nguard 'bundler' do\r\n  watch('Gemfile')\r\n  # Uncomment next line if Gemfile contain `gemspec' command\r\n  # watch(\/^.+\\.gemspec\/)\r\nend\r\n\r\nguard 'spork', cucumber_env: { 'RAILS_ENV' =&gt; 'test' }, rspec_env: {'RAILS_ENV' =&gt; 'test' } do\r\n  # Reloading Spork if any of following files changed\r\n  watch('config\/application.rb')\r\n  watch('config\/environment.rb')\r\n  watch('config\/environments\/test.rb')\r\n  watch(%r{^config\/initializers\/.+\\.rb$})\r\n  watch('Gemfile')\r\n  watch('Gemfile.lock')\r\n  # Reload and run specific test type\r\n  watch('spec\/spec_helper.rb') { :rspec }\r\n  watch(%r{features\/support\/}) { :cucumber }\r\nend\r\n\r\nguard 'rspec', cli: '--drb --format Fuubar --color --profile' do\r\n  # Rerun all tests\r\n  watch(%r{^spec\/.+_spec\\.rb$})\r\n  # Rerun tests with specific name\r\n  watch(%r{^lib\/(.+)\\.rb$})     { |m| &quot;spec\/lib\/#{m&#x5B;1]}_spec.rb&quot; }\r\n  watch('spec\/spec_helper.rb')  { &quot;spec&quot; }\r\n\r\n  watch(%r{^app\/(.+)\\.rb$})                           { |m| &quot;spec\/#{m&#x5B;1]}_spec.rb&quot; }\r\n  watch(%r{^app\/controllers\/(.+)_(controller)\\.rb$})  { |m| &#x5B;&quot;spec\/routing\/#{m&#x5B;1]}_routing_spec.rb&quot;, &quot;spec\/#{m&#x5B;2]}s\/#{m&#x5B;1]}_#{m&#x5B;2]}_spec.rb&quot;, &quot;spec\/acceptance\/#{m&#x5B;1]}_spec.rb&quot;] }\r\n  watch(%r{^spec\/support\/(.+)\\.rb$})                  { &quot;spec&quot; }\r\n  watch('config\/routes.rb')                           { &quot;spec\/routing&quot; }\r\n  watch('app\/controllers\/application_controller.rb')  { &quot;spec\/controllers&quot; }\r\nend\r\n\r\nguard 'cucumber', cli: &quot;--drb&quot; do\r\n  watch(%r{^features\/.+\\.feature$})\r\n  watch(%r{^features\/support\/.+$})          { 'features' }\r\n  watch(%r{^features\/step_definitions\/(.+)_steps\\.rb$}) { |m| Dir&#x5B;File.join(&quot;**\/#{m&#x5B;1]}.feature&quot;)]&#x5B;0] || 'features' }\r\nend<\/pre>\n<p>These Guard plugins are smart enough to rerun only changed and failed tests first. If tests are fixed, the plugins will run the whole test suite.<\/p>\n<p>There is bunch of the Guard plugins to automate all the aspects of development. Here are some of them:<\/p>\n<ul>\n<li style=\"margin-bottom: 6px;\"><a href=\"https:\/\/github.com\/guard\/guard-rails\" rel=\"noopener noreferrer\" target=\"_blank\">guard-rails<\/a> automatically reloads an application if required (e.g., initializers\/configuration\/library\/gems were changed).<\/li>\n<li style=\"margin-bottom: 6px;\"><a href=\"https:\/\/github.com\/guard\/guard-livereload\" rel=\"noopener noreferrer\" target=\"_blank\">guard-livereload<\/a> automatically reloads a browser if you changing the view.<\/li>\n<li style=\"margin-bottom: 6px;\"><a href=\"https:\/\/github.com\/therabidbanana\/guard-jekyll\" rel=\"noopener noreferrer\" target=\"_blank\">guard-jekyll<\/a> helps you to write posts to this blog \ud83d\ude42<\/li>\n<li style=\"margin-bottom: 6px;\"><a href=\"https:\/\/github.com\/guard\/guard-jasmine\" rel=\"noopener noreferrer\" target=\"_blank\">guard-jasmine<\/a> automatically runs <a href=\"http:\/\/pivotal.github.io\/jasmine\/\" rel=\"noopener noreferrer\" target=\"_blank\">Jasmine<\/a> tests.<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Bonus_Tests_coverage\"><\/span>Bonus: Tests coverage<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Tests coverage is very useful if you practice TDD: it helps to detect parts of the code that were not checked by tests.<\/p>\n<p>For Ruby 1.9.3, the best gem to generate profiling information is <code style=\"color: black; background-color: #e6e6e6;\">simplecov<\/code>. This gem generates pretty HTML reports.<\/p>\n<p>To integrate it with your test, you need to add the following input.<\/p>\n<pre class=\"brush: ruby; title: ; notranslate\" title=\"\">require 'simplecov'\r\nSimpleCov.start 'rails'<\/pre>\n<p>If you use Spork, you need to add <code style=\"color: black; background-color: #e6e6e6;\">simplecov<\/code> in a bit different manner.<\/p>\n<pre class=\"brush: ruby; title: ; notranslate\" title=\"\">Spork.prefork do\r\n  unless ENV&#x5B;'DRB']\r\n    require 'simplecov'\r\n    SimpleCov.start 'rails'\r\n  end\r\n\r\n  # other code ...\r\nend\r\n\r\nSpork.each_run do\r\n  if ENV&#x5B;'DRB']\r\n    require 'simplecov'\r\n    SimpleCov.start 'rails'\r\n  end\r\n\r\n  # other code ...\r\nend<\/pre>\n<p>This is required, because Spork works internally (using a fork), so the results will be inconsistent unless we start it in the <code style=\"color: black; background-color: #e6e6e6;\">each_run<\/code> section.<\/p>\n<p>&nbsp;<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Further_reading\"><\/span>Further reading<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<ul>\n<li><a href=\"https:\/\/www.altoros.com\/blog\/lets-test-it-well-and-simply-and-smartly-2\/\">Let\u2019s Test It Well: Simply and Smartly<\/a><\/li>\n<li><a href=\"https:\/\/www.altoros.com\/blog\/how-to-integrate-independent-qa-testing-to-shorten-development-cycles\/\">How to Integrate Independent QA Testing to Shorten Development Cycles<\/a><\/li>\n<li><a href=\"https:\/\/www.altoros.com\/blog\/running-capybara-tests-in-remote-browsers\/\">Running Capybara Tests in Remote Browsers<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>This post describes different ways to speed-up development using TDD<\/p>\n","protected":false},"author":41,"featured_media":57846,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"content-type":"","footnotes":"","_links_to":"","_links_to_target":""},"categories":[214],"tags":[1000,895],"class_list":["post-48248","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials","tag-github","tag-research-and-development"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Speeding Up Ruby Tests | Altoros<\/title>\n<meta name=\"description\" content=\"Learn how to employ best practices of test-driven development to enhance Ruby testing, as well as how to use such tools as Spork, Guard, etc.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.altoros.com\/blog\/speeding-up-ruby-tests\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Speeding Up Ruby Tests | Altoros\" \/>\n<meta property=\"og:description\" content=\"This post describes different ways to speed-up development using TDD\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.altoros.com\/blog\/speeding-up-ruby-tests\/\" \/>\n<meta property=\"og:site_name\" content=\"Altoros\" \/>\n<meta property=\"article:published_time\" content=\"2013-07-08T08:54:39+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-10-14T14:00:55+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2013\/07\/speeding-up-ruby-testing-using-test-driven-development.gif\" \/>\n\t<meta property=\"og:image:width\" content=\"893\" \/>\n\t<meta property=\"og:image:height\" content=\"602\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/gif\" \/>\n<meta name=\"author\" content=\"Alexander Borovsky\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Alexander Borovsky\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.altoros.com\\\/blog\\\/speeding-up-ruby-tests\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.altoros.com\\\/blog\\\/speeding-up-ruby-tests\\\/\"},\"author\":{\"name\":\"Alexander Borovsky\",\"@id\":\"https:\\\/\\\/www.altoros.com\\\/blog\\\/#\\\/schema\\\/person\\\/0c22d4c3bafd70abb7bbb13001369cdb\"},\"headline\":\"Speeding Up Ruby Tests\",\"datePublished\":\"2013-07-08T08:54:39+00:00\",\"dateModified\":\"2020-10-14T14:00:55+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.altoros.com\\\/blog\\\/speeding-up-ruby-tests\\\/\"},\"wordCount\":1139,\"commentCount\":6,\"image\":{\"@id\":\"https:\\\/\\\/www.altoros.com\\\/blog\\\/speeding-up-ruby-tests\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.altoros.com\\\/blog\\\/wp-content\\\/uploads\\\/2013\\\/07\\\/speeding-up-ruby-testing-using-test-driven-development.gif\",\"keywords\":[\"GitHub\",\"Research and Development\"],\"articleSection\":[\"Tutorials\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.altoros.com\\\/blog\\\/speeding-up-ruby-tests\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.altoros.com\\\/blog\\\/speeding-up-ruby-tests\\\/\",\"url\":\"https:\\\/\\\/www.altoros.com\\\/blog\\\/speeding-up-ruby-tests\\\/\",\"name\":\"Speeding Up Ruby Tests | Altoros\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.altoros.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.altoros.com\\\/blog\\\/speeding-up-ruby-tests\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.altoros.com\\\/blog\\\/speeding-up-ruby-tests\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.altoros.com\\\/blog\\\/wp-content\\\/uploads\\\/2013\\\/07\\\/speeding-up-ruby-testing-using-test-driven-development.gif\",\"datePublished\":\"2013-07-08T08:54:39+00:00\",\"dateModified\":\"2020-10-14T14:00:55+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.altoros.com\\\/blog\\\/#\\\/schema\\\/person\\\/0c22d4c3bafd70abb7bbb13001369cdb\"},\"description\":\"This post describes different ways to speed-up development using TDD\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.altoros.com\\\/blog\\\/speeding-up-ruby-tests\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.altoros.com\\\/blog\\\/speeding-up-ruby-tests\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.altoros.com\\\/blog\\\/speeding-up-ruby-tests\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.altoros.com\\\/blog\\\/wp-content\\\/uploads\\\/2013\\\/07\\\/speeding-up-ruby-testing-using-test-driven-development.gif\",\"contentUrl\":\"https:\\\/\\\/www.altoros.com\\\/blog\\\/wp-content\\\/uploads\\\/2013\\\/07\\\/speeding-up-ruby-testing-using-test-driven-development.gif\",\"width\":893,\"height\":602},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.altoros.com\\\/blog\\\/speeding-up-ruby-tests\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.altoros.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Speeding Up Ruby Tests\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.altoros.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.altoros.com\\\/blog\\\/\",\"name\":\"Altoros\",\"description\":\"Insight\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.altoros.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.altoros.com\\\/blog\\\/#\\\/schema\\\/person\\\/0c22d4c3bafd70abb7bbb13001369cdb\",\"name\":\"Alexander Borovsky\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.altoros.com\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/07\\\/Barouski-96x96.jpg\",\"url\":\"https:\\\/\\\/www.altoros.com\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/07\\\/Barouski-96x96.jpg\",\"contentUrl\":\"https:\\\/\\\/www.altoros.com\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/07\\\/Barouski-96x96.jpg\",\"caption\":\"Alexander Borovsky\"},\"description\":\"Alexander is a software engineer with 12+ years of experience working with JVM technologies, such as Clojure and Java. He specializes in architecting and implementing highly scalable and reliable multi-tier distributed applications using Java, Spring, Ruby, and Go. Alexander is committed to leveraging both object-oriented and functional programming best practices.\",\"url\":\"https:\\\/\\\/www.altoros.com\\\/blog\\\/author\\\/alexander-borovsky\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Speeding Up Ruby Tests | Altoros","description":"Learn how to employ best practices of test-driven development to enhance Ruby testing, as well as how to use such tools as Spork, Guard, etc.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.altoros.com\/blog\/speeding-up-ruby-tests\/","og_locale":"en_US","og_type":"article","og_title":"Speeding Up Ruby Tests | Altoros","og_description":"This post describes different ways to speed-up development using TDD","og_url":"https:\/\/www.altoros.com\/blog\/speeding-up-ruby-tests\/","og_site_name":"Altoros","article_published_time":"2013-07-08T08:54:39+00:00","article_modified_time":"2020-10-14T14:00:55+00:00","og_image":[{"width":893,"height":602,"url":"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2013\/07\/speeding-up-ruby-testing-using-test-driven-development.gif","type":"image\/gif"}],"author":"Alexander Borovsky","twitter_misc":{"Written by":"Alexander Borovsky","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.altoros.com\/blog\/speeding-up-ruby-tests\/#article","isPartOf":{"@id":"https:\/\/www.altoros.com\/blog\/speeding-up-ruby-tests\/"},"author":{"name":"Alexander Borovsky","@id":"https:\/\/www.altoros.com\/blog\/#\/schema\/person\/0c22d4c3bafd70abb7bbb13001369cdb"},"headline":"Speeding Up Ruby Tests","datePublished":"2013-07-08T08:54:39+00:00","dateModified":"2020-10-14T14:00:55+00:00","mainEntityOfPage":{"@id":"https:\/\/www.altoros.com\/blog\/speeding-up-ruby-tests\/"},"wordCount":1139,"commentCount":6,"image":{"@id":"https:\/\/www.altoros.com\/blog\/speeding-up-ruby-tests\/#primaryimage"},"thumbnailUrl":"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2013\/07\/speeding-up-ruby-testing-using-test-driven-development.gif","keywords":["GitHub","Research and Development"],"articleSection":["Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.altoros.com\/blog\/speeding-up-ruby-tests\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.altoros.com\/blog\/speeding-up-ruby-tests\/","url":"https:\/\/www.altoros.com\/blog\/speeding-up-ruby-tests\/","name":"Speeding Up Ruby Tests | Altoros","isPartOf":{"@id":"https:\/\/www.altoros.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.altoros.com\/blog\/speeding-up-ruby-tests\/#primaryimage"},"image":{"@id":"https:\/\/www.altoros.com\/blog\/speeding-up-ruby-tests\/#primaryimage"},"thumbnailUrl":"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2013\/07\/speeding-up-ruby-testing-using-test-driven-development.gif","datePublished":"2013-07-08T08:54:39+00:00","dateModified":"2020-10-14T14:00:55+00:00","author":{"@id":"https:\/\/www.altoros.com\/blog\/#\/schema\/person\/0c22d4c3bafd70abb7bbb13001369cdb"},"description":"This post describes different ways to speed-up development using TDD","breadcrumb":{"@id":"https:\/\/www.altoros.com\/blog\/speeding-up-ruby-tests\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.altoros.com\/blog\/speeding-up-ruby-tests\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.altoros.com\/blog\/speeding-up-ruby-tests\/#primaryimage","url":"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2013\/07\/speeding-up-ruby-testing-using-test-driven-development.gif","contentUrl":"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2013\/07\/speeding-up-ruby-testing-using-test-driven-development.gif","width":893,"height":602},{"@type":"BreadcrumbList","@id":"https:\/\/www.altoros.com\/blog\/speeding-up-ruby-tests\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.altoros.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Speeding Up Ruby Tests"}]},{"@type":"WebSite","@id":"https:\/\/www.altoros.com\/blog\/#website","url":"https:\/\/www.altoros.com\/blog\/","name":"Altoros","description":"Insight","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.altoros.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.altoros.com\/blog\/#\/schema\/person\/0c22d4c3bafd70abb7bbb13001369cdb","name":"Alexander Borovsky","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2019\/07\/Barouski-96x96.jpg","url":"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2019\/07\/Barouski-96x96.jpg","contentUrl":"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2019\/07\/Barouski-96x96.jpg","caption":"Alexander Borovsky"},"description":"Alexander is a software engineer with 12+ years of experience working with JVM technologies, such as Clojure and Java. He specializes in architecting and implementing highly scalable and reliable multi-tier distributed applications using Java, Spring, Ruby, and Go. Alexander is committed to leveraging both object-oriented and functional programming best practices.","url":"https:\/\/www.altoros.com\/blog\/author\/alexander-borovsky\/"}]}},"_links":{"self":[{"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/posts\/48248","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/users\/41"}],"replies":[{"embeddable":true,"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/comments?post=48248"}],"version-history":[{"count":21,"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/posts\/48248\/revisions"}],"predecessor-version":[{"id":57932,"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/posts\/48248\/revisions\/57932"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/media\/57846"}],"wp:attachment":[{"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/media?parent=48248"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/categories?post=48248"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/tags?post=48248"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}