mocha-color 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
data/lib/mocha-color.rb
CHANGED
@@ -0,0 +1,13 @@
|
|
1
|
+
module Mocha
|
2
|
+
class UnexpectedInvocation
|
3
|
+
alias :original_to_s :to_s
|
4
|
+
|
5
|
+
def to_s
|
6
|
+
color = Test::Unit::Color.new("yellow")
|
7
|
+
reset_color = Mocha::Color::RESET_COLOR
|
8
|
+
|
9
|
+
message = "\n%s%s%s" % [ color.escape_sequence, "unexpected invocation", reset_color.escape_sequence ]
|
10
|
+
original_to_s.gsub(/unexpected invocation/, message)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
data/lib/mocha-color/version.rb
CHANGED
@@ -0,0 +1,9 @@
|
|
1
|
+
require "mocha-color/unexpected_invocation"
|
2
|
+
|
3
|
+
class TestUnexpectedInvocation < MiniTest::Unit::TestCase
|
4
|
+
|
5
|
+
def test_to_s
|
6
|
+
unexpected_invocation = Mocha::UnexpectedInvocation.new(Object.new, :asdad)
|
7
|
+
assert_match(/\n\e\[33munexpected invocation\e\[0m/, unexpected_invocation.to_s)
|
8
|
+
end
|
9
|
+
end
|
data/test/test_all.rb
CHANGED
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 0.0.
|
8
|
+
- 2
|
9
|
+
version: 0.0.2
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Rafael Souza
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2011-01
|
17
|
+
date: 2011-02-01 00:00:00 -02:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -80,11 +80,13 @@ files:
|
|
80
80
|
- lib/mocha-color/cardinality.rb
|
81
81
|
- lib/mocha-color/expectation.rb
|
82
82
|
- lib/mocha-color/mockery.rb
|
83
|
+
- lib/mocha-color/unexpected_invocation.rb
|
83
84
|
- lib/mocha-color/version.rb
|
84
85
|
- mocha-color.gemspec
|
85
86
|
- test/mocha-color/test_cardinality.rb
|
86
87
|
- test/mocha-color/test_expectation.rb
|
87
88
|
- test/mocha-color/test_mockery.rb
|
89
|
+
- test/mocha-color/test_unexpected_invocation.rb
|
88
90
|
- test/test_all.rb
|
89
91
|
has_rdoc: true
|
90
92
|
homepage: http://github.com/rafaelss/mocha-color
|
@@ -100,7 +102,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
100
102
|
requirements:
|
101
103
|
- - ">="
|
102
104
|
- !ruby/object:Gem::Version
|
103
|
-
hash:
|
105
|
+
hash: -661112211407600893
|
104
106
|
segments:
|
105
107
|
- 0
|
106
108
|
version: "0"
|
@@ -109,7 +111,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
109
111
|
requirements:
|
110
112
|
- - ">="
|
111
113
|
- !ruby/object:Gem::Version
|
112
|
-
hash:
|
114
|
+
hash: -661112211407600893
|
113
115
|
segments:
|
114
116
|
- 0
|
115
117
|
version: "0"
|
@@ -124,4 +126,5 @@ test_files:
|
|
124
126
|
- test/mocha-color/test_cardinality.rb
|
125
127
|
- test/mocha-color/test_expectation.rb
|
126
128
|
- test/mocha-color/test_mockery.rb
|
129
|
+
- test/mocha-color/test_unexpected_invocation.rb
|
127
130
|
- test/test_all.rb
|