ariete-rspec 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +10 -0
- data/.rspec +2 -0
- data/.travis.yml +12 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +76 -0
- data/Rakefile +6 -0
- data/ariete-rspec.gemspec +24 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/lib/ariete/rspec.rb +15 -0
- data/lib/ariete/rspec/version.rb +5 -0
- metadata +112 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 041c3ea2cbe7ef1ccbce310c4bbcce8dbe13788c
|
4
|
+
data.tar.gz: 7a43dda2be5b8bfbe34b0a8d8e0df826bc6660b2
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 92f2c9fc04ee19db289f2ac2bda539ccce1360faf927951b506040df11634724f5658cc7102622f8920b11f781ff6484fc5cceaefb7a1dba55dd889bcb5f1729
|
7
|
+
data.tar.gz: 4cf919de3bc0fd9b01fc42e789434ef2e82b0f2f22490f7049c45190b739ffac9b6b445b2af46f7cdb990d984c5b22ee3fd59f5cca0d76f29193db35d82dc1c8
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2016 Moza USANE
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,76 @@
|
|
1
|
+
# ariete-rspec
|
2
|
+
|
3
|
+
An extension of Ariete for RSpec.
|
4
|
+
You can test standard output with RSpec custom matchers, eg. `be_output`, `be_output_to_stderr`.
|
5
|
+
|
6
|
+
## Requirement
|
7
|
+
|
8
|
+
- Ruby 2.0 or hight
|
9
|
+
- RSpec 3
|
10
|
+
|
11
|
+
## Installation
|
12
|
+
|
13
|
+
```
|
14
|
+
$ (sudo) gem install 'ariete-rspec'
|
15
|
+
```
|
16
|
+
|
17
|
+
## Usage
|
18
|
+
|
19
|
+
### klass.rb
|
20
|
+
|
21
|
+
```ruby
|
22
|
+
class Klass
|
23
|
+
class << self
|
24
|
+
def output_out
|
25
|
+
puts "Ariete is a kind of rabbit."
|
26
|
+
end
|
27
|
+
|
28
|
+
def output_err
|
29
|
+
warn "Ariete means 'Lop' in Italian."
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
```
|
34
|
+
|
35
|
+
### klass_spec.rb
|
36
|
+
|
37
|
+
```ruby
|
38
|
+
require "ariete-rspec"
|
39
|
+
require_relative "klass"
|
40
|
+
|
41
|
+
RSpec.describe Klass do
|
42
|
+
# Ariete extends matchers of RSpec.
|
43
|
+
# Therefore, you can use 'be_output' and 'be_output_to_stderr'.
|
44
|
+
describe ".output_out" do
|
45
|
+
subject { Klass.method(:output_out).to_proc }
|
46
|
+
it { is_expected.to be_output "Ariete is a kind of rabbit.\n" }
|
47
|
+
end
|
48
|
+
|
49
|
+
describe ".output_out (an alternate expression)" do
|
50
|
+
subject { -> { Klass.output_out } }
|
51
|
+
it { is_expected.to be_output "Ariete is a kind of rabbit.\n" }
|
52
|
+
end
|
53
|
+
|
54
|
+
describe ".output_err" do
|
55
|
+
subject { Klass.method(:output_err).to_proc }
|
56
|
+
it { is_expected.to be_output_to_stderr "Ariete means 'Lop' in Italian.\n" }
|
57
|
+
end
|
58
|
+
|
59
|
+
describe ".output_err (an alternate expression)" do
|
60
|
+
subject { -> { Klass.output_err } }
|
61
|
+
it { is_expected.to be_output_to_stderr "Ariete means 'Lop' in Italian.\n" }
|
62
|
+
end
|
63
|
+
end
|
64
|
+
```
|
65
|
+
|
66
|
+
## License
|
67
|
+
|
68
|
+
MIT License
|
69
|
+
|
70
|
+
## Contributing
|
71
|
+
|
72
|
+
1. Fork it ( https://github.com/mozamimy/ariete-rspec/fork )
|
73
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
74
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
75
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
76
|
+
5. Create a new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
lib = File.expand_path('../lib', __FILE__)
|
2
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
|
+
require 'ariete/rspec/version'
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = "ariete-rspec"
|
7
|
+
spec.version = Ariete::Rspec::VERSION
|
8
|
+
spec.authors = ["Moza USANE"]
|
9
|
+
spec.email = ["mozamimy@quellencode.org"]
|
10
|
+
|
11
|
+
spec.summary = %q{An extension of Ariete for RSpec.}
|
12
|
+
spec.description = %q{An extension of Ariete for RSpec.}
|
13
|
+
spec.homepage = "https://github.com/mozamimy/ariete-rspec"
|
14
|
+
spec.license = "MIT"
|
15
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
16
|
+
spec.bindir = "exe"
|
17
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
18
|
+
spec.require_paths = ["lib"]
|
19
|
+
|
20
|
+
spec.add_development_dependency "bundler", "~> 1.11"
|
21
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
22
|
+
spec.add_dependency "rspec", "~> 3.0"
|
23
|
+
spec.add_dependency "ariete", "~> 1.0.3"
|
24
|
+
end
|
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "ariete/rspec"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start
|
data/bin/setup
ADDED
data/lib/ariete/rspec.rb
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'rspec'
|
2
|
+
require 'ariete'
|
3
|
+
require 'ariete/rspec/version'
|
4
|
+
|
5
|
+
RSpec::Matchers.define :be_output do |expect|
|
6
|
+
match do |actual|
|
7
|
+
Ariete.capture_stdout { actual.call } == expect.to_s
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
RSpec::Matchers.define :be_output_to_stderr do |expect|
|
12
|
+
match do |actual|
|
13
|
+
Ariete.capture_stderr { actual.call } == expect.to_s
|
14
|
+
end
|
15
|
+
end
|
metadata
ADDED
@@ -0,0 +1,112 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: ariete-rspec
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Moza USANE
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-03-04 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.11'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.11'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '3.0'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '3.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: ariete
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 1.0.3
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 1.0.3
|
69
|
+
description: An extension of Ariete for RSpec.
|
70
|
+
email:
|
71
|
+
- mozamimy@quellencode.org
|
72
|
+
executables: []
|
73
|
+
extensions: []
|
74
|
+
extra_rdoc_files: []
|
75
|
+
files:
|
76
|
+
- ".gitignore"
|
77
|
+
- ".rspec"
|
78
|
+
- ".travis.yml"
|
79
|
+
- Gemfile
|
80
|
+
- LICENSE.txt
|
81
|
+
- README.md
|
82
|
+
- Rakefile
|
83
|
+
- ariete-rspec.gemspec
|
84
|
+
- bin/console
|
85
|
+
- bin/setup
|
86
|
+
- lib/ariete/rspec.rb
|
87
|
+
- lib/ariete/rspec/version.rb
|
88
|
+
homepage: https://github.com/mozamimy/ariete-rspec
|
89
|
+
licenses:
|
90
|
+
- MIT
|
91
|
+
metadata: {}
|
92
|
+
post_install_message:
|
93
|
+
rdoc_options: []
|
94
|
+
require_paths:
|
95
|
+
- lib
|
96
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
97
|
+
requirements:
|
98
|
+
- - ">="
|
99
|
+
- !ruby/object:Gem::Version
|
100
|
+
version: '0'
|
101
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
102
|
+
requirements:
|
103
|
+
- - ">="
|
104
|
+
- !ruby/object:Gem::Version
|
105
|
+
version: '0'
|
106
|
+
requirements: []
|
107
|
+
rubyforge_project:
|
108
|
+
rubygems_version: 2.5.1
|
109
|
+
signing_key:
|
110
|
+
specification_version: 4
|
111
|
+
summary: An extension of Ariete for RSpec.
|
112
|
+
test_files: []
|