rspec-roda 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/.dockerignore +98 -0
- data/.gitignore +9 -0
- data/.gitlab-ci.yml +71 -0
- data/.rspec +3 -0
- data/.rubocop.yml +18 -0
- data/.ruby-version +1 -0
- data/.simplecov +7 -0
- data/.travis.yml +5 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Dockerfile +11 -0
- data/Gemfile +5 -0
- data/LICENSE.txt +21 -0
- data/README.md +102 -0
- data/Rakefile +4 -0
- data/bin/bundle-audit +17 -0
- data/bin/console +15 -0
- data/bin/rake +17 -0
- data/bin/rspec +17 -0
- data/bin/rubocop +17 -0
- data/bin/setup +8 -0
- data/bin/yard +17 -0
- data/bin/yardoc +17 -0
- data/bin/yri +17 -0
- data/lib/rspec/roda.rb +81 -0
- data/lib/rspec/roda/version.rb +6 -0
- data/rakelib/bundle_audit.rake +4 -0
- data/rakelib/bundler.rake +2 -0
- data/rakelib/rspec.rake +6 -0
- data/rakelib/rubocop.rake +5 -0
- data/rakelib/yard.rake +5 -0
- data/rspec-roda.gemspec +45 -0
- metadata +313 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 5bd53c2b9f29d4a668d658618bf2a8682d37cf4c
|
4
|
+
data.tar.gz: 2300fcdd96550aba921b1eb8052ba072ccdfd42e
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: ca9854430cd4de1beb2e604f909e9b4cc777c5eb5d7d8dd94ff5ef4ec2cf23113909e5d7d0acbd2c951f58c15aae947c3e661fa0a476084098ca4b613d1e5fd0
|
7
|
+
data.tar.gz: 35b0ff324b457af0434d334e4768ad601bc0ef239e12be136f630c6ca27a25c2627efc159a9f82de4ebdb7b5c2b5ff5fa5c7a5f36ff8c721d9ba494760b1dd2b
|
data/.dockerignore
ADDED
@@ -0,0 +1,98 @@
|
|
1
|
+
### Ruby template
|
2
|
+
*.gem
|
3
|
+
*.rbc
|
4
|
+
/.config
|
5
|
+
/coverage/
|
6
|
+
/InstalledFiles
|
7
|
+
/pkg/
|
8
|
+
/spec/reports/
|
9
|
+
/spec/examples.txt
|
10
|
+
/test/tmp/
|
11
|
+
/test/version_tmp/
|
12
|
+
/tmp/
|
13
|
+
|
14
|
+
# Used by dotenv library to load environment variables.
|
15
|
+
.env
|
16
|
+
|
17
|
+
## Documentation cache and generated files:
|
18
|
+
/.yardoc/
|
19
|
+
/_yardoc/
|
20
|
+
/rdoc/
|
21
|
+
|
22
|
+
## Environment normalization:
|
23
|
+
/.bundle/
|
24
|
+
/vendor/bundle
|
25
|
+
/lib/bundler/man/
|
26
|
+
/.bundle
|
27
|
+
|
28
|
+
# Roda is the gem, so ignore these files since the code is intended to run
|
29
|
+
# in multiple environments:
|
30
|
+
.ruby-version
|
31
|
+
.ruby-gemset
|
32
|
+
|
33
|
+
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
|
34
|
+
.rvmrc
|
35
|
+
### JetBrains template
|
36
|
+
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
|
37
|
+
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
|
38
|
+
|
39
|
+
# User-specific stuff:
|
40
|
+
.idea/workspace.xml
|
41
|
+
.idea/tasks.xml
|
42
|
+
|
43
|
+
# Sensitive or high-churn files:
|
44
|
+
.idea/dataSources/
|
45
|
+
.idea/dataSources.ids
|
46
|
+
.idea/dataSources.xml
|
47
|
+
.idea/dataSources.local.xml
|
48
|
+
.idea/sqlDataSources.xml
|
49
|
+
.idea/dynamic.xml
|
50
|
+
.idea/uiDesigner.xml
|
51
|
+
|
52
|
+
# Gradle:
|
53
|
+
.idea/gradle.xml
|
54
|
+
.idea/libraries
|
55
|
+
|
56
|
+
# Mongo Explorer plugin:
|
57
|
+
.idea/mongoSettings.xml
|
58
|
+
|
59
|
+
## File-based project format:
|
60
|
+
*.iws
|
61
|
+
|
62
|
+
## Plugin-specific files:
|
63
|
+
|
64
|
+
# IntelliJ
|
65
|
+
/out/
|
66
|
+
|
67
|
+
# mpeltonen/sbt-idea plugin
|
68
|
+
.idea_modules/
|
69
|
+
|
70
|
+
# JIRA plugin
|
71
|
+
atlassian-ide-plugin.xml
|
72
|
+
|
73
|
+
# Crashlytics plugin (for Android Studio and IntelliJ)
|
74
|
+
com_crashlytics_export_strings.xml
|
75
|
+
crashlytics.properties
|
76
|
+
crashlytics-build.properties
|
77
|
+
fabric.properties
|
78
|
+
### Rails template
|
79
|
+
capybara-*.html
|
80
|
+
.rspec
|
81
|
+
/log
|
82
|
+
/tmp
|
83
|
+
/db/*.sqlite3
|
84
|
+
/db/*.sqlite3-journal
|
85
|
+
/public/system
|
86
|
+
/spec/tmp
|
87
|
+
**.orig
|
88
|
+
rerun.txt
|
89
|
+
pickle-email-*.html
|
90
|
+
|
91
|
+
# Only include if you have production secrets in this file, which is no longer a Rails default
|
92
|
+
# config/secrets.yml
|
93
|
+
|
94
|
+
# Ignore Byebug command history file.
|
95
|
+
.byebug_history
|
96
|
+
|
97
|
+
# Ignore Git repositories
|
98
|
+
.git
|
data/.gitignore
ADDED
data/.gitlab-ci.yml
ADDED
@@ -0,0 +1,71 @@
|
|
1
|
+
# See documentation at https://docs.gitlab.com/ee/ci/yaml/README.html
|
2
|
+
variables:
|
3
|
+
CI_REGISTRY_IMAGE_CURRENT: $CI_REGISTRY_IMAGE:$CI_BUILD_REF_NAME
|
4
|
+
CI_REGISTRY_IMAGE_LATEST: $CI_REGISTRY_IMAGE:latest
|
5
|
+
CI_REGISTRY_IMAGE_STABLE: $CI_REGISTRY_IMAGE:stable
|
6
|
+
|
7
|
+
.docker_build: &docker
|
8
|
+
image: docker:latest
|
9
|
+
services:
|
10
|
+
- docker:dind
|
11
|
+
before_script:
|
12
|
+
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY
|
13
|
+
|
14
|
+
.ruby_build: &ruby
|
15
|
+
image: $CI_REGISTRY_IMAGE_CURRENT
|
16
|
+
# Cache gems in between builds
|
17
|
+
cache:
|
18
|
+
paths:
|
19
|
+
- /cache
|
20
|
+
# This is a basic example for a gem or script which doesn't use
|
21
|
+
# services such as redis or postgres
|
22
|
+
before_script:
|
23
|
+
- bundle install -j $(nproc) --path=/vendor/bundle # (Re)Bundle dependencies
|
24
|
+
|
25
|
+
.release_docker_image: &release_docker_image
|
26
|
+
<<: *docker
|
27
|
+
stage: deploy
|
28
|
+
script:
|
29
|
+
- echo "Releasing ${$TARGET_IMAGE} from $CI_REGISTRY_IMAGE_CURRENT"
|
30
|
+
- docker pull $CI_REGISTRY_IMAGE_CURRENT
|
31
|
+
- docker tag $CI_REGISTRY_IMAGE_CURRENT ${$TARGET_IMAGE}
|
32
|
+
- docker push ${$TARGET_IMAGE}
|
33
|
+
|
34
|
+
build:
|
35
|
+
<<: *docker
|
36
|
+
stage: build
|
37
|
+
script:
|
38
|
+
- echo "Building ${CI_REGISTRY_IMAGE_CURRENT}"
|
39
|
+
- docker build --pull -t $CI_REGISTRY_IMAGE_CURRENT .
|
40
|
+
- docker push $CI_REGISTRY_IMAGE_CURRENT
|
41
|
+
|
42
|
+
style:
|
43
|
+
<<: *ruby
|
44
|
+
script: bin/rubocop
|
45
|
+
artifacts:
|
46
|
+
paths:
|
47
|
+
- doc/rubocop.html
|
48
|
+
- tmp/ci
|
49
|
+
|
50
|
+
specification:
|
51
|
+
<<: *ruby
|
52
|
+
script: bin/rake spec
|
53
|
+
artifacts:
|
54
|
+
paths:
|
55
|
+
- doc/spec.html
|
56
|
+
- coverage
|
57
|
+
- tmp/ci
|
58
|
+
|
59
|
+
documentation:
|
60
|
+
<<: *ruby
|
61
|
+
script: bin/rake doc
|
62
|
+
artifacts:
|
63
|
+
paths:
|
64
|
+
- rdoc
|
65
|
+
|
66
|
+
gem:
|
67
|
+
<<: *ruby
|
68
|
+
script: bin/rake build
|
69
|
+
artifacts:
|
70
|
+
paths:
|
71
|
+
- pkg
|
data/.rspec
ADDED
data/.rubocop.yml
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
AllCops:
|
2
|
+
TargetRubyVersion: 2.4
|
3
|
+
DefaultFormatter: fuubar
|
4
|
+
DisplayCopNames: true
|
5
|
+
ExtraDetails: true
|
6
|
+
Exclude:
|
7
|
+
- spec/**/*.rb
|
8
|
+
- vendor/**/*.rb
|
9
|
+
|
10
|
+
Metrics/BlockLength:
|
11
|
+
Exclude:
|
12
|
+
- rakelib/**/*.rb
|
13
|
+
- spec/**/*.rb
|
14
|
+
- vendor/**/*.rb
|
15
|
+
|
16
|
+
# It is 2017, UTF time!
|
17
|
+
Style/AsciiComments:
|
18
|
+
Enabled: false
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.4.0
|
data/.simplecov
ADDED
data/.travis.yml
ADDED
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
8
|
+
size, disability, ethnicity, gender identity and expression, level of experience,
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity and
|
10
|
+
orientation.
|
11
|
+
|
12
|
+
## Our Standards
|
13
|
+
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
15
|
+
include:
|
16
|
+
|
17
|
+
* Using welcoming and inclusive language
|
18
|
+
* Being respectful of differing viewpoints and experiences
|
19
|
+
* Gracefully accepting constructive criticism
|
20
|
+
* Focusing on what is best for the community
|
21
|
+
* Showing empathy towards other community members
|
22
|
+
|
23
|
+
Examples of unacceptable behavior by participants include:
|
24
|
+
|
25
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
+
advances
|
27
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
28
|
+
* Public or private harassment
|
29
|
+
* Publishing others' private information, such as a physical or electronic
|
30
|
+
address, without explicit permission
|
31
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
32
|
+
professional setting
|
33
|
+
|
34
|
+
## Our Responsibilities
|
35
|
+
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
38
|
+
response to any instances of unacceptable behavior.
|
39
|
+
|
40
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
41
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
42
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
43
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
44
|
+
threatening, offensive, or harmful.
|
45
|
+
|
46
|
+
## Scope
|
47
|
+
|
48
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
49
|
+
when an individual is representing the project or its community. Examples of
|
50
|
+
representing a project or community include using an official project e-mail
|
51
|
+
address, posting via an official social media account, or acting as an appointed
|
52
|
+
representative at an online or offline event. Representation of a project may be
|
53
|
+
further defined and clarified by project maintainers.
|
54
|
+
|
55
|
+
## Enforcement
|
56
|
+
|
57
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
+
reported by contacting the project team at alex@semyonov.us. All
|
59
|
+
complaints will be reviewed and investigated and will result in a response that
|
60
|
+
is deemed necessary and appropriate to the circumstances. The project team is
|
61
|
+
obligated to maintain confidentiality with regard to the reporter of an incident.
|
62
|
+
Further details of specific enforcement policies may be posted separately.
|
63
|
+
|
64
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
65
|
+
faith may face temporary or permanent repercussions as determined by other
|
66
|
+
members of the project's leadership.
|
67
|
+
|
68
|
+
## Attribution
|
69
|
+
|
70
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
+
available at [http://contributor-covenant.org/version/1/4][version]
|
72
|
+
|
73
|
+
[homepage]: http://contributor-covenant.org
|
74
|
+
[version]: http://contributor-covenant.org/version/1/4/
|
data/Dockerfile
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
FROM ruby:2.4
|
2
|
+
|
3
|
+
RUN gem install bundler --no-ri --no-rdoc
|
4
|
+
|
5
|
+
RUN mkdir /gem
|
6
|
+
WORKDIR /gem
|
7
|
+
|
8
|
+
ADD lib/rspec/roda/version.rb /gem/lib/rspec/roda/version.rb
|
9
|
+
ADD *.gemspec /gem/
|
10
|
+
ADD Gemfile /gem/Gemfile
|
11
|
+
RUN bundle install -j $(nproc) --path=/vendor/bundle
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2017 Alex Semyonov
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,102 @@
|
|
1
|
+
# Rspec::Roda
|
2
|
+
|
3
|
+
RSpec matchers for Roda apps and plugins.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem 'rspec-roda'
|
11
|
+
```
|
12
|
+
|
13
|
+
And then execute:
|
14
|
+
|
15
|
+
```bash
|
16
|
+
bundle
|
17
|
+
```
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
```bash
|
22
|
+
gem install rspec-roda
|
23
|
+
```
|
24
|
+
|
25
|
+
## Usage
|
26
|
+
|
27
|
+
With Roda app:
|
28
|
+
|
29
|
+
```ruby
|
30
|
+
# app.rb
|
31
|
+
class App < Roda
|
32
|
+
route do |r|
|
33
|
+
r.on 'hello' do
|
34
|
+
'Hey!'
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
# spec/spec_helper.rb
|
40
|
+
require 'rspec-roda'
|
41
|
+
|
42
|
+
# spec/app_spec.rb
|
43
|
+
RSpec.describe App, roda: :app do
|
44
|
+
describe '/hello' do
|
45
|
+
before { get '/hello' }
|
46
|
+
|
47
|
+
it { is_expected.to be_successful }
|
48
|
+
its(:body) { is_expected.to eq 'Hey!' }
|
49
|
+
end
|
50
|
+
end
|
51
|
+
```
|
52
|
+
|
53
|
+
With Roda plugin:
|
54
|
+
|
55
|
+
```ruby
|
56
|
+
# lib/roda/plugins/some.rb
|
57
|
+
class Roda
|
58
|
+
module RodaPlugins
|
59
|
+
module Some
|
60
|
+
# ...
|
61
|
+
end
|
62
|
+
|
63
|
+
register_plugin :some, Some
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
# spec/spec_helper.rb
|
68
|
+
require 'rspec-roda'
|
69
|
+
|
70
|
+
# spec/roda/plugins/some_spec.rb
|
71
|
+
RSpec.describe Roda::RodaPlugins::Some, roda: :plugin do
|
72
|
+
configure do
|
73
|
+
plugin :some # you don’t have to specify plugin itself in block with
|
74
|
+
# `roda: :plugin` metadata, it will be assumed by `rspec-roda`.
|
75
|
+
end
|
76
|
+
|
77
|
+
specify 'roda-rspec lets following', :aggregate_failures do
|
78
|
+
expect(roda_class).to be_a(Class)
|
79
|
+
expect(roda_class).to be < Roda
|
80
|
+
|
81
|
+
expect(app).to be_a(Roda)
|
82
|
+
expect(app.class).to be eq roda_class
|
83
|
+
end
|
84
|
+
end
|
85
|
+
```
|
86
|
+
|
87
|
+
## Development
|
88
|
+
|
89
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
90
|
+
|
91
|
+
To install this gem onto your local machine, run `bin/rake install`. To release a new version, update the version number in `version.rb`, and then run `bin/rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
92
|
+
|
93
|
+
## Contributing
|
94
|
+
|
95
|
+
Bug reports and pull requests are welcome on GitHub at https://gitlab.com/alsemyonov/rspec-roda. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
96
|
+
|
97
|
+
|
98
|
+
## License
|
99
|
+
|
100
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
101
|
+
|
102
|
+
© [Alex Semyonov](https://alex.semyonov.us/), <[alex@semyonov.us](mailto:alex@semyonov.us?subject=rspec-roda)> 2017
|
data/Rakefile
ADDED
data/bin/bundle-audit
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
#
|
4
|
+
# This file was generated by Bundler.
|
5
|
+
#
|
6
|
+
# The application 'bundle-audit' is installed as part of a gem, and
|
7
|
+
# this file is here to facilitate running it.
|
8
|
+
#
|
9
|
+
|
10
|
+
require 'pathname'
|
11
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile',
|
12
|
+
Pathname.new(__FILE__).realpath)
|
13
|
+
|
14
|
+
require 'rubygems'
|
15
|
+
require 'bundler/setup'
|
16
|
+
|
17
|
+
load Gem.bin_path('bundler-audit', 'bundle-audit')
|
data/bin/console
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
require 'bundler/setup'
|
5
|
+
require 'rspec/roda'
|
6
|
+
|
7
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
8
|
+
# with your gem easier. You can also use a different console, if you like.
|
9
|
+
|
10
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
11
|
+
# require "pry"
|
12
|
+
# Pry.start
|
13
|
+
|
14
|
+
require 'irb'
|
15
|
+
IRB.start
|
data/bin/rake
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
#
|
4
|
+
# This file was generated by Bundler.
|
5
|
+
#
|
6
|
+
# The application 'rake' is installed as part of a gem, and
|
7
|
+
# this file is here to facilitate running it.
|
8
|
+
#
|
9
|
+
|
10
|
+
require 'pathname'
|
11
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile',
|
12
|
+
Pathname.new(__FILE__).realpath)
|
13
|
+
|
14
|
+
require 'rubygems'
|
15
|
+
require 'bundler/setup'
|
16
|
+
|
17
|
+
load Gem.bin_path('rake', 'rake')
|
data/bin/rspec
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
#
|
4
|
+
# This file was generated by Bundler.
|
5
|
+
#
|
6
|
+
# The application 'rspec' is installed as part of a gem, and
|
7
|
+
# this file is here to facilitate running it.
|
8
|
+
#
|
9
|
+
|
10
|
+
require 'pathname'
|
11
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile',
|
12
|
+
Pathname.new(__FILE__).realpath)
|
13
|
+
|
14
|
+
require 'rubygems'
|
15
|
+
require 'bundler/setup'
|
16
|
+
|
17
|
+
load Gem.bin_path('rspec-core', 'rspec')
|
data/bin/rubocop
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
#
|
4
|
+
# This file was generated by Bundler.
|
5
|
+
#
|
6
|
+
# The application 'rubocop' is installed as part of a gem, and
|
7
|
+
# this file is here to facilitate running it.
|
8
|
+
#
|
9
|
+
|
10
|
+
require 'pathname'
|
11
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile',
|
12
|
+
Pathname.new(__FILE__).realpath)
|
13
|
+
|
14
|
+
require 'rubygems'
|
15
|
+
require 'bundler/setup'
|
16
|
+
|
17
|
+
load Gem.bin_path('rubocop', 'rubocop')
|
data/bin/setup
ADDED
data/bin/yard
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
#
|
4
|
+
# This file was generated by Bundler.
|
5
|
+
#
|
6
|
+
# The application 'yard' is installed as part of a gem, and
|
7
|
+
# this file is here to facilitate running it.
|
8
|
+
#
|
9
|
+
|
10
|
+
require 'pathname'
|
11
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile',
|
12
|
+
Pathname.new(__FILE__).realpath)
|
13
|
+
|
14
|
+
require 'rubygems'
|
15
|
+
require 'bundler/setup'
|
16
|
+
|
17
|
+
load Gem.bin_path('yard', 'yard')
|
data/bin/yardoc
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
#
|
4
|
+
# This file was generated by Bundler.
|
5
|
+
#
|
6
|
+
# The application 'yardoc' is installed as part of a gem, and
|
7
|
+
# this file is here to facilitate running it.
|
8
|
+
#
|
9
|
+
|
10
|
+
require 'pathname'
|
11
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile',
|
12
|
+
Pathname.new(__FILE__).realpath)
|
13
|
+
|
14
|
+
require 'rubygems'
|
15
|
+
require 'bundler/setup'
|
16
|
+
|
17
|
+
load Gem.bin_path('yard', 'yardoc')
|
data/bin/yri
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
#
|
4
|
+
# This file was generated by Bundler.
|
5
|
+
#
|
6
|
+
# The application 'yri' is installed as part of a gem, and
|
7
|
+
# this file is here to facilitate running it.
|
8
|
+
#
|
9
|
+
|
10
|
+
require 'pathname'
|
11
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile',
|
12
|
+
Pathname.new(__FILE__).realpath)
|
13
|
+
|
14
|
+
require 'rubygems'
|
15
|
+
require 'bundler/setup'
|
16
|
+
|
17
|
+
load Gem.bin_path('yard', 'yri')
|
data/lib/rspec/roda.rb
ADDED
@@ -0,0 +1,81 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
require 'rspec/roda/version'
|
3
|
+
require 'rspec'
|
4
|
+
require 'rspec/its'
|
5
|
+
require 'rack/test'
|
6
|
+
require 'inflecto'
|
7
|
+
|
8
|
+
module RSpec
|
9
|
+
# Module containing different contexts for Roda.
|
10
|
+
module Roda
|
11
|
+
# Module containing helpers for specifying Roda apps.
|
12
|
+
module App
|
13
|
+
include Rack::Test::Methods
|
14
|
+
|
15
|
+
# @return [Class(Roda)]
|
16
|
+
def roda_class
|
17
|
+
described_class
|
18
|
+
end
|
19
|
+
|
20
|
+
# Rack-, and Rack::Test-compliant Roda app
|
21
|
+
# @return [#call]
|
22
|
+
def app
|
23
|
+
roda_class.app.freeze
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
# Module containing helpers for specifying Roda plugins.
|
28
|
+
module Plugin
|
29
|
+
# Class interface for plugin specs.
|
30
|
+
module ClassInterface
|
31
|
+
# @param [Module] child
|
32
|
+
def included(child)
|
33
|
+
super(child)
|
34
|
+
roda
|
35
|
+
end
|
36
|
+
|
37
|
+
# @param [Symbol] plugin
|
38
|
+
# @param [Proc] block
|
39
|
+
def roda(plugin = metadata[:name], &block)
|
40
|
+
let(:roda_class) do
|
41
|
+
route_block = self.route_block
|
42
|
+
Class.new(::Roda) do
|
43
|
+
plugin plugin
|
44
|
+
instance_exec(&block) if block
|
45
|
+
route { |r| instance_exec(r, &route_block) } if route_block
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
# @param [Proc] block
|
51
|
+
def route(&block)
|
52
|
+
let(:route_block) { block }
|
53
|
+
roda # re-initiate app
|
54
|
+
end
|
55
|
+
|
56
|
+
private
|
57
|
+
|
58
|
+
# @return [Symbol]
|
59
|
+
def plugin_name
|
60
|
+
@plugin_name ||= metadata[:name] || Inflecto.underscore(
|
61
|
+
Inflecto.demodulize(described_class.name)
|
62
|
+
)
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
RSpec.shared_context 'Roda app', roda: :app do
|
70
|
+
include RSpec::Roda::App
|
71
|
+
|
72
|
+
let(:roda_instance) { roda_class.new(env) }
|
73
|
+
let(:env) { {} }
|
74
|
+
end
|
75
|
+
|
76
|
+
RSpec.shared_context 'Roda plugin', roda: :plugin do
|
77
|
+
extend RSpec::Roda::Plugin::ClassInterface
|
78
|
+
include_context 'Roda app'
|
79
|
+
|
80
|
+
let(:route_block) { proc { |r| } }
|
81
|
+
end
|
data/rakelib/rspec.rake
ADDED
data/rakelib/yard.rake
ADDED
data/rspec-roda.gemspec
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
# frozen_string_literal: true
|
3
|
+
lib = File.expand_path('../lib', __FILE__)
|
4
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
|
+
require 'rspec/roda/version'
|
6
|
+
|
7
|
+
# rubocop:disable Metrics/BlockLength
|
8
|
+
Gem::Specification.new do |spec|
|
9
|
+
spec.name = 'rspec-roda'
|
10
|
+
spec.version = RSpec::Roda::VERSION
|
11
|
+
spec.authors = ['Alex Semyonov']
|
12
|
+
spec.email = ['alex@semyonov.us']
|
13
|
+
|
14
|
+
spec.summary = 'RSpec and Roda integration'
|
15
|
+
spec.description = 'RSpec helpers for testing Roda applications and plugins'
|
16
|
+
spec.homepage = 'http://alsemyonov.gitlab.com/rspec-roda/'
|
17
|
+
spec.license = 'MIT'
|
18
|
+
|
19
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
20
|
+
f.match(%r{^(test|spec|features)/})
|
21
|
+
end
|
22
|
+
spec.bindir = 'exe'
|
23
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
24
|
+
spec.require_paths = ['lib']
|
25
|
+
|
26
|
+
spec.add_runtime_dependency 'rspec', '~> 3.0'
|
27
|
+
spec.add_runtime_dependency 'rspec-its', '~> 1.2.0'
|
28
|
+
spec.add_runtime_dependency 'roda'
|
29
|
+
spec.add_runtime_dependency 'rack-test'
|
30
|
+
spec.add_runtime_dependency 'inflecto'
|
31
|
+
|
32
|
+
spec.add_development_dependency 'bundler', '~> 1.13'
|
33
|
+
spec.add_development_dependency 'bundler-audit', '~> 0.5.0'
|
34
|
+
spec.add_development_dependency 'rack-test', '~> 0.6.3'
|
35
|
+
spec.add_development_dependency 'rake', '~> 12.0'
|
36
|
+
spec.add_development_dependency 'rspec', '~> 3.5'
|
37
|
+
spec.add_development_dependency 'rspec-its', '~> 1.2.0'
|
38
|
+
spec.add_development_dependency 'rubocop', '~> 0.47.0'
|
39
|
+
spec.add_development_dependency 'simplecov', '~> 0.12.0'
|
40
|
+
spec.add_development_dependency 'yard', '~> 0.9.5'
|
41
|
+
spec.add_development_dependency 'rom-repository', '>= 0.3.1'
|
42
|
+
spec.add_development_dependency 'rom-sql', '>= 0.9'
|
43
|
+
spec.add_development_dependency 'sequel'
|
44
|
+
end
|
45
|
+
# rubocop:enable Metrics/BlockLength
|
metadata
ADDED
@@ -0,0 +1,313 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: rspec-roda
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Alex Semyonov
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2017-01-31 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rspec
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '3.0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '3.0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rspec-its
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 1.2.0
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 1.2.0
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: roda
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rack-test
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: inflecto
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: bundler
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '1.13'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '1.13'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: bundler-audit
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: 0.5.0
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: 0.5.0
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: rack-test
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - "~>"
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: 0.6.3
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - "~>"
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: 0.6.3
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: rake
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - "~>"
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '12.0'
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - "~>"
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '12.0'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: rspec
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - "~>"
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '3.5'
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - "~>"
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '3.5'
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: rspec-its
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - "~>"
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: 1.2.0
|
160
|
+
type: :development
|
161
|
+
prerelease: false
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - "~>"
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: 1.2.0
|
167
|
+
- !ruby/object:Gem::Dependency
|
168
|
+
name: rubocop
|
169
|
+
requirement: !ruby/object:Gem::Requirement
|
170
|
+
requirements:
|
171
|
+
- - "~>"
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: 0.47.0
|
174
|
+
type: :development
|
175
|
+
prerelease: false
|
176
|
+
version_requirements: !ruby/object:Gem::Requirement
|
177
|
+
requirements:
|
178
|
+
- - "~>"
|
179
|
+
- !ruby/object:Gem::Version
|
180
|
+
version: 0.47.0
|
181
|
+
- !ruby/object:Gem::Dependency
|
182
|
+
name: simplecov
|
183
|
+
requirement: !ruby/object:Gem::Requirement
|
184
|
+
requirements:
|
185
|
+
- - "~>"
|
186
|
+
- !ruby/object:Gem::Version
|
187
|
+
version: 0.12.0
|
188
|
+
type: :development
|
189
|
+
prerelease: false
|
190
|
+
version_requirements: !ruby/object:Gem::Requirement
|
191
|
+
requirements:
|
192
|
+
- - "~>"
|
193
|
+
- !ruby/object:Gem::Version
|
194
|
+
version: 0.12.0
|
195
|
+
- !ruby/object:Gem::Dependency
|
196
|
+
name: yard
|
197
|
+
requirement: !ruby/object:Gem::Requirement
|
198
|
+
requirements:
|
199
|
+
- - "~>"
|
200
|
+
- !ruby/object:Gem::Version
|
201
|
+
version: 0.9.5
|
202
|
+
type: :development
|
203
|
+
prerelease: false
|
204
|
+
version_requirements: !ruby/object:Gem::Requirement
|
205
|
+
requirements:
|
206
|
+
- - "~>"
|
207
|
+
- !ruby/object:Gem::Version
|
208
|
+
version: 0.9.5
|
209
|
+
- !ruby/object:Gem::Dependency
|
210
|
+
name: rom-repository
|
211
|
+
requirement: !ruby/object:Gem::Requirement
|
212
|
+
requirements:
|
213
|
+
- - ">="
|
214
|
+
- !ruby/object:Gem::Version
|
215
|
+
version: 0.3.1
|
216
|
+
type: :development
|
217
|
+
prerelease: false
|
218
|
+
version_requirements: !ruby/object:Gem::Requirement
|
219
|
+
requirements:
|
220
|
+
- - ">="
|
221
|
+
- !ruby/object:Gem::Version
|
222
|
+
version: 0.3.1
|
223
|
+
- !ruby/object:Gem::Dependency
|
224
|
+
name: rom-sql
|
225
|
+
requirement: !ruby/object:Gem::Requirement
|
226
|
+
requirements:
|
227
|
+
- - ">="
|
228
|
+
- !ruby/object:Gem::Version
|
229
|
+
version: '0.9'
|
230
|
+
type: :development
|
231
|
+
prerelease: false
|
232
|
+
version_requirements: !ruby/object:Gem::Requirement
|
233
|
+
requirements:
|
234
|
+
- - ">="
|
235
|
+
- !ruby/object:Gem::Version
|
236
|
+
version: '0.9'
|
237
|
+
- !ruby/object:Gem::Dependency
|
238
|
+
name: sequel
|
239
|
+
requirement: !ruby/object:Gem::Requirement
|
240
|
+
requirements:
|
241
|
+
- - ">="
|
242
|
+
- !ruby/object:Gem::Version
|
243
|
+
version: '0'
|
244
|
+
type: :development
|
245
|
+
prerelease: false
|
246
|
+
version_requirements: !ruby/object:Gem::Requirement
|
247
|
+
requirements:
|
248
|
+
- - ">="
|
249
|
+
- !ruby/object:Gem::Version
|
250
|
+
version: '0'
|
251
|
+
description: RSpec helpers for testing Roda applications and plugins
|
252
|
+
email:
|
253
|
+
- alex@semyonov.us
|
254
|
+
executables: []
|
255
|
+
extensions: []
|
256
|
+
extra_rdoc_files: []
|
257
|
+
files:
|
258
|
+
- ".dockerignore"
|
259
|
+
- ".gitignore"
|
260
|
+
- ".gitlab-ci.yml"
|
261
|
+
- ".rspec"
|
262
|
+
- ".rubocop.yml"
|
263
|
+
- ".ruby-version"
|
264
|
+
- ".simplecov"
|
265
|
+
- ".travis.yml"
|
266
|
+
- CODE_OF_CONDUCT.md
|
267
|
+
- Dockerfile
|
268
|
+
- Gemfile
|
269
|
+
- LICENSE.txt
|
270
|
+
- README.md
|
271
|
+
- Rakefile
|
272
|
+
- bin/bundle-audit
|
273
|
+
- bin/console
|
274
|
+
- bin/rake
|
275
|
+
- bin/rspec
|
276
|
+
- bin/rubocop
|
277
|
+
- bin/setup
|
278
|
+
- bin/yard
|
279
|
+
- bin/yardoc
|
280
|
+
- bin/yri
|
281
|
+
- lib/rspec/roda.rb
|
282
|
+
- lib/rspec/roda/version.rb
|
283
|
+
- rakelib/bundle_audit.rake
|
284
|
+
- rakelib/bundler.rake
|
285
|
+
- rakelib/rspec.rake
|
286
|
+
- rakelib/rubocop.rake
|
287
|
+
- rakelib/yard.rake
|
288
|
+
- rspec-roda.gemspec
|
289
|
+
homepage: http://alsemyonov.gitlab.com/rspec-roda/
|
290
|
+
licenses:
|
291
|
+
- MIT
|
292
|
+
metadata: {}
|
293
|
+
post_install_message:
|
294
|
+
rdoc_options: []
|
295
|
+
require_paths:
|
296
|
+
- lib
|
297
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
298
|
+
requirements:
|
299
|
+
- - ">="
|
300
|
+
- !ruby/object:Gem::Version
|
301
|
+
version: '0'
|
302
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
303
|
+
requirements:
|
304
|
+
- - ">="
|
305
|
+
- !ruby/object:Gem::Version
|
306
|
+
version: '0'
|
307
|
+
requirements: []
|
308
|
+
rubyforge_project:
|
309
|
+
rubygems_version: 2.6.10
|
310
|
+
signing_key:
|
311
|
+
specification_version: 4
|
312
|
+
summary: RSpec and Roda integration
|
313
|
+
test_files: []
|