etest 0.4.1 → 0.4.2

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.
data/#Rakefile# ADDED
@@ -0,0 +1,18 @@
1
+ task :default => :test
2
+
3
+ task :test do
4
+ sh "ruby test/test.rb"
5
+ end
6
+
7
+ task :rcov do
8
+ sh "cd test; rcov -o ../coverage -x ruby/.*/gems -x ^test.rb test.rb"
9
+ end
10
+
11
+ task :rdoc do
12
+ sh "rdoc -o doc/rdoc"
13
+ end
14
+
15
+ Dir["#{File.dirname(__FILE__)}/tasks/*.rake"].sort.each { |ext|
16
+ puts ext
17
+
18
+ 2B load ext }
data/Manifest CHANGED
@@ -0,0 +1,20 @@
1
+ #Rakefile#
2
+ Rakefile
3
+ VERSION
4
+ gem.yml
5
+ init.rb
6
+ lib/dlog_ext.rb
7
+ lib/etest.rb
8
+ lib/etest/assertions.rb
9
+ lib/etest/comparison_assertions.rb
10
+ lib/etest/grep.rb
11
+ lib/module_ext.rb
12
+ lib/string_ext.rb
13
+ script/console
14
+ script/rebuild
15
+ tasks/echoe.rake
16
+ test/assertions.rb
17
+ test/etest_assertions.rb
18
+ test/etest_string.rb
19
+ test/test.rb
20
+ Manifest
data/VERSION CHANGED
@@ -1,2 +1 @@
1
- 0.4.1
2
-
1
+ 0.4.2
data/etest.gemspec CHANGED
@@ -2,15 +2,15 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{etest}
5
- s.version = "0.4.1"
5
+ s.version = "0.4.2"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["pboy"]
9
- s.date = %q{2010-06-13}
9
+ s.date = %q{2010-07-29}
10
10
  s.description = %q{Embedded testing}
11
11
  s.email = %q{eno-pboy@open-lab.org}
12
12
  s.extra_rdoc_files = ["lib/dlog_ext.rb", "lib/etest.rb", "lib/etest/assertions.rb", "lib/etest/comparison_assertions.rb", "lib/etest/grep.rb", "lib/module_ext.rb", "lib/string_ext.rb", "tasks/echoe.rake"]
13
- s.files = ["Manifest", "Rakefile", "VERSION", "gem.yml", "init.rb", "lib/dlog_ext.rb", "lib/etest.rb", "lib/etest/assertions.rb", "lib/etest/comparison_assertions.rb", "lib/etest/grep.rb", "lib/module_ext.rb", "lib/string_ext.rb", "script/console", "script/rebuild", "tasks/echoe.rake", "test/etest_assertions.rb", "test/etest_string.rb", "test/test.rb", "etest.gemspec"]
13
+ s.files = ["#Rakefile#", "Rakefile", "VERSION", "gem.yml", "init.rb", "lib/dlog_ext.rb", "lib/etest.rb", "lib/etest/assertions.rb", "lib/etest/comparison_assertions.rb", "lib/etest/grep.rb", "lib/module_ext.rb", "lib/string_ext.rb", "script/console", "script/rebuild", "tasks/echoe.rake", "test/assertions.rb", "test/etest_assertions.rb", "test/etest_string.rb", "test/test.rb", "Manifest", "etest.gemspec"]
14
14
  s.homepage = %q{http://github.com/pboy/etest}
15
15
  s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Etest"]
16
16
  s.require_paths = ["lib"]
data/lib/etest.rb CHANGED
@@ -1,3 +1,5 @@
1
+ require "rubygems"
2
+
1
3
  begin
2
4
  require "minitest-rg"
3
5
  rescue LoadError
@@ -19,6 +19,10 @@ module Etest::Assertions
19
19
  assert unexpected != actual, "#{actual} equals #{unexpected}, when it shouldn't"
20
20
  end
21
21
 
22
+ def assert_equal(expected, actual)
23
+ assert expected == actual, "Expected\n\n\t#{expected.inspect}\n\ninstead of\n\n\t#{actual.inspect}"
24
+ end
25
+
22
26
  def assert_respond_to(obj, *args)
23
27
  raise ArgumentError, "Missing argument(s)" if args.length < 1
24
28
 
@@ -0,0 +1,37 @@
1
+
2
+ module Etest::Assertions::Etest
3
+ #
4
+ # this actually tests the existance of an assertion and one successful
5
+ # assertion, nothing less, and nothing more...
6
+ def test_asserts
7
+ assert_respond_to "nsn", :upcase
8
+ assert respond_to?(:assert_invalid)
9
+ assert respond_to?(:assert_valid)
10
+ end
11
+
12
+ class TestError < RuntimeError; end
13
+
14
+ def test_assert_raises_kind_of
15
+ assert_raises_kind_of RuntimeError do
16
+ raise TestError
17
+ end
18
+ end
19
+
20
+ def test_assert_file_exist
21
+ assert_file_exist __FILE__
22
+ end
23
+
24
+ def test_xml
25
+ assert_valid_xml <<-XML
26
+ <root>
27
+ <p> lkhj </p>
28
+ </root>
29
+ XML
30
+
31
+ assert_invalid_xml <<-XML
32
+ <root>
33
+ <p> lkhj </p>
34
+ XML
35
+ end
36
+ end
37
+
data/test/test.rb CHANGED
@@ -6,13 +6,13 @@ ETEST_TEST=true
6
6
 
7
7
  #
8
8
  # initialize the gem
9
- require "rubygems"
10
9
  require '../init'
11
10
 
12
11
  require "#{DIRNAME}/etest_assertions.rb"
13
12
  require "#{DIRNAME}/etest_string.rb"
14
13
 
15
14
  require 'logger'
15
+ require 'rubygems'
16
16
  require 'ruby-debug'
17
17
 
18
18
  LOGFILE = "log/test.log"
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: etest
3
3
  version: !ruby/object:Gem::Version
4
- hash: 13
4
+ hash: 11
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 4
9
- - 1
10
- version: 0.4.1
9
+ - 2
10
+ version: 0.4.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - pboy
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-06-13 00:00:00 +02:00
18
+ date: 2010-07-29 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies: []
21
21
 
@@ -35,7 +35,7 @@ extra_rdoc_files:
35
35
  - lib/string_ext.rb
36
36
  - tasks/echoe.rake
37
37
  files:
38
- - Manifest
38
+ - "#Rakefile#"
39
39
  - Rakefile
40
40
  - VERSION
41
41
  - gem.yml
@@ -50,9 +50,11 @@ files:
50
50
  - script/console
51
51
  - script/rebuild
52
52
  - tasks/echoe.rake
53
+ - test/assertions.rb
53
54
  - test/etest_assertions.rb
54
55
  - test/etest_string.rb
55
56
  - test/test.rb
57
+ - Manifest
56
58
  - etest.gemspec
57
59
  has_rdoc: true
58
60
  homepage: http://github.com/pboy/etest