Skip to content
This repository has been archived by the owner on Feb 16, 2021. It is now read-only.

Commit

Permalink
More clean up and prep for split
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Claudius committed Mar 2, 2017
1 parent caf8c53 commit c284f9c
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/ssh_scan_api/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module SSHScan
API_VERSION = '0.0.1.pre'
API_VERSION = '0.0.1.pre2'
end
2 changes: 1 addition & 1 deletion spec/ssh_scan_api/api_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def app
expect(last_response.status).to eql(200)
expect(last_response.body).to eql(
"See API documentation here: \
https://github.com/mozilla/ssh_scan/wiki/ssh_scan-Web-API\n"
https://github.com/mozilla/ssh_scan_api/wiki/ssh_scan-Web-API\n"
)
end

Expand Down
21 changes: 16 additions & 5 deletions spec/ssh_scan_api/version_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,22 @@
expect(SSHScan::API_VERSION).to be_kind_of(::String)
end

it "SSHScan::API_VERSION should have 1 level" do
expect(SSHScan::API_VERSION.split('.').size).to eql(1)
end
it "SSHScan::API_VERSION should have appropriate version" do
tokens = SSHScan::API_VERSION.split(".")

expect(tokens.size).to be_between(3,4).inclusive

it "SSHScan::API_VERSION should have a number between 1-20 for each octet" do
expect(SSHScan::API_VERSION).to eql("1")
if tokens.size == 3
tokens.each do |token|
expect(token).to be_kind_of(::String)
expect(token.to_i).to be_between(0,50).inclusive
end
else tokens.size == 4
expect(tokens[-1]).to match(/pre/)
tokens[0,3].each do |token|
expect(token).to be_kind_of(::String)
expect(token.to_i).to be_between(0,50).inclusive
end
end
end
end
2 changes: 2 additions & 0 deletions ssh_scan_api.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ Gem::Specification.new do |s|
s.add_dependency('sinatra')
s.add_dependency('sinatra-contrib')
s.add_dependency('thin')
s.add_dependency('haml')
s.add_dependency('secure_headers')
s.add_development_dependency('rack-test')
s.add_development_dependency('pry')
s.add_development_dependency('rspec', '~> 3.0')
Expand Down

0 comments on commit c284f9c

Please sign in to comment.