diff --git a/lib/ssh_scan_api/version.rb b/lib/ssh_scan_api/version.rb index 8bc01c0..de7503b 100644 --- a/lib/ssh_scan_api/version.rb +++ b/lib/ssh_scan_api/version.rb @@ -1,3 +1,3 @@ module SSHScan - API_VERSION = '0.0.1.pre' + API_VERSION = '0.0.1.pre2' end diff --git a/spec/ssh_scan_api/api_spec.rb b/spec/ssh_scan_api/api_spec.rb index 66be273..dcaba9e 100644 --- a/spec/ssh_scan_api/api_spec.rb +++ b/spec/ssh_scan_api/api_spec.rb @@ -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 diff --git a/spec/ssh_scan_api/version_spec.rb b/spec/ssh_scan_api/version_spec.rb index d49d2af..b1ff55b 100644 --- a/spec/ssh_scan_api/version_spec.rb +++ b/spec/ssh_scan_api/version_spec.rb @@ -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 \ No newline at end of file diff --git a/ssh_scan_api.gemspec b/ssh_scan_api.gemspec index 6a158b6..d05e068 100644 --- a/ssh_scan_api.gemspec +++ b/ssh_scan_api.gemspec @@ -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')