rspec-kungfuhamster 0.1.1 → 0.2.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 +5 -5
- data/README.md +83 -1
- data/lib/rspec_kung_fu_hamster/formatter.rb +1 -0
- data/lib/rspec_kung_fu_hamster/version.rb +3 -0
- data/lib/rspec_kung_fu_hamster.rb +5 -2
- data/spec/kungfuhamster_spec.rb +2 -2
- metadata +6 -9
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: cdeade8d8542b627204a981d63260b3ded4c3eb08258f66ea7f7e49e482b8f61
|
|
4
|
+
data.tar.gz: befdc3608a08866bc7d9c1556ee54283993a4068db106b607fd6a96c0a980a3d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6d9013150c705bb88c75067d9af425f4a65f7b5abed6779694f61fea85137bfc5d8b0ffa230fa06bb1fc888dcc40c3e4a02d91104ff957fed6d97b635a467c27
|
|
7
|
+
data.tar.gz: 99e1e684ffb1e0290ae84b8174a28f2d33d5cbe42461d5c21cec3f3d2617c834cb7ce7b0c2aa801ffbb7be8f7f34a05f26b6cc8c6ff8fda224ddd2758a085a6e
|
data/README.md
CHANGED
|
@@ -3,10 +3,92 @@ rspec-kungfuhamster
|
|
|
3
3
|
|
|
4
4
|
Animated kung fu hamster formatter
|
|
5
5
|
|
|
6
|
+
# Sample Output
|
|
7
|
+
|
|
8
|
+
As your tests run, you'll see an animated kung fu hamster performing various martial arts moves:
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
()__()
|
|
12
|
+
/ o o\
|
|
13
|
+
|' =Y=';----
|
|
14
|
+
{ \ / }
|
|
15
|
+
mmm mmm
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
The hamster is colorized based on your test results:
|
|
19
|
+
- **Green** portion: Passing tests
|
|
20
|
+
- **Yellow** portion: Pending tests
|
|
21
|
+
- **Red** portion: Failing tests
|
|
22
|
+
|
|
23
|
+
The hamster cycles through different kung fu poses as each test completes, creating an animated effect in your terminal!
|
|
24
|
+
|
|
6
25
|
# Installation
|
|
7
26
|
|
|
8
|
-
Add this to
|
|
27
|
+
Add this to your Gemfile (in the test group) and run `bundle install`:
|
|
9
28
|
|
|
10
29
|
``` ruby
|
|
11
30
|
gem 'rspec-kungfuhamster'
|
|
12
31
|
```
|
|
32
|
+
|
|
33
|
+
# Usage
|
|
34
|
+
|
|
35
|
+
After installing the gem, you can use the formatter in several ways:
|
|
36
|
+
|
|
37
|
+
## Command Line
|
|
38
|
+
|
|
39
|
+
Run RSpec with the formatter specified:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
rspec --format RspecKungFuHamster::Formatter
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Configuration File
|
|
46
|
+
|
|
47
|
+
Add to your `.rspec` file in your project root:
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
--format RspecKungFuHamster::Formatter
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## RSpec Configuration
|
|
54
|
+
|
|
55
|
+
Add to your `spec/spec_helper.rb` or `spec/rails_helper.rb`:
|
|
56
|
+
|
|
57
|
+
```ruby
|
|
58
|
+
RSpec.configure do |config|
|
|
59
|
+
config.formatter = RspecKungFuHamster::Formatter
|
|
60
|
+
end
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Or if you want to use multiple formatters:
|
|
64
|
+
|
|
65
|
+
```ruby
|
|
66
|
+
RSpec.configure do |config|
|
|
67
|
+
config.formatter = :progress # or :documentation
|
|
68
|
+
config.add_formatter RspecKungFuHamster::Formatter
|
|
69
|
+
end
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
# Development
|
|
73
|
+
|
|
74
|
+
## Automated Version Bumping
|
|
75
|
+
|
|
76
|
+
This gem uses automated version bumping on pull requests merged to `main` or `master`. The version bump type is determined by labels on the PR:
|
|
77
|
+
|
|
78
|
+
- **`major`** label: Bumps the major version (e.g., 1.2.3 → 2.0.0)
|
|
79
|
+
- **`minor`** label: Bumps the minor version (e.g., 1.2.3 → 1.3.0)
|
|
80
|
+
- **No label**: Defaults to patch bump (e.g., 1.2.3 → 1.2.4)
|
|
81
|
+
|
|
82
|
+
The workflow automatically:
|
|
83
|
+
1. Detects the bump type from PR labels
|
|
84
|
+
2. Updates the version in `lib/rspec_kung_fu_hamster/version.rb`
|
|
85
|
+
3. Commits the version bump with message `[skip ci]`
|
|
86
|
+
4. Creates and pushes a git tag (e.g., `v1.2.3`)
|
|
87
|
+
|
|
88
|
+
### Manual Version Bumping
|
|
89
|
+
|
|
90
|
+
You can also manually bump the version using the script:
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
ruby scripts/bump_version.rb [major|minor|patch]
|
|
94
|
+
```
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require 'rspec_kung_fu_hamster'
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
require 'rspec'
|
|
2
2
|
require 'rspec/core/formatters/base_text_formatter'
|
|
3
|
+
require 'rspec_kung_fu_hamster/version'
|
|
3
4
|
|
|
4
5
|
rspec_bin = $0.split('/').last
|
|
5
6
|
|
|
6
|
-
|
|
7
|
-
RSpec::Core::Formatters
|
|
7
|
+
module RspecKungFuHamster
|
|
8
|
+
class Formatter < RSpec::Core::Formatters::BaseTextFormatter
|
|
9
|
+
RSpec::Core::Formatters.register self,
|
|
8
10
|
# :start,
|
|
9
11
|
# :example_start
|
|
10
12
|
# :message,
|
|
@@ -109,4 +111,5 @@ class RspecKungFuHamster < RSpec::Core::Formatters::BaseTextFormatter
|
|
|
109
111
|
" { \\ / } ",
|
|
110
112
|
" mmm mmm "
|
|
111
113
|
]
|
|
114
|
+
end
|
|
112
115
|
end
|
data/spec/kungfuhamster_spec.rb
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
require_relative '../lib/rspec_kung_fu_hamster.rb'
|
|
2
|
-
describe RspecKungFuHamster do
|
|
2
|
+
describe RspecKungFuHamster::Formatter do
|
|
3
3
|
100.times do |i|
|
|
4
4
|
it { expect(i).to eq i }
|
|
5
5
|
end
|
|
6
|
-
it { expect(RspecKungFuHamster::KUNG_FU_HAMSTER.length).to eq 6 }
|
|
6
|
+
it { expect(RspecKungFuHamster::Formatter::KUNG_FU_HAMSTER.length).to eq 6 }
|
|
7
7
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rspec-kungfuhamster
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Thomas Powell
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: rspec
|
|
@@ -30,18 +29,19 @@ email:
|
|
|
30
29
|
executables: []
|
|
31
30
|
extensions: []
|
|
32
31
|
extra_rdoc_files:
|
|
33
|
-
- README.md
|
|
34
32
|
- LICENSE
|
|
33
|
+
- README.md
|
|
35
34
|
files:
|
|
36
35
|
- LICENSE
|
|
37
36
|
- README.md
|
|
38
37
|
- lib/rspec_kung_fu_hamster.rb
|
|
38
|
+
- lib/rspec_kung_fu_hamster/formatter.rb
|
|
39
|
+
- lib/rspec_kung_fu_hamster/version.rb
|
|
39
40
|
- spec/kungfuhamster_spec.rb
|
|
40
41
|
homepage: https://github.com/stringsn88keys/rspec-kungfuhamster
|
|
41
42
|
licenses:
|
|
42
43
|
- MIT
|
|
43
44
|
metadata: {}
|
|
44
|
-
post_install_message:
|
|
45
45
|
rdoc_options:
|
|
46
46
|
- "--charset"
|
|
47
47
|
- UTF-8
|
|
@@ -58,11 +58,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
58
58
|
- !ruby/object:Gem::Version
|
|
59
59
|
version: '0'
|
|
60
60
|
requirements: []
|
|
61
|
-
|
|
62
|
-
rubygems_version: 2.2.2
|
|
63
|
-
signing_key:
|
|
61
|
+
rubygems_version: 3.6.9
|
|
64
62
|
specification_version: 4
|
|
65
63
|
summary: Rspec kung fu hamster formatter
|
|
66
64
|
test_files:
|
|
67
65
|
- spec/kungfuhamster_spec.rb
|
|
68
|
-
has_rdoc:
|