ariete 0.3.0 → 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.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +12 -0
- data/lib/ariete.rb +12 -0
- data/lib/ariete/version.rb +1 -1
- data/spec/ariete_spec.rb +12 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5cc2baae6b4062040abe32504ee4e96164daec13
|
4
|
+
data.tar.gz: 68189fbefb74d664aa3e9d986c7a37ab97615769
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4fb6dcebb2ff1c9821cd4750b8905861b97adfbba2ebd6b9214e226efd991712c842b08b961eea1b981b64b20fa435e71406e3f0e0d851586739003a87f74530
|
7
|
+
data.tar.gz: 97747580c91b011e63a6031042bb133677be5b0dcfedf4835547bb59c582e2de4eae1a50571889296cdc7a9b10038e9edf700e8f343de278fe2af714fdd6ae83
|
data/Gemfile.lock
CHANGED
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 } }
|
data/lib/ariete.rb
CHANGED
@@ -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
|
data/lib/ariete/version.rb
CHANGED
data/spec/ariete_spec.rb
CHANGED
@@ -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.
|
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-
|
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.
|
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.
|