rspec_table_formatter 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.github/workflows/gem-push.yml +35 -0
- data/.gitignore +9 -0
- data/.idea/misc.xml +4 -0
- data/.idea/modules.xml +8 -0
- data/.idea/rspec_table_formatter.iml +50 -0
- data/.idea/vcs.xml +6 -0
- data/.idea/workspace.xml +91 -0
- data/.ruby-gemset +1 -0
- data/.ruby-version +1 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +11 -0
- data/Gemfile.lock +29 -0
- data/LICENSE.txt +21 -0
- data/README.md +44 -0
- data/Rakefile +10 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/lib/rspec_table_formatter/version.rb +5 -0
- data/lib/rspec_table_formatter.rb +19 -0
- data/lib/table_builder.rb +46 -0
- data/rspec_table_formatter.gemspec +30 -0
- metadata +68 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 628fcf6a61842e3fb2c4a474b6188c810189c457d016906dd406bb41baea98e9
|
4
|
+
data.tar.gz: 3ca7b77943df49603fcf3c2c3eaf0a8bea18ab18048319691771bbfdb9c7add6
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: a87062d469a8c2062ac503e984f2a0b8f7bd76beea69a5ebcddf3408498a90b973627b342b41f8087219611ec5f9fbfcefbdfee964bf4eb335aa9327408bcf14
|
7
|
+
data.tar.gz: 2d00ee6f8772a9a24e925e5aa7e8b9f5ccd80691a84ecfedfece8c2d9e71a81fe7fa934aa7074453759cb10b7b5b89f3cd3dc3e00749d00f0c8c360f97a52440
|
@@ -0,0 +1,35 @@
|
|
1
|
+
name: Ruby Gem
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches: [ master ]
|
6
|
+
pull_request:
|
7
|
+
branches: [ master ]
|
8
|
+
|
9
|
+
jobs:
|
10
|
+
build:
|
11
|
+
name: Build + Publish
|
12
|
+
runs-on: ubuntu-latest
|
13
|
+
permissions:
|
14
|
+
contents: read
|
15
|
+
packages: write
|
16
|
+
|
17
|
+
steps:
|
18
|
+
- uses: actions/checkout@v2
|
19
|
+
|
20
|
+
- name: Set up Ruby 2.6
|
21
|
+
uses: actions/setup-ruby@v1
|
22
|
+
with:
|
23
|
+
ruby-version: 2.6.x
|
24
|
+
|
25
|
+
- name: Publish to RubyGems
|
26
|
+
# if: contains(github.ref, 'refs/tags/v')
|
27
|
+
run: |
|
28
|
+
mkdir -p $HOME/.gem
|
29
|
+
touch $HOME/.gem/credentials
|
30
|
+
chmod 0600 $HOME/.gem/credentials
|
31
|
+
printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
|
32
|
+
gem build *.gemspec
|
33
|
+
gem push *.gem
|
34
|
+
env:
|
35
|
+
GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_AUTH_TOKEN}}"
|
data/.gitignore
ADDED
data/.idea/misc.xml
ADDED
data/.idea/modules.xml
ADDED
@@ -0,0 +1,8 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<project version="4">
|
3
|
+
<component name="ProjectModuleManager">
|
4
|
+
<modules>
|
5
|
+
<module fileurl="file://$PROJECT_DIR$/.idea/rspec_table_formatter.iml" filepath="$PROJECT_DIR$/.idea/rspec_table_formatter.iml" />
|
6
|
+
</modules>
|
7
|
+
</component>
|
8
|
+
</project>
|
@@ -0,0 +1,50 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<module type="RUBY_MODULE" version="4">
|
3
|
+
<component name="ModuleRunConfigurationManager">
|
4
|
+
<shared />
|
5
|
+
</component>
|
6
|
+
<component name="NewModuleRootManager">
|
7
|
+
<content url="file://$MODULE_DIR$">
|
8
|
+
<sourceFolder url="file://$MODULE_DIR$/features" isTestSource="true" />
|
9
|
+
<sourceFolder url="file://$MODULE_DIR$/spec" isTestSource="true" />
|
10
|
+
<sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" />
|
11
|
+
</content>
|
12
|
+
<orderEntry type="jdk" jdkName="RVM: ruby-2.7.1 [rspec_table_formatter]" jdkType="RUBY_SDK" />
|
13
|
+
<orderEntry type="sourceFolder" forTests="false" />
|
14
|
+
<orderEntry type="library" scope="PROVIDED" name="bundler (v2.1.4, RVM: ruby-2.7.1 [rspec_table_formatter]) [gem]" level="application" />
|
15
|
+
<orderEntry type="library" scope="PROVIDED" name="minitest (v5.15.0, RVM: ruby-2.7.1 [rspec_table_formatter]) [gem]" level="application" />
|
16
|
+
<orderEntry type="library" scope="PROVIDED" name="rake (v12.3.3, RVM: ruby-2.7.1 [rspec_table_formatter]) [gem]" level="application" />
|
17
|
+
<orderEntry type="library" scope="PROVIDED" name="rspec-core (v3.10.1, RVM: ruby-2.7.1 [rspec_table_formatter]) [gem]" level="application" />
|
18
|
+
<orderEntry type="library" scope="PROVIDED" name="rspec-support (v3.10.3, RVM: ruby-2.7.1 [rspec_table_formatter]) [gem]" level="application" />
|
19
|
+
<orderEntry type="library" scope="PROVIDED" name="terminal-table (v3.0.2, RVM: ruby-2.7.1 [rspec_table_formatter]) [gem]" level="application" />
|
20
|
+
<orderEntry type="library" scope="PROVIDED" name="unicode-display_width (v2.1.0, RVM: ruby-2.7.1 [rspec_table_formatter]) [gem]" level="application" />
|
21
|
+
</component>
|
22
|
+
<component name="RakeTasksCache">
|
23
|
+
<option name="myRootTask">
|
24
|
+
<RakeTaskImpl id="rake">
|
25
|
+
<subtasks>
|
26
|
+
<RakeTaskImpl description="Build rspec_table_formatter-0.1.0.gem into the pkg directory" fullCommand="build" id="build" />
|
27
|
+
<RakeTaskImpl description="Remove any temporary products" fullCommand="clean" id="clean" />
|
28
|
+
<RakeTaskImpl description="Remove any generated files" fullCommand="clobber" id="clobber" />
|
29
|
+
<RakeTaskImpl description="Build and install rspec_table_formatter-0.1.0.gem into system gems" fullCommand="install" id="install" />
|
30
|
+
<RakeTaskImpl id="install">
|
31
|
+
<subtasks>
|
32
|
+
<RakeTaskImpl description="Build and install rspec_table_formatter-0.1.0.gem into system gems without network access" fullCommand="install:local" id="local" />
|
33
|
+
</subtasks>
|
34
|
+
</RakeTaskImpl>
|
35
|
+
<RakeTaskImpl description="Create tag v0.1.0 and build and push rspec_table_formatter-0.1.0.gem to https://rubygems.org" fullCommand="release[remote]" id="release[remote]" />
|
36
|
+
<RakeTaskImpl description="Run tests" fullCommand="test" id="test" />
|
37
|
+
<RakeTaskImpl description="" fullCommand="default" id="default" />
|
38
|
+
<RakeTaskImpl description="" fullCommand="release" id="release" />
|
39
|
+
<RakeTaskImpl id="release">
|
40
|
+
<subtasks>
|
41
|
+
<RakeTaskImpl description="" fullCommand="release:guard_clean" id="guard_clean" />
|
42
|
+
<RakeTaskImpl description="" fullCommand="release:rubygem_push" id="rubygem_push" />
|
43
|
+
<RakeTaskImpl description="" fullCommand="release:source_control_push" id="source_control_push" />
|
44
|
+
</subtasks>
|
45
|
+
</RakeTaskImpl>
|
46
|
+
</subtasks>
|
47
|
+
</RakeTaskImpl>
|
48
|
+
</option>
|
49
|
+
</component>
|
50
|
+
</module>
|
data/.idea/vcs.xml
ADDED
data/.idea/workspace.xml
ADDED
@@ -0,0 +1,91 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<project version="4">
|
3
|
+
<component name="ChangeListManager">
|
4
|
+
<list default="true" id="25321ba8-2036-43dd-99ff-e4d5a6161276" name="Changes" comment="added new action for publishing" />
|
5
|
+
<option name="SHOW_DIALOG" value="false" />
|
6
|
+
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
7
|
+
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
8
|
+
<option name="LAST_RESOLUTION" value="IGNORE" />
|
9
|
+
</component>
|
10
|
+
<component name="Git.Settings">
|
11
|
+
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
12
|
+
</component>
|
13
|
+
<component name="GitSEFilterConfiguration">
|
14
|
+
<file-type-list>
|
15
|
+
<filtered-out-file-type name="LOCAL_BRANCH" />
|
16
|
+
<filtered-out-file-type name="REMOTE_BRANCH" />
|
17
|
+
<filtered-out-file-type name="TAG" />
|
18
|
+
<filtered-out-file-type name="COMMIT_BY_MESSAGE" />
|
19
|
+
</file-type-list>
|
20
|
+
</component>
|
21
|
+
<component name="MarkdownSettingsMigration">
|
22
|
+
<option name="stateVersion" value="1" />
|
23
|
+
</component>
|
24
|
+
<component name="ProjectId" id="22zS2CiP8OcJLGsvyGVnCArdWmp" />
|
25
|
+
<component name="ProjectLevelVcsManager" settingsEditedManually="true" />
|
26
|
+
<component name="ProjectViewState">
|
27
|
+
<option name="hideEmptyMiddlePackages" value="true" />
|
28
|
+
<option name="showLibraryContents" value="true" />
|
29
|
+
</component>
|
30
|
+
<component name="PropertiesComponent">
|
31
|
+
<property name="RunOnceActivity.OpenProjectViewOnStart" value="true" />
|
32
|
+
<property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
|
33
|
+
<property name="SHARE_PROJECT_CONFIGURATION_FILES" value="true" />
|
34
|
+
<property name="WebServerToolWindowFactoryState" value="false" />
|
35
|
+
<property name="last_opened_file_path" value="$PROJECT_DIR$/lib" />
|
36
|
+
<property name="nodejs_package_manager_path" value="npm" />
|
37
|
+
<property name="settings.editor.selected.configurable" value="org.jetbrains.plugins.ruby.settings.RubyActiveModuleSdkConfigurable" />
|
38
|
+
</component>
|
39
|
+
<component name="RecentsManager">
|
40
|
+
<key name="CopyFile.RECENT_KEYS">
|
41
|
+
<recent name="$PROJECT_DIR$/lib" />
|
42
|
+
</key>
|
43
|
+
</component>
|
44
|
+
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
|
45
|
+
<component name="SpringUtil" SPRING_PRE_LOADER_OPTION="true" RAKE_SPRING_PRE_LOADER_OPTION="true" RAILS_SPRING_PRE_LOADER_OPTION="true" />
|
46
|
+
<component name="TaskManager">
|
47
|
+
<task active="true" id="Default" summary="Default task">
|
48
|
+
<changelist id="25321ba8-2036-43dd-99ff-e4d5a6161276" name="Changes" comment="" />
|
49
|
+
<created>1640838712559</created>
|
50
|
+
<option name="number" value="Default" />
|
51
|
+
<option name="presentableId" value="Default" />
|
52
|
+
<updated>1640838712559</updated>
|
53
|
+
<workItem from="1640838713708" duration="4055000" />
|
54
|
+
</task>
|
55
|
+
<task id="LOCAL-00001" summary="initail commit">
|
56
|
+
<created>1640839892614</created>
|
57
|
+
<option name="number" value="00001" />
|
58
|
+
<option name="presentableId" value="LOCAL-00001" />
|
59
|
+
<option name="project" value="LOCAL" />
|
60
|
+
<updated>1640839892614</updated>
|
61
|
+
</task>
|
62
|
+
<task id="LOCAL-00002" summary="added new action for publishing">
|
63
|
+
<created>1640844852397</created>
|
64
|
+
<option name="number" value="00002" />
|
65
|
+
<option name="presentableId" value="LOCAL-00002" />
|
66
|
+
<option name="project" value="LOCAL" />
|
67
|
+
<updated>1640844852397</updated>
|
68
|
+
</task>
|
69
|
+
<option name="localTasksCounter" value="3" />
|
70
|
+
<servers />
|
71
|
+
</component>
|
72
|
+
<component name="TypeScriptGeneratedFilesManager">
|
73
|
+
<option name="version" value="3" />
|
74
|
+
</component>
|
75
|
+
<component name="Vcs.Log.Tabs.Properties">
|
76
|
+
<option name="TAB_STATES">
|
77
|
+
<map>
|
78
|
+
<entry key="MAIN">
|
79
|
+
<value>
|
80
|
+
<State />
|
81
|
+
</value>
|
82
|
+
</entry>
|
83
|
+
</map>
|
84
|
+
</option>
|
85
|
+
</component>
|
86
|
+
<component name="VcsManagerConfiguration">
|
87
|
+
<MESSAGE value="initail commit" />
|
88
|
+
<MESSAGE value="added new action for publishing" />
|
89
|
+
<option name="LAST_COMMIT_MESSAGE" value="added new action for publishing" />
|
90
|
+
</component>
|
91
|
+
</project>
|
data/.ruby-gemset
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
rspec_table_formatter
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
ruby-2.7.1
|
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 nijeesh.k@rently.com. 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 [https://contributor-covenant.org/version/1/4][version]
|
72
|
+
|
73
|
+
[homepage]: https://contributor-covenant.org
|
74
|
+
[version]: https://contributor-covenant.org/version/1/4/
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
rspec_table_formatter (0.1.6)
|
5
|
+
|
6
|
+
GEM
|
7
|
+
remote: https://rubygems.org/
|
8
|
+
specs:
|
9
|
+
minitest (5.15.0)
|
10
|
+
rake (12.3.3)
|
11
|
+
rspec-core (3.10.1)
|
12
|
+
rspec-support (~> 3.10.0)
|
13
|
+
rspec-support (3.10.3)
|
14
|
+
terminal-table (3.0.2)
|
15
|
+
unicode-display_width (>= 1.1.1, < 3)
|
16
|
+
unicode-display_width (2.1.0)
|
17
|
+
|
18
|
+
PLATFORMS
|
19
|
+
ruby
|
20
|
+
|
21
|
+
DEPENDENCIES
|
22
|
+
minitest (~> 5.0)
|
23
|
+
rake (~> 12.0)
|
24
|
+
rspec-core
|
25
|
+
rspec_table_formatter!
|
26
|
+
terminal-table
|
27
|
+
|
28
|
+
BUNDLED WITH
|
29
|
+
2.1.4
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2021 Nijeesh
|
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,44 @@
|
|
1
|
+
# RspecTableFormatter
|
2
|
+
|
3
|
+
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/rspec_table_formatter`. To experiment with that code, run `bin/console` for an interactive prompt.
|
4
|
+
|
5
|
+
TODO: Delete this and the text above, and describe your gem
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem 'rspec_table_formatter'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle install
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install rspec_table_formatter
|
22
|
+
|
23
|
+
## Usage
|
24
|
+
|
25
|
+
TODO: Write usage instructions here
|
26
|
+
|
27
|
+
## Development
|
28
|
+
|
29
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
30
|
+
|
31
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec 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).
|
32
|
+
|
33
|
+
## Contributing
|
34
|
+
|
35
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/rspec_table_formatter. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/rspec_table_formatter/blob/master/CODE_OF_CONDUCT.md).
|
36
|
+
|
37
|
+
|
38
|
+
## License
|
39
|
+
|
40
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
41
|
+
|
42
|
+
## Code of Conduct
|
43
|
+
|
44
|
+
Everyone interacting in the RspecTableFormatter project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/rspec_table_formatter/blob/master/CODE_OF_CONDUCT.md).
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "rspec_table_formatter"
|
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(__FILE__)
|
data/bin/setup
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'rspec_table_formatter/version'
|
4
|
+
|
5
|
+
# main class for formatter
|
6
|
+
class RspecTableFormatter
|
7
|
+
class Error < StandardError; end
|
8
|
+
|
9
|
+
RSpec::Core::Formatters.register self, :dump_summary
|
10
|
+
|
11
|
+
def initialize(output)
|
12
|
+
@output = output
|
13
|
+
end
|
14
|
+
|
15
|
+
def dump_summary(notification)
|
16
|
+
examples = notification.examples
|
17
|
+
@output << TableBuilder.new(examples).generate_table.to_s + "\n"
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'terminal-table'
|
4
|
+
|
5
|
+
# converts the examples array to a table string
|
6
|
+
class TableBuilder
|
7
|
+
def initialize(examples)
|
8
|
+
@examples = examples
|
9
|
+
end
|
10
|
+
|
11
|
+
def generate_table
|
12
|
+
Terminal::Table.new do |t|
|
13
|
+
t.headings = ['Test Case', 'Expected result', 'status']
|
14
|
+
t.rows = map_examples(@examples)
|
15
|
+
t.style = { border_left: false, border_right: false, border: :markdown }
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
protected
|
20
|
+
|
21
|
+
def map_examples(examples)
|
22
|
+
examples.map { |example| map_example(example) }
|
23
|
+
end
|
24
|
+
|
25
|
+
def map_example(example)
|
26
|
+
[
|
27
|
+
example.metadata[:example_group][:full_description],
|
28
|
+
example.description,
|
29
|
+
execution_status(example)
|
30
|
+
]
|
31
|
+
end
|
32
|
+
|
33
|
+
def execution_status(example)
|
34
|
+
puts example.execution_result.status
|
35
|
+
case example.execution_result.status
|
36
|
+
when :passed
|
37
|
+
'✔️ Passed'
|
38
|
+
when :failed
|
39
|
+
'❌ Failed'
|
40
|
+
when :pending
|
41
|
+
'⚠️ Test case pending'
|
42
|
+
else
|
43
|
+
''
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative 'lib/rspec_table_formatter/version'
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = 'rspec_table_formatter'
|
7
|
+
spec.version = RspecTableFormatter::VERSION
|
8
|
+
spec.authors = ['Nijeesh']
|
9
|
+
spec.email = ['nijeesh.k@rently.com']
|
10
|
+
|
11
|
+
spec.summary = 'a simple table formatter for rspec'
|
12
|
+
spec.description = 'a simple gem to output the rspec run summery in markdown table format'\
|
13
|
+
'so you can copy paste the content to any documentation of your choice'
|
14
|
+
spec.homepage = 'https://github.com/nijeesh-rently/rspec_table_formatter'
|
15
|
+
spec.license = 'MIT'
|
16
|
+
spec.required_ruby_version = Gem::Requirement.new('>= 2.3.0')
|
17
|
+
|
18
|
+
spec.metadata['homepage_uri'] = spec.homepage
|
19
|
+
spec.metadata['source_code_uri'] = 'https://github.com/nijeesh-rently/rspec_table_formatter'
|
20
|
+
spec.metadata['changelog_uri'] = 'https://github.com/nijeesh-rently/rspec_table_formatter'
|
21
|
+
|
22
|
+
# Specify which files should be added to the gem when it is released.
|
23
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
24
|
+
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
25
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
26
|
+
end
|
27
|
+
spec.bindir = 'exe'
|
28
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
29
|
+
spec.require_paths = ['lib']
|
30
|
+
end
|
metadata
ADDED
@@ -0,0 +1,68 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: rspec_table_formatter
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.6
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Nijeesh
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2021-12-30 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: a simple gem to output the rspec run summery in markdown table formatso
|
14
|
+
you can copy paste the content to any documentation of your choice
|
15
|
+
email:
|
16
|
+
- nijeesh.k@rently.com
|
17
|
+
executables: []
|
18
|
+
extensions: []
|
19
|
+
extra_rdoc_files: []
|
20
|
+
files:
|
21
|
+
- ".github/workflows/gem-push.yml"
|
22
|
+
- ".gitignore"
|
23
|
+
- ".idea/misc.xml"
|
24
|
+
- ".idea/modules.xml"
|
25
|
+
- ".idea/rspec_table_formatter.iml"
|
26
|
+
- ".idea/vcs.xml"
|
27
|
+
- ".idea/workspace.xml"
|
28
|
+
- ".ruby-gemset"
|
29
|
+
- ".ruby-version"
|
30
|
+
- CODE_OF_CONDUCT.md
|
31
|
+
- Gemfile
|
32
|
+
- Gemfile.lock
|
33
|
+
- LICENSE.txt
|
34
|
+
- README.md
|
35
|
+
- Rakefile
|
36
|
+
- bin/console
|
37
|
+
- bin/setup
|
38
|
+
- lib/rspec_table_formatter.rb
|
39
|
+
- lib/rspec_table_formatter/version.rb
|
40
|
+
- lib/table_builder.rb
|
41
|
+
- rspec_table_formatter.gemspec
|
42
|
+
homepage: https://github.com/nijeesh-rently/rspec_table_formatter
|
43
|
+
licenses:
|
44
|
+
- MIT
|
45
|
+
metadata:
|
46
|
+
homepage_uri: https://github.com/nijeesh-rently/rspec_table_formatter
|
47
|
+
source_code_uri: https://github.com/nijeesh-rently/rspec_table_formatter
|
48
|
+
changelog_uri: https://github.com/nijeesh-rently/rspec_table_formatter
|
49
|
+
post_install_message:
|
50
|
+
rdoc_options: []
|
51
|
+
require_paths:
|
52
|
+
- lib
|
53
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
54
|
+
requirements:
|
55
|
+
- - ">="
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
version: 2.3.0
|
58
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
59
|
+
requirements:
|
60
|
+
- - ">="
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '0'
|
63
|
+
requirements: []
|
64
|
+
rubygems_version: 3.0.3.1
|
65
|
+
signing_key:
|
66
|
+
specification_version: 4
|
67
|
+
summary: a simple table formatter for rspec
|
68
|
+
test_files: []
|