mocha-color 0.0.1 → 0.0.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.
@@ -1,6 +1,7 @@
1
1
  require "mocha-color/cardinality"
2
2
  require "mocha-color/expectation"
3
3
  require "mocha-color/mockery"
4
+ require "mocha-color/unexpected_invocation"
4
5
  require "test/unit/color"
5
6
 
6
7
  module Mocha
@@ -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
@@ -1,5 +1,5 @@
1
1
  module Mocha
2
2
  module Color
3
- VERSION = "0.0.1"
3
+ VERSION = "0.0.2"
4
4
  end
5
5
  end
@@ -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
@@ -6,3 +6,4 @@ require "minitest/autorun"
6
6
  require "./test/mocha-color/test_cardinality"
7
7
  require "./test/mocha-color/test_expectation"
8
8
  require "./test/mocha-color/test_mockery"
9
+ require "./test/mocha-color/test_unexpected_invocation"
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 1
9
- version: 0.0.1
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-31 00:00:00 -02:00
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: 2955878610926327846
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: 2955878610926327846
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