Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.