Skip to content

Commit 191810c

Browse files
committed
pwn.gemspec - ensure every PWN module contains an RSpec test #more_explicit
1 parent 2cd592d commit 191810c

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ $ rvm use ruby-ruby-3.2.1@pwn
3737
$ rvm list gemsets
3838
$ gem install --verbose pwn
3939
$ pwn
40-
pwn[v0.4.628]:001 >>> PWN.help
40+
pwn[v0.4.629]:001 >>> PWN.help
4141
```
4242

4343
[![Installing the pwn Security Automation Framework](https://raw.githubusercontent.com/0dayInc/pwn/master/documentation/pwn_install.png)](https://youtu.be/G7iLUY4FzsI)
@@ -52,7 +52,7 @@ $ rvm use ruby-ruby-3.2.1@pwn
5252
$ gem uninstall --all --executables pwn
5353
$ gem install --verbose pwn
5454
$ pwn
55-
pwn[v0.4.628]:001 >>> PWN.help
55+
pwn[v0.4.629]:001 >>> PWN.help
5656
```
5757

5858

lib/pwn/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# frozen_string_literal: true
22

33
module PWN
4-
VERSION = '0.4.628'
4+
VERSION = '0.4.629'
55
end

pwn.gemspec

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,14 @@ Gem::Specification.new do |spec|
2727

2828
missing_rspec = false
2929
pwn_modules.each do |pwn_path|
30-
spec_test_for_mod = "#{File.dirname(pwn_path)}/#{File.basename(pwn_path).split('.').first}_spec.rb"
31-
next unless spec_tests.grep(/#{spec_test_for_mod}/).empty?
30+
spec_dirname_for_mod = "spec/#{File.dirname(pwn_path)}"
31+
spec_test_for_mod = "#{File.basename(pwn_path).split('.').first}_spec.rb"
32+
spec_path_for_mod = "#{spec_dirname_for_mod}/#{spec_test_for_mod}"
33+
next unless spec_tests.grep(/#{spec_path_for_mod}/).empty?
3234

3335
missing_rspec = true
3436
pwn_mod_dir = File.dirname(pwn_path)
35-
spec_test = "spec/#{pwn_mod_dir}/#{spec_test_for_mod}"
36-
error_msg = "ERROR: RSpec: #{spec_test} missing for PWN Module: #{pwn_path}"
37+
error_msg = "ERROR: RSpec: #{spec_path_for_mod} missing for PWN Module: #{pwn_path}"
3738
# Display error message in red (octal encoded ansi sequence)
3839
puts "\001\e[1m\002\001\e[31m\002#{error_msg}\001\e[0m\002"
3940
end

0 commit comments

Comments
 (0)