ariete 0.3.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 67e5520cfbf95af12618034a3f9d792cafd393c4
4
- data.tar.gz: 87e1641f107b1a79e9fea63b842079fefaa1b236
3
+ metadata.gz: 5cc2baae6b4062040abe32504ee4e96164daec13
4
+ data.tar.gz: 68189fbefb74d664aa3e9d986c7a37ab97615769
5
5
  SHA512:
6
- metadata.gz: 93c9ea004d9382bf677d727b4db87cb9de837330241a6527b2c4a1534888c44556408429ba8deb08c34aae0f78afee6988bd0b48c9c7b6636415c22cd8995913
7
- data.tar.gz: 1b7cd7145f59092778ada592d9133999221fab96410c3884fb307ab1aab2b9cd7c873ede9eed0eea182f1ee072dd3f2342026d8279565b857d4e791e00a79b66
6
+ metadata.gz: 4fb6dcebb2ff1c9821cd4750b8905861b97adfbba2ebd6b9214e226efd991712c842b08b961eea1b981b64b20fa435e71406e3f0e0d851586739003a87f74530
7
+ data.tar.gz: 97747580c91b011e63a6031042bb133677be5b0dcfedf4835547bb59c582e2de4eae1a50571889296cdc7a9b10038e9edf700e8f343de278fe2af714fdd6ae83
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ariete (0.3.0)
4
+ ariete (1.0.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -42,6 +42,18 @@ require_relative "klass"
42
42
  RSpec.describe Klass do
43
43
  include Ariete
44
44
 
45
+ # Ariete extends matchers of RSpec.
46
+ # Therefore, you can use 'be_output' and 'be_output_to_stderr'.
47
+ describe ".output_out" do
48
+ subject { Klass.method(:output_out).to_proc }
49
+ it { expect(subject).to be_output "Ariete is a kind of rabbit.\n" }
50
+ end
51
+
52
+ describe ".output_err" do
53
+ subject { Klass.method(:output_err).to_proc }
54
+ it { expect(subject).to be_output_to_stderr "Ariete means 'Lop' in Italian.\n" }
55
+ end
56
+
45
57
  # You can use without 'Ariete.' if you include Ariete.
46
58
  describe ".output_out" do
47
59
  subject { capture_stdout { Klass.output_out } }
@@ -24,3 +24,15 @@ module Ariete
24
24
  module_function "capture_#{name}"
25
25
  end
26
26
  end
27
+
28
+ RSpec::Matchers.define :be_output do |expect|
29
+ match do |actual|
30
+ Ariete.capture_stdout { actual.call } == expect.to_s
31
+ end
32
+ end
33
+
34
+ RSpec::Matchers.define :be_output_to_stderr do |expect|
35
+ match do |actual|
36
+ Ariete.capture_stderr { actual.call } == expect.to_s
37
+ end
38
+ end
@@ -1,3 +1,3 @@
1
1
  module Ariete
2
- VERSION = "0.3.0"
2
+ VERSION = "1.0.0"
3
3
  end
@@ -34,4 +34,16 @@ RSpec.describe Ariete do
34
34
  it { expect(subject).to eq "Ariete means 'Lop' in Italian.\n" }
35
35
  end
36
36
  end
37
+
38
+ describe "custom matchers" do
39
+ describe "#be_output" do
40
+ subject { method(:output).to_proc }
41
+ it { expect(subject).to be_output "Ariete is a kind of rabbit.\n" }
42
+ end
43
+
44
+ describe "#be_output_to_stderr" do
45
+ subject { method(:output).to_proc }
46
+ it { expect(subject).to be_output_to_stderr "Ariete means 'Lop' in Italian.\n" }
47
+ end
48
+ end
37
49
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ariete
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Moza USANE
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-16 00:00:00.000000000 Z
11
+ date: 2014-11-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -92,7 +92,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
92
92
  version: '0'
93
93
  requirements: []
94
94
  rubyforge_project:
95
- rubygems_version: 2.2.2
95
+ rubygems_version: 2.4.3
96
96
  signing_key:
97
97
  specification_version: 4
98
98
  summary: Ariete is capturing module for STDOUT & STDERR.