mnmltest 0.0.1 → 1.0.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/lib/mnmltest.rb +6 -5
  2. metadata +4 -3
@@ -1,10 +1,11 @@
1
+ class MnmlTestAssertionError < Exception; end
1
2
  class MnmlTest
2
3
  class << self
3
4
  def assert(expression)
4
- if eval(expression)
5
+ if expression
5
6
  return "Pass: assert(#{expression})"
6
7
  else
7
- raise Exception, "Fail: assert(#{expression})"
8
+ raise MnmlTestAssertionError, "Fail: assert(#{expression})"
8
9
  end
9
10
  end
10
11
 
@@ -12,7 +13,7 @@ class MnmlTest
12
13
  if x == y
13
14
  return "Pass: assert_equal(#{x}, #{y})"
14
15
  else
15
- raise Exception, "Fail: assert_equal(#{x}. #{y})"
16
+ raise MnmlTestAssertionError, "Fail: assert_equal(#{x}. #{y})"
16
17
  end
17
18
  end
18
19
 
@@ -20,7 +21,7 @@ class MnmlTest
20
21
  if x != y
21
22
  return "Pass: assert_not_equal(#{x}, #{y})"
22
23
  else
23
- raise Exception, "Fail: assert_not_equal(#{x}, #{y})"
24
+ raise MnmlTestAssertionError, "Fail: assert_not_equal(#{x}, #{y})"
24
25
  end
25
26
  end
26
27
 
@@ -28,7 +29,7 @@ class MnmlTest
28
29
  if value == nil
29
30
  return "Pass: assert_nil(#{value})"
30
31
  else
31
- return "Fail: assert_nil(#{value})"
32
+ raise MnmlTestAssertionError, "Fail: assert_nil(#{value})"
32
33
  end
33
34
  end
34
35
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mnmltest
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 1.0.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,10 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-05-27 00:00:00.000000000 Z
12
+ date: 2012-05-28 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: A minimal testing framework that provides all the features a programmer
15
- needs for simple testing.
15
+ needs for simple testing. Removed eval in assert, no need to put test in quotes.
16
+ Made MnmlTestAssertionError error class.
16
17
  email: slmnwise@gmail.com
17
18
  executables: []
18
19
  extensions: []