Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@wlangstroth
Created February 8, 2013 02:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wlangstroth/4736053 to your computer and use it in GitHub Desktop.
Save wlangstroth/4736053 to your computer and use it in GitHub Desktop.
Mixed Testing: MiniTest Unit and Spec
# test/minitest_helper.rb
require "turn/autorun"
require "minitest/spec"
require "minitest/autorun"
Turn.config do |c|
c.format = :pretty
end
require 'rake/testtask'
Rake::TestTask.new do |t|
t.libs << "lib"
t.libs << "test"
t.pattern = "test/*_test.rb"
end
class Rule
def self.setters(*method_names)
method_names.each do |name|
send :define_method, name do |data|
instance_variable_set "@#{name}".to_sym, data.
end
end
end
setters :trigger
def initialize &block
@trigger = "blank trigger special_sauce"
instance_eval &block
"in a #{@trigger}"
end
end
require "minitest_helper"
class RuleTest < MiniTest::Unit::TestCase
def setup
end
def teardown
end
def test_stuff
assert_equal true, true
end
end
describe Array do
it "can be created with no arguments" do
Array.new.must_be_instance_of Array
end
it "can be created with a specific size" do
Array.new(10).size.must_equal 10
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment