Skip to content

Instantly share code, notes, and snippets.

@proubits
proubits / life.feature
Created January 16, 2014 08:47
The cucumber feature file for the game of life ruby implementation
#life.feature
Feature: life generation
In order to play game of life
As a player
I want to start the game and watch the life generation patterns
Scenario: generate block pattern
Given a "block" pattern as seed
When game generate next generation
@proubits
proubits / Rakefile
Created January 16, 2014 09:34
A cucumber rake task to add to the Rake file of a ruby app
Cucumber::Rake::Task.new(:features) do |t|
t.cucumber_opts = "features --format pretty"
end
RSpec::Core::RakeTask.new(:spec)
@proubits
proubits / life_steps.rb
Last active January 3, 2016 10:58
step definition for life feature, version 1
#life_steps.rb
require File.expand_path('lib/life.rb')
def get_pattern(pattern)
#ommitted, return the pattern
#check details on https://gist.github.com/proubits/dfa9964ed6f67a1db60c
end
def get_next_generation_pattern(pattern)
#ommitted, return the pattern
@proubits
proubits / rubymine-set-spork
Last active April 21, 2016 00:19
Make RubyMine to run rspec/cucumber with Spork DRb Server
==Make RubyMine to run rspec/cucumber with Spork DRb Server
I was testing RubyMine 6.3 and encountered a problem when running spec file with Spork DRb Server running at the background. The Rspec test failed with the following error message:
no such file to load -- teamcity/spec/runner/formatter/teamcity/formatter (LoadError)
RubyMine can run the spec without problem if there's no DRb running.
I spent a lot of time researching the topic to fix it and couldn't find an exact solution for the problem. However from the online resources I was able to come out with a way to fix the problem. Basically, you need to tell RubyMine to run spork with load path for the formatter.
In RubyMine you can set the Run options for Spork. For RubyMine 6.3, go to menu <b>Run</b>...<b>Edit Configurations</b>..., select <b>Defaults</b>...<b>Spork DRb</b>. Now on the <i>Environment variables</i> add this "<tt>RUBYMINE_HOME=/path/to/your-ruby-mine/</tt>"(ignore the double quote), and on the <i>Ruby arguments</i>, append this to th