tu-context 0.5.7 → 0.5.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -131,29 +131,6 @@ If you've ever wanted contexts in your Test::Unit tests, then context is for you
131
131
  $ gem sources -a http://gems.github.com
132
132
  $ sudo gem install jeremymcanally-context
133
133
 
134
- == LICENSE:
135
-
136
- Copyright (c) 2008 Jeremy McAnally
137
-
138
- Permission is hereby granted, free of charge, to any person obtaining
139
- a copy of this software and associated documentation files (the
140
- 'Software'), to deal in the Software without restriction, including
141
- without limitation the rights to use, copy, modify, merge, publish,
142
- distribute, sublicense, and/or sell copies of the Software, and to
143
- permit persons to whom the Software is furnished to do so, subject to
144
- the following conditions:
145
-
146
- The above copyright notice and this permission notice shall be
147
- included in all copies or substantial portions of the Software.
148
-
149
- THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
150
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
151
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
152
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
153
- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
154
- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
155
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
156
-
157
134
  == ACKNOWLEDGEMENTS:
158
135
 
159
136
  Original implementation by Jeremy McAnally, but heavily tweaked and borrowed from Rails Core and Pratik Naik. Repackaged as the tu-context gem by David James after pulling together various Github forks.
data/Rakefile CHANGED
@@ -8,7 +8,7 @@ begin
8
8
  gem.summary = %Q{Adds context blocks for Test::Unit}
