Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

adds more gem initialization and test setup

  • Loading branch information...
commit bb31a83646cca14fe1a451f6e945431274413d0b 1 parent 96c31c7
@Najaf Najaf authored
View
22 Rakefile
@@ -1 +1,23 @@
require "bundler/gem_tasks"
+require "rake/testtask"
+
+Rake::TestTask.new :spec do |t|
+ t.libs << "lib" << "spec"
+ t.test_files = FileList["spec/**/*_spec.rb"]
+ t.verbose = true
+end
+
+namespace :spec do
+ Dir['spec/*_spec.rb'].each do |test_file|
+ if (match_data = test_file.match(/spec\/([a-z_]+)_spec.rb/))
+ Rake::TestTask.new(match_data.captures.first.to_sym) do |t|
+ t.libs << 'lib' << 'spec'
+ t.test_files = [test_file]
+ t.verbose = true
+ end
+ end
+ end
+end
+
+
+task default: :spec
View
7 dumb-answers.gemspec
@@ -5,9 +5,9 @@ require 'dumb-answers/version'
Gem::Specification.new do |gem|
gem.name = "dumb-answers"
- gem.version = Dumb::Answers::VERSION
+ gem.version = DumbAnswers::VERSION
gem.authors = ["Najaf Ali"]
- gem.email = ["ali.najaf@gmail.com"]
+ gem.email = ["ali@happybearsoftware.com"]
gem.description = %q{TODO: Write a gem description}
gem.summary = %q{TODO: Write a gem summary}
gem.homepage = ""
@@ -16,4 +16,7 @@ Gem::Specification.new do |gem|
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
gem.require_paths = ["lib"]
+ gem.add_development_dependency 'rake'
+ gem.add_development_dependency 'turn'
+ gem.add_development_dependency 'minitest-matchers'
end
View
5 lib/dumb-answers.rb
@@ -1,7 +1,4 @@
require "dumb-answers/version"
-module Dumb
- module Answers
- # Your code goes here...
- end
+module DumbAnswers
end
View
6 lib/dumb-answers/version.rb
@@ -1,5 +1,3 @@
-module Dumb
- module Answers
- VERSION = "0.0.1"
- end
+module DumbAnswers
+ VERSION = "0.0.1"
end
View
11 spec/spec_helper.rb
@@ -0,0 +1,11 @@
+require 'minitest/spec'
+require 'minitest/autorun'
+require 'minitest/pride'
+require 'turn'
+
+Turn.config.format = :outline
+
+require 'dumb-answers'
+include DumbAnswers
+
+require 'minitest/matchers'
Please sign in to comment.
Something went wrong with that request. Please try again.