testies 0.0.1.alpha

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,9 @@
1
+ *.gem
2
+ .bundle
3
+ Gemfile.lock
4
+ pkg/*
5
+ log/
6
+ DOCS/
7
+ BACKUP/
8
+ vendor/
9
+ .DS_Store
@@ -0,0 +1 @@
1
+ test-gemset
@@ -0,0 +1 @@
1
+ 1.9.2-p290
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in testies.gemspec
4
+ gemspec
@@ -0,0 +1,34 @@
1
+ # A sample Guardfile
2
+ # More info at https://github.com/guard/guard#readme
3
+
4
+ guard :test do
5
+ # with Minitest::Unit
6
+ # watch(%r|^test/(.*[^/]+)test_(.*)\.rb|)
7
+ # watch(%r|^lib/(.*)([^/]+)\.rb|) { |m| "test/#{m[1]}test_#{m[2]}.rb" }
8
+ # watch(%r|^test/helper\.rb|) { "test" }
9
+
10
+ # with Minitest::Spec
11
+ # watch(%r|^spec/(.*)_spec\.rb|)
12
+ # watch(%r|^lib/(.*)\.rb|) { |m| "spec/#{m[1]}_spec.rb" }
13
+ # watch(%r|^spec/spec_helper\.rb|) { "spec" }
14
+ end
15
+
16
+ # guard 'rspec', :version => 2 do
17
+ # watch(%r{^spec/.+_spec\.rb$})
18
+ # watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
19
+ # watch('spec/spec_helper.rb') { "spec" }
20
+
21
+ # # Rails example
22
+ # watch(%r{^spec/.+_spec\.rb$})
23
+ # watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
24
+ # watch(%r{^app/(.*)(\.erb|\.haml)$}) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" }
25
+ # watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
26
+ # watch(%r{^app/controllers/(.+)_(controller)\.rb$}) { |m| ["spec/routing/#{m[1]}_routing_spec.rb", "spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "spec/acceptance/#{m[1]}_spec.rb"] }
27
+ # watch(%r{^spec/support/(.+)\.rb$}) { "spec" }
28
+ # watch('spec/spec_helper.rb') { "spec" }
29
+ # watch('config/routes.rb') { "spec/routing" }
30
+ # watch('app/controllers/application_controller.rb') { "spec/controllers" }
31
+ # # Capybara request specs
32
+ # watch(%r{^app/views/(.+)/.*\.(erb|haml)$}) { |m| "spec/requests/#{m[1]}_spec.rb" }
33
+ # end
34
+
@@ -0,0 +1,7 @@
1
+ # DO NOT EDIT THIS FILE! (Create new task(s) using lib/tasks/*.rake convention
2
+
3
+ require "bundler/gem_tasks"
4
+
5
+ require File.join(File.dirname(__FILE__), 'lib', 'loader.rb')
6
+
7
+ Dir[File.join ROOT_LIB, 'tasks', '*.rake'].each { |task| load task }
@@ -0,0 +1,11 @@
1
+ ROOT = File.expand_path('./') unless defined? ROOT
2
+ ROOT_LIB = File.join(ROOT, 'lib') unless defined? ROOT_LIB
3
+ ROOT_CONFIG = File.join(ROOT, 'config') unless defined? ROOT_CONFIG
4
+
5
+ require 'yaml'
6
+ SETTINGS = YAML::load( File.read( File.join(ROOT_CONFIG, 'settings.yml') ) )['development'] unless defined? SETTINGS
7
+
8
+ puts "ROOT #{ROOT}"
9
+ puts "ROOT_LIB #{ROOT_LIB}"
10
+ puts "ROOT_CONFIG #{ROOT_CONFIG}"
11
+ puts "SETTINGS #{SETTINGS}"
@@ -0,0 +1,12 @@
1
+ # Settings yaml
2
+ defaults: &defaults
3
+ host: 127.0.0.1
4
+
5
+ development:
6
+ <<: *defaults
7
+
8
+ test:
9
+ <<: *defaults
10
+
11
+ production:
12
+ <<: *defaults
@@ -0,0 +1,2 @@
1
+ class Dummy
2
+ end
@@ -0,0 +1,4 @@
1
+ module Extensions; end
2
+
3
+ Dir[File.join ROOT_LIB, 'extensions', '*.rb'].each { |lib| require lib }
4
+
@@ -0,0 +1,13 @@
1
+ class PrideIO
2
+ def initialize io
3
+ @io = io
4
+ end
5
+
6
+ def print o
7
+ # ...
8
+ end
9
+
10
+ def method_missing msg, *args
11
+ @io.send msg, *args
12
+ end
13
+ end
@@ -0,0 +1,98 @@
1
+ # >> "this is red".red
2
+ #
3
+ # >> "this is red with a blue background (read: ugly)".red_on_blue
4
+ #
5
+ # >> "this is red with an underline".red.underline
6
+ #
7
+ # >> "this is really bold and really blue".bold.blue
8
+ #
9
+ # >> Colored.red "This is red" # but this part is mostly untested
10
+ module Extensions
11
+ module String
12
+ module Color
13
+ extend self
14
+
15
+ COLORS = {
16
+ 'black' => 30,
17
+ 'red' => 31,
18
+ 'green' => 32,
19
+ 'yellow' => 33,
20
+ 'blue' => 34,
21
+ 'magenta' => 35,
22
+ 'cyan' => 36,
23
+ 'white' => 37
24
+ }
25
+
26
+ EXTRAS = {
27
+ 'clear' => 0,
28
+ 'bold' => 1,
29
+ 'underline' => 4,
30
+ 'reversed' => 7
31
+ }
32
+
33
+ COLORS.each_key do |color|
34
+ define_method(color) do
35
+ colorize(self, :foreground => color)
36
+ end
37
+
38
+ define_method("on_#{color}") do
39
+ colorize(self, :background => color)
40
+ end
41
+
42
+ COLORS.each_key do |highlight|
43
+ next if color == highlight
44
+ define_method("#{color}_on_#{highlight}") do
45
+ colorize(self, :foreground => color, :background => highlight)
46
+ end
47
+ end
48
+ end
49
+
50
+ EXTRAS.each do |extra, value|
51
+ next if extra == 'clear'
52
+ define_method(extra) do
53
+ colorize(self, :extra => extra)
54
+ end
55
+ end
56
+
57
+ define_method(:to_eol) do
58
+ tmp = sub(/^(\e\[[\[\e0-9;m]+m)/, "\\1\e[2K")
59
+ if tmp == self
60
+ return "\e[2K" << self
61
+ end
62
+ tmp
63
+ end
64
+
65
+ def colorize(string, options = {})
66
+ colored = [color(options[:foreground]), color("on_#{options[:background]}"), extra(options[:extra])].compact * ''
67
+ colored << string
68
+ colored << extra(:clear)
69
+ end
70
+
71
+ def colors
72
+ @@colors ||= COLORS.keys.sort
73
+ end
74
+
75
+ def extra(extra_name)
76
+ extra_name = extra_name.to_s
77
+ "\e[#{EXTRAS[extra_name]}m" if EXTRAS[extra_name]
78
+ end
79
+
80
+ def color(color_name)
81
+ background = color_name.to_s =~ /on_/
82
+ color_name = color_name.to_s.sub('on_', '')
83
+ return unless color_name && COLORS[color_name]
84
+ "\e[#{COLORS[color_name] + (background ? 10 : 0)}m"
85
+ end
86
+ end
87
+ end
88
+ end # unless Object.const_defined? :Colored
89
+
90
+ def banner title
91
+ "\n#{title} #{ stripe(char: '*', count: 85, color: :yellow)}"
92
+ end
93
+
94
+ def stripe options = { char: '-', count: 85, color: :yellow }
95
+ (options[:char] * options[:count]).send options[:color]
96
+ end
97
+
98
+ String.send( :include, Extensions::String::Color )
@@ -0,0 +1,5 @@
1
+ require 'rubygems'
2
+
3
+ require File.join(File.dirname(__FILE__), '..', 'config', 'environment.rb')
4
+
5
+ Dir[ File.join(ROOT_LIB, '*.rb') ].each { |lib| require lib unless lib == __FILE__ }
@@ -0,0 +1,7 @@
1
+ desc 'Run full seed suite'
2
+ task :seed do
3
+ puts banner("Seeding")
4
+ end
5
+
6
+ namespace :seed do
7
+ end
@@ -0,0 +1,34 @@
1
+ require 'rake/testtask'
2
+
3
+ task default: :test
4
+
5
+ desc 'Run full test suite'
6
+ task :test do
7
+ puts "Running specs"
8
+ Rake::Task['test:specs'].invoke
9
+
10
+ puts "Running tests"
11
+ Rake::Task['test:units'].invoke
12
+ end
13
+
14
+ namespace :test do
15
+ desc 'Run specifications'
16
+ Rake::TestTask.new :specs do |task|
17
+ # task.verbose = true
18
+ task.warning = true
19
+ task.libs << 'spec'
20
+ task.ruby_opts << '-rloader'
21
+ task.ruby_opts << '-rminitest/pride'
22
+ task.test_files = FileList['spec/**/*_spec.rb']
23
+ end
24
+
25
+ desc 'Run unit tests'
26
+ Rake::TestTask.new :units do |task|
27
+ # task.verbose = true
28
+ task.warning = true
29
+ task.libs << 'test'
30
+ task.ruby_opts << '-rloader'
31
+ task.ruby_opts << '-rminitest/pride'
32
+ task.test_files = FileList['test/**/*_test.rb']
33
+ end
34
+ end
@@ -0,0 +1,5 @@
1
+ require "testies/version"
2
+
3
+ module Testies
4
+ # Your code goes here...
5
+ end
@@ -0,0 +1,3 @@
1
+ module Testies
2
+ VERSION = "0.0.1.alpha"
3
+ end
@@ -0,0 +1,11 @@
1
+ require 'spec_helper'
2
+
3
+ describe Dummy do
4
+ before do
5
+ @dummy = Dummy.new
6
+ end
7
+
8
+ it "must not be nil" do
9
+ @dummy.wont_be_nil
10
+ end
11
+ end
@@ -0,0 +1,11 @@
1
+ require 'minitest/spec'
2
+ # MiniTest::Unit.output = PrideIO.new(MiniTest::Unit.output)
3
+ MiniTest::Unit.autorun
4
+
5
+ module MiniTest
6
+ class Spec
7
+ def self.context desc, &block
8
+ describe desc, &block
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,3 @@
1
+ require 'test/unit'
2
+
3
+ MiniTest::Unit.autorun
@@ -0,0 +1,11 @@
1
+ require 'test_helper'
2
+
3
+ class DummyTest < MiniTest::Unit::TestCase
4
+ def setup
5
+ @dummy = Dummy.new
6
+ end
7
+
8
+ def test_dummy
9
+ assert @dummy
10
+ end
11
+ end
@@ -0,0 +1,27 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "testies/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "testies"
7
+ s.version = Testies::VERSION
8
+ s.authors = ["Snuggs"]
9
+ s.email = ["RashaunStovall@gmail.com"]
10
+ s.homepage = "http://github.com/snuggs/testies"
11
+ s.summary = %q{Testing configuration conventions}
12
+ s.description = %q{Testing configuration conventions}
13
+
14
+ s.rubyforge_project = "testies"
15
+
16
+ s.files = `git ls-files`.split("\n")
17
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
18
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
19
+ s.require_paths = ["lib"]
20
+
21
+ # specify any dependencies here; for example:
22
+ s.add_dependency("rake")
23
+ s.add_dependency("minitest", "~> 2.10.0")
24
+ s.add_dependency("bundler")
25
+ # s.add_development_dependency "rspec"
26
+ # s.add_runtime_dependency "rest-client"
27
+ end
metadata ADDED
@@ -0,0 +1,105 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: testies
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1.alpha
5
+ prerelease: 6
6
+ platform: ruby
7
+ authors:
8
+ - Snuggs
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-01-04 00:00:00.000000000Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: rake
16
+ requirement: &70198646278120 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: *70198646278120
25
+ - !ruby/object:Gem::Dependency
26
+ name: minitest
27
+ requirement: &70198652577000 !ruby/object:Gem::Requirement
28
+ none: false
29
+ requirements:
30
+ - - ~>
31
+ - !ruby/object:Gem::Version
32
+ version: 2.10.0
33
+ type: :runtime
34
+ prerelease: false
35
+ version_requirements: *70198652577000
36
+ - !ruby/object:Gem::Dependency
37
+ name: bundler
38
+ requirement: &70198652576580 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ! '>='
42
+ - !ruby/object:Gem::Version
43
+ version: '0'
44
+ type: :runtime
45
+ prerelease: false
46
+ version_requirements: *70198652576580
47
+ description: Testing configuration conventions
48
+ email:
49
+ - RashaunStovall@gmail.com
50
+ executables: []
51
+ extensions: []
52
+ extra_rdoc_files: []
53
+ files:
54
+ - .gitignore
55
+ - .rbenv-gemsets
56
+ - .rbenv-version
57
+ - Gemfile
58
+ - Gemfile.lock
59
+ - Guardfile
60
+ - Rakefile
61
+ - config/environment.rb
62
+ - config/settings.yml
63
+ - lib/dummy.rb
64
+ - lib/extensions.rb
65
+ - lib/extensions/minitest.rb
66
+ - lib/extensions/string.rb
67
+ - lib/loader.rb
68
+ - lib/tasks/seed.rake
69
+ - lib/tasks/test.rake
70
+ - lib/testies.rb
71
+ - lib/testies/version.rb
72
+ - spec/dummy_spec.rb
73
+ - spec/spec_helper.rb
74
+ - test/test_helper.rb
75
+ - test/unit/dummy_test.rb
76
+ - testies.gemspec
77
+ homepage: http://github.com/snuggs/testies
78
+ licenses: []
79
+ post_install_message:
80
+ rdoc_options: []
81
+ require_paths:
82
+ - lib
83
+ required_ruby_version: !ruby/object:Gem::Requirement
84
+ none: false
85
+ requirements:
86
+ - - ! '>='
87
+ - !ruby/object:Gem::Version
88
+ version: '0'
89
+ required_rubygems_version: !ruby/object:Gem::Requirement
90
+ none: false
91
+ requirements:
92
+ - - ! '>'
93
+ - !ruby/object:Gem::Version
94
+ version: 1.3.1
95
+ requirements: []
96
+ rubyforge_project: testies
97
+ rubygems_version: 1.8.11
98
+ signing_key:
99
+ specification_version: 3
100
+ summary: Testing configuration conventions
101
+ test_files:
102
+ - spec/dummy_spec.rb
103
+ - spec/spec_helper.rb
104
+ - test/test_helper.rb
105
+ - test/unit/dummy_test.rb