9
9
  gem.description = %Q{If you've ever wanted contexts in your Test::Unit tests, then context is for you. Your tests will be easier to read and write without all the magic and extra code smell!}
10
10
  gem.email = "jeremymcanally@gmail.com"
11
- gem.homepage = "http://github.com/djsun/tu-context"
11
+ gem.homepage = "http://github.com/djsun/context"
12
12
  gem.authors = ["Jeremy McAnally", "Rails Core", "Pratik Naik"]
13
13
  # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
14
14
  end
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.7
1
+ 0.5.8
@@ -0,0 +1,19 @@
1
+ $:.unshift(File.dirname(__FILE__)) unless
2
+ $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
3
+
4
+ require 'rubygems'
5
+ require 'test/unit'
6
+
7
+ require 'tu-context/core_ext/string'
8
+ require 'tu-context/core_ext/rails_hacks'
9
+
10
+ require 'tu-context/version'
11
+ require 'tu-context/suite'
12
+ require 'tu-context/test'
13
+ require 'tu-context/lifecycle'
14
+ require 'tu-context/context'
15
+ require 'tu-context/shared_behavior'
16
+
17
+ class Test::Unit::TestCase
18
+ extend Context::Context
19
+ end
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -1,2 +1,2 @@
1
1
  require 'test/unit'
2
- require File.dirname(__FILE__) + '/../lib/context'
2
+ require File.dirname(__FILE__) + '/../lib/tu-context'
@@ -0,0 +1,72 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{tu-context}
8
+ s.version = "0.5.8"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Jeremy McAnally", "Rails Core", "Pratik Naik"]
12
+ s.date = %q{2010-07-02}
13
+ s.description = %q{If you've ever wanted contexts in your Test::Unit tests, then context is for you. Your tests will be easier to read and write without all the magic and extra code smell!}
14
+ s.email = %q{jeremymcanally@gmail.com}
15
+ s.extra_rdoc_files = [
16
+ "README.rdoc"
17
+ ]
18
+ s.files = [
19
+ ".document",
20
+ ".gitignore",
21
+ "License.txt",
22
+ "README.rdoc",
23
+ "Rakefile",
24
+ "VERSION",
25
+ "lib/tu-context.rb",
26
+ "lib/tu-context/context.rb",
27
+ "lib/tu-context/core_ext/rails_hacks.rb",
28
+ "lib/tu-context/core_ext/string.rb",
29
+ "lib/tu-context/lifecycle.rb",
30
+ "lib/tu-context/shared_behavior.rb",
31
+ "lib/tu-context/suite.rb",
32
+ "lib/tu-context/test.rb",
33
+ "lib/tu-context/version.rb",
34
+ "tasks/deployment.rake",
35
+ "tasks/environment.rake",
36
+ "test/test_context.rb",
37
+ "test/test_core_ext.rb",
38
+ "test/test_helper.rb",
39
+ "test/test_lifecycle.rb",
40
+ "test/test_nested_lifecycle.rb",
41
+ "test/test_shared.rb",
42
+ "test/test_shared_lifecycle.rb",
43
+ "test/test_test.rb",
44
+ "tu-context.gemspec"
45
+ ]
46
+ s.homepage = %q{http://github.com/djsun/context}
47
+ s.rdoc_options = ["--charset=UTF-8"]
48
+ s.require_paths = ["lib"]
49
+ s.rubygems_version = %q{1.3.7}
50
+ s.summary = %q{Adds context blocks for Test::Unit}
51
+ s.test_files = [
52
+ "test/test_context.rb",
53
+ "test/test_core_ext.rb",
54
+ "test/test_helper.rb",
55
+ "test/test_lifecycle.rb",
56
+ "test/test_nested_lifecycle.rb",
57
+ "test/test_shared.rb",
58
+ "test/test_shared_lifecycle.rb",
59
+ "test/test_test.rb"
60
+ ]
61
+
62
+ if s.respond_to? :specification_version then
63
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
64
+ s.specification_version = 3
65
+
66
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
67
+ else
68
+ end
69
+ else
70
+ end
71
+ end
72
+
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tu-context
3
3
  version: !ruby/object:Gem::Version
4
- hash: 5
4
+ hash: 27
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 5
9
- - 7
10
- version: 0.5.7
9
+ - 8
10
+ version: 0.5.8
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jeremy McAnally
@@ -32,27 +32,19 @@ extra_rdoc_files:
32
32
  files:
33
33
  - .document
34
34
  - .gitignore
35
- - History.txt
36
35
  - License.txt
37
- - Manifest.txt
38
- - PostInstall.txt
39
36
  - README.rdoc
40
37
  - Rakefile
41
38
  - VERSION
42
- - config/hoe.rb
43
- - config/requirements.rb
44
- - context.gemspec
45
- - countloc.rb
46
- - lib/context.rb
47
- - lib/context/context.rb
48
- - lib/context/core_ext/rails_hacks.rb
49
- - lib/context/core_ext/string.rb
50
- - lib/context/lifecycle.rb
51
- - lib/context/shared_behavior.rb
52
- - lib/context/suite.rb
53
- - lib/context/test.rb
54
- - lib/context/version.rb
55
- - setup.rb
39
+ - lib/tu-context.rb
40
+ - lib/tu-context/context.rb
41
+ - lib/tu-context/core_ext/rails_hacks.rb
42
+ - lib/tu-context/core_ext/string.rb
43
+ - lib/tu-context/lifecycle.rb
44
+ - lib/tu-context/shared_behavior.rb
45
+ - lib/tu-context/suite.rb
46
+ - lib/tu-context/test.rb
47
+ - lib/tu-context/version.rb
56
48
  - tasks/deployment.rake
57
49
  - tasks/environment.rake
58
50
  - test/test_context.rb
@@ -63,8 +55,9 @@ files:
63
55
  - test/test_shared.rb
64
56
  - test/test_shared_lifecycle.rb
65
57
  - test/test_test.rb
58
+ - tu-context.gemspec
66
59
  has_rdoc: true
67
- homepage: http://github.com/djsun/tu-context
60
+ homepage: http://github.com/djsun/context
68
61
  licenses: []
69
62
 
70
63
  post_install_message:
@@ -1,10 +0,0 @@
1
- == 0.0.3 2008-10-05
2
-
3
- * 1 minor enhancement:
4
- * Fiddled with the way contexts are defined; makes the object model make more sense and the code cleaner
5
-
6
- == 0.0.1 2008-10-02
7
-
8
- * 1 major enhancement:
9
- * Initial release
10
- * Contexts, lifecycle, and test methods
@@ -1,30 +0,0 @@
1
- History.txt
2
- License.txt
3
- Manifest.txt
4
- PostInstall.txt
5
- README.rdoc
6
- Rakefile
7
- config/hoe.rb
8
- config/requirements.rb
9
- context.gemspec
10
- countloc.rb
11
- lib/context.rb
12
- lib/context/context.rb
13
- lib/context/core_ext/rails_hacks.rb
14
- lib/context/core_ext/string.rb
15
- lib/context/lifecycle.rb
16
- lib/context/shared_behavior.rb
17
- lib/context/suite.rb
18
- lib/context/test.rb
19
- lib/context/version.rb
20
- setup.rb
21
- tasks/deployment.rake
22
- tasks/environment.rake
23
- test/test_context.rb
24
- test/test_core_ext.rb
25
- test/test_helper.rb
26
- test/test_lifecycle.rb
27
- test/test_nested_lifecycle.rb
28
- test/test_shared.rb
29
- test/test_shared_lifecycle.rb
30
- test/test_test.rb
File without changes
@@ -1,73 +0,0 @@
1
- require 'context/version'
2
-
3
- AUTHOR = 'Jeremy McAnally' # can also be an array of Authors
4
- EMAIL = "jeremy@entp.com"
5
- DESCRIPTION = "Contexts and DSL sugar for your tests"
6
- GEM_NAME = 'context' # what ppl will type to install your gem
7
- RUBYFORGE_PROJECT = 'context' # The unix name for your project
8
- HOMEPATH = "http://#{RUBYFORGE_PROJECT}.rubyforge.org"
9
- DOWNLOAD_PATH = "http://rubyforge.org/projects/#{RUBYFORGE_PROJECT}"
10
- EXTRA_DEPENDENCIES = [
11
- # ['activesupport', '>= 1.3.1']
12
- ] # An array of rubygem dependencies [name, version]
13
-
14
- @config_file = "~/.rubyforge/user-config.yml"
15
- @config = nil
16
- RUBYFORGE_USERNAME = "unknown"
17
- def rubyforge_username
18
- unless @config
19
- begin
20
- @config = YAML.load(File.read(File.expand_path(@config_file)))
21
- rescue
22
- puts <<-EOS
23
- ERROR: No rubyforge config file found: #{@config_file}
24
- Run 'rubyforge setup' to prepare your env for access to Rubyforge
25
- - See http://newgem.rubyforge.org/rubyforge.html for more details
26
- EOS
27
- exit
28
- end
29
- end
30
- RUBYFORGE_USERNAME.replace @config["username"]
31
- end
32
-
33
-
34
- REV = nil
35
- # UNCOMMENT IF REQUIRED:
36
- # REV = YAML.load(`svn info`)['Revision']
37
- VERS = Context::VERSION::STRING + (REV ? ".#{REV}" : "")
38
- RDOC_OPTS = ['--quiet', '--title', 'context documentation',
39
- "--opname", "index.html",
40
- "--line-numbers",
41
- "--main", "README.rdoc",
42
- "--inline-source"]
43
-
44
- class Hoe
45
- def extra_deps
46
- @extra_deps.reject! { |x| Array(x).first == 'hoe' }
47
- @extra_deps
48
- end
49
- end
50
-
51
- # Generate all the Rake tasks
52
- # Run 'rake -T' to see list of generated tasks (from gem root directory)
53
- $hoe = Hoe.new(GEM_NAME, VERS) do |p|
54
- p.developer(AUTHOR, EMAIL)
55
- p.description = DESCRIPTION
56
- p.summary = DESCRIPTION
57
- p.url = HOMEPATH
58
- p.rubyforge_name = RUBYFORGE_PROJECT if RUBYFORGE_PROJECT
59
- p.test_globs = ["test/test_*.rb"]
60
- p.clean_globs |= ['**/.*.sw?', '*.gem', '.config', '**/.DS_Store'] #An array of file patterns to delete on clean.
61
-
62
- # == Optional
63
- p.changes = p.paragraphs_of("History.txt", 0..1).join("\n\n")
64
- #p.extra_deps = EXTRA_DEPENDENCIES
65
-
66
- #p.spec_extras = {} # A hash of extra values to set in the gemspec.
67
- end
68
-
69
- CHANGES = $hoe.paragraphs_of('History.txt', 0..1).join("\\n\\n")
70
- PATH = (RUBYFORGE_PROJECT == GEM_NAME) ? RUBYFORGE_PROJECT : "#{RUBYFORGE_PROJECT}/#{GEM_NAME}"
71
- $hoe.remote_rdoc_dir = File.join(PATH.gsub(/^#{RUBYFORGE_PROJECT}\/?/,''), 'rdoc')
72
- $hoe.rsync_args = '-av --delete --ignore-errors'
73
- $hoe.spec.post_install_message = File.open(File.dirname(__FILE__) + "/../PostInstall.txt").read rescue ""
@@ -1,15 +0,0 @@
1
- require 'fileutils'
2
- include FileUtils
3
-
4
- require 'rubygems'
5
- %w[rake hoe].each do |req_gem|
6
- begin
7
- require req_gem
8
- rescue LoadError
9
- puts "This Rakefile requires the '#{req_gem}' RubyGem."
10
- puts "Installation: gem install #{req_gem} -y"
11
- exit
12
- end
13
- end
14
-
15
- $:.unshift(File.join(File.dirname(__FILE__), %w[.. lib]))
@@ -1,44 +0,0 @@
1
- Gem::Specification.new do |s|
2
- s.name = "context"
3
- s.version = "0.5.6"
4
- s.date = "2008-10-03"
5
- s.summary = "Contexts and DSL sugar for your tests"
6
- s.email = "jeremy@entp.com"
7
- s.homepage = "http://github.com/jeremymcanally/context"
8
- s.description = "If you've ever wanted contexts in your Test::Unit tests, then context is for you. Your tests will be easier to read and write without all the magic and extra code smell!"
9
- s.has_rdoc = true
10
- s.authors = ["Jeremy McAnally"]
11
- s.files = [
12
- "README.rdoc",
13
- "Rakefile",
14
- "context.gemspec",
15
- "History.txt",
16
- "License.txt",
17
- "Manifest.txt",
18
- "PostInstall.txt",
19
- "config/hoe.rb",
20
- "config/requirements.rb",
21
- "lib/context.rb",
22
- "lib/context/version.rb",
23
- "lib/context/lifecycle.rb",
24
- "lib/context/suite.rb",
25
- "lib/context/context.rb",
26
- "lib/context/shared_behavior.rb",
27
- "lib/context/test.rb",
28
- "lib/context/version.rb",
29
- "lib/context/core_ext/string.rb",
30
- "lib/context/core_ext/rails_hacks.rb",
31
- "setup.rb"
32
- ]
33
-
34
- s.test_files = [
35
- "test/test_context.rb",
36
- "test/test_core_ext.rb",
37
- "test/test_lifecycle.rb",
38
- "test/test_test.rb",
39
- "test/test_helper.rb"
40
- ]
41
-
42
- s.rdoc_options = ["--main", "README.rdoc"]
43
- s.extra_rdoc_files = ["History.txt", "Manifest.txt", "README.rdoc"]
44
- end
@@ -1,65 +0,0 @@
1
-
2
- def extract_path(argv)
3
- if argv[1].nil?
4
- if argv[0] =~ /-a/
5
- return "/**/*.rb"
6
- elsif argv[0]
7
- if argv[0] =~ /\.rb$/
8
- return argv[0]
9
- end
10
- return argv[0] + "/**/*.rb"
11
- else
12
- return "/**/*.rb"
13
- end
14
- elsif argv[1] =~ /\.rb$/
15
- return argv[1]
16
- else
17
- return argv[1] + "/**/*.rb"
18
- end
19
- end
20
-
21
- def all?
22
- ARGV.join =~ /-a/
23
- end
24
-
25
- def comment?(line)
26
- line =~ /^\s*#/
27
- end
28
-
29
- def blank?(line)
30
- line =~ /^\s*$/
31
- end
32
-
33
- def puke(header, locs, comments, blanks)
34
- puts header + ":"
35
- puts "#{locs} loc"
36
- puts "#{comments} lines of comments"
37
- puts "#{blanks} blank lines"
38
- end
39
-
40
- dir = File.dirname(__FILE__)
41
- full_path = File.join(dir,extract_path(ARGV))
42
- gloc = gcmts = gblanks = 0
43
- Dir[File.expand_path("#{full_path}")].uniq.each do |file|
44
- if file =~ /.*\.rb$/
45
-
46
- loc = cmts = blanks = 0
47
-
48
- File.open(file, "r") do |f|
49
- while f.gets
50
- if comment?($_)
51
- cmts += 1
52
- elsif blank?($_)
53
- blanks += 1
54
- else
55
- loc += 1
56
- end
57
- end
58
- end
59
- gcmts += cmts
60
- gloc += loc
61
- gblanks += blanks
62
- puke(file, loc, cmts, blanks) if all?
63
- end
64
- end
65
- puke("Total", gloc, gcmts, gblanks)