ortho 0.1.0

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.
Files changed (2) hide show
  1. data/bin/ortho +44 -0
  2. metadata +68 -0
@@ -0,0 +1,44 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'coverage'
4
+ require 'test/unit/assertions'
5
+ include Test::Unit::Assertions
6
+ require "test/unit"
7
+
8
+ Coverage.start
9
+
10
+ if ARGV.size == 0
11
+ puts "Too few arguments"
12
+ exit
13
+ elsif ARGV.size == 1
14
+ if ARGV[0] == "start" || ARGV[0] == "end" || ARGV[0] == "clear"
15
+ File.delete("./last_run.txt")
16
+ puts "Ok"
17
+ exit
18
+ end
19
+ require ARGV[0]
20
+ else
21
+ puts "Too many arguments"
22
+ exit
23
+ end
24
+
25
+ current_run = Coverage.result.dup.delete_if{|key,| key =~ /_test\.rb$/}
26
+
27
+ if(File.exists?("./last_run.txt"))
28
+ last_run = File.read("./last_run.txt")
29
+ begin
30
+ assert_equal last_run, current_run.to_s
31
+
32
+ File.delete("./last_run.txt")
33
+ File.open("./last_run.txt", "w") do |f|
34
+ f.write current_run
35
+ end
36
+ rescue Exception=>e
37
+ puts e
38
+ puts "Orthogonality failed! Keeping last run."
39
+ end
40
+ else
41
+ File.open("./last_run.txt", "w") do |f|
42
+ f.write current_run
43
+ end
44
+ end
metadata ADDED
@@ -0,0 +1,68 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ortho
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 1
8
+ - 0
9
+ version: 0.1.0
10
+ platform: ruby
11
+ authors:
12
+ - Derek Hammer
13
+ autorequire:
14
+ bindir: bin
15
+ cert_chain: []
16
+
17
+ date: 2010-09-03 00:00:00 -05:00
18
+ default_executable: ortho
19
+ dependencies: []
20
+
21
+ description: Ortho is short for Orthogonality. It uses the principle of orthogonality to lock down your tests using the code artifact so that you can safely refactor!
22
+ email: derek.r.hammer@gmail.com
23
+ executables:
24
+ - ortho
25
+ extensions: []
26
+
27
+ extra_rdoc_files: []
28
+
29
+ files:
30
+ - bin/ortho
31
+ has_rdoc: true
32
+ homepage: http://www.derekhammer.org
33
+ licenses: []
34
+
35
+ post_install_message:
36
+ rdoc_options: []
37
+
38
+ require_paths:
39
+ - lib
40
+ required_ruby_version: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ">="
44
+ - !ruby/object:Gem::Version
45
+ segments:
46
+ - 1
47
+ - 9
48
+ - 2
49
+ version: 1.9.2
50
+ required_rubygems_version: !ruby/object:Gem::Requirement
51
+ none: false
52
+ requirements:
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ segments:
56
+ - 1
57
+ - 3
58
+ - 6
59
+ version: 1.3.6
60
+ requirements: []
61
+
62
+ rubyforge_project:
63
+ rubygems_version: 1.3.7
64
+ signing_key:
65
+ specification_version: 3
66
+ summary: Lock down tests for refactoring using ortho.
67
+ test_files: []
68
+