ronin-code-sql 2.0.0.beta1 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ruby.yml +1 -0
  3. data/.yardopts +1 -1
  4. data/README.md +5 -4
  5. data/gemspec.yml +3 -3
  6. data/lib/ronin/code/sql/binary_expr.rb +1 -1
  7. data/lib/ronin/code/sql/clause.rb +1 -1
  8. data/lib/ronin/code/sql/clauses.rb +1 -1
  9. data/lib/ronin/code/sql/emittable.rb +1 -1
  10. data/lib/ronin/code/sql/emitter.rb +1 -1
  11. data/lib/ronin/code/sql/field.rb +2 -2
  12. data/lib/ronin/code/sql/fields.rb +1 -1
  13. data/lib/ronin/code/sql/function.rb +1 -1
  14. data/lib/ronin/code/sql/functions.rb +1 -1
  15. data/lib/ronin/code/sql/injection.rb +1 -1
  16. data/lib/ronin/code/sql/injection_expr.rb +1 -1
  17. data/lib/ronin/code/sql/literal.rb +1 -1
  18. data/lib/ronin/code/sql/literals.rb +1 -1
  19. data/lib/ronin/code/sql/operators.rb +1 -1
  20. data/lib/ronin/code/sql/statement.rb +1 -1
  21. data/lib/ronin/code/sql/statement_list.rb +1 -1
  22. data/lib/ronin/code/sql/statements.rb +1 -1
  23. data/lib/ronin/code/sql/unary_expr.rb +1 -1
  24. data/lib/ronin/code/sql/version.rb +2 -2
  25. data/lib/ronin/code/sql.rb +1 -1
  26. data/ronin-code-sql.gemspec +2 -1
  27. metadata +7 -51
  28. data/spec/spec_helper.rb +0 -3
  29. data/spec/sql/binary_expr_examples.rb +0 -25
  30. data/spec/sql/binary_expr_spec.rb +0 -5
  31. data/spec/sql/clause_examples.rb +0 -43
  32. data/spec/sql/clause_spec.rb +0 -31
  33. data/spec/sql/clauses_spec.rb +0 -47
  34. data/spec/sql/emittable_spec.rb +0 -41
  35. data/spec/sql/emitter_spec.rb +0 -533
  36. data/spec/sql/field_spec.rb +0 -103
  37. data/spec/sql/fields_spec.rb +0 -40
  38. data/spec/sql/function_examples.rb +0 -30
  39. data/spec/sql/function_spec.rb +0 -25
  40. data/spec/sql/functions_spec.rb +0 -113
  41. data/spec/sql/injection_expr_spec.rb +0 -98
  42. data/spec/sql/injection_spec.rb +0 -172
  43. data/spec/sql/literal_spec.rb +0 -5
  44. data/spec/sql/literals_spec.rb +0 -46
  45. data/spec/sql/operators_spec.rb +0 -44
  46. data/spec/sql/statement_examples.rb +0 -39
  47. data/spec/sql/statement_list_spec.rb +0 -48
  48. data/spec/sql/statement_spec.rb +0 -38
  49. data/spec/sql/statements_spec.rb +0 -22
  50. data/spec/sql/unary_expr_examples.rb +0 -20
  51. data/spec/sql/unary_expr_spec.rb +0 -5
  52. data/spec/sql_spec.rb +0 -18
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fc5de90b2961287f9110ba16c922ad1b8e787563d7fb93a075834cb6935b2da9
4
- data.tar.gz: 61e12da2b15fa8306677b1f0bcaa1c1b973512bb5339e162af7eca6f15fdfb19
3
+ metadata.gz: bebb1935967905988d415c412fa1a88b3e8785da8ec9c22cfcd9e9a9ec4a7a34
4
+ data.tar.gz: dd91249093d87d6d351fd4f4a766010e053ed780b419e5e370395e5d168a1d1f
5
5
  SHA512:
6
- metadata.gz: 43387545e4de6ca18387df0ac5a8af970b0b99ce6fc0300094e61bc2898351dbeae176bd66ab0e097cf0028e164cf8c19c8841787839b71a8e964627b53be9c3
7
- data.tar.gz: 3b057ebcd0be473896562afb5d4159ab9930c1a0008f789f3c8473991b452eee485b0dfa8351b02401945b0b9c2777d21257e325ed5bd823ab1685a10e617109
6
+ metadata.gz: efdbd2b72acd2d75865109d0b803c5a65681085c7fd76cef7c630da3fade71326aa982328cf0ec2dc30ca4e4929f3a52b767872405dc1584246629da1f94ccc3
7
+ data.tar.gz: c8fec6e491e0cea640b18ea4be2d4ff479e679f15eaddaafbbc07b17b28fe1c8a3a32b96243237f2904850dae3397bcc8c4a3ed45b5fb3c109a0dd28a4104b3f
@@ -21,6 +21,7 @@ jobs:
21
21
  uses: ruby/setup-ruby@v1
22
22
  with:
23
23
  ruby-version: ${{ matrix.ruby }}
24
+ bundler-cache: true
24
25
  - name: Install dependencies
25
26
  run: bundle install --jobs 4 --retry 3
26
27
  - name: Run tests
data/.yardopts CHANGED
@@ -1 +1 @@
1
- --markup markdown --title 'Ronin SQL Documentation' --protected
1
+ --markup markdown --title 'Ronin::Code::SQL Documentation' --protected
data/README.md CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  [![CI](https://github.com/ronin-rb/ronin-code-sql/actions/workflows/ruby.yml/badge.svg)](https://github.com/ronin-rb/ronin-code-sql/actions/workflows/ruby.yml)
4
4
  [![Code Climate](https://codeclimate.com/github/ronin-rb/ronin-code-sql.svg)](https://codeclimate.com/github/ronin-rb/ronin-code-sql)
5
+ [![Gem Version](https://badge.fury.io/rb/ronin-code-sql.svg)](https://badge.fury.io/rb/ronin-code-sql)
5
6
 
6
7
  * [Source](https://github.com/ronin-rb/ronin-code-sql)
7
8
  * [Issues](https://github.com/ronin-rb/ronin-code-sql/issues)
@@ -121,13 +122,13 @@ puts sqli
121
122
  # 1 AND (SELECT COUNT(*) FROM users)=1
122
123
  ```
123
124
 
124
- Create errors by using non-existant tables:
125
+ Create errors by using non-existent tables:
125
126
 
126
127
  ```ruby
127
128
  sqli = Ronin::Code::SQL::Injection.new(escape: :string)
128
- sqli.and { non_existant_table == '1' }
129
+ sqli.and { non_existent_table == '1' }
129
130
  puts sqli
130
- # 1' AND non_existant_table='1
131
+ # 1' AND non_existent_table='1
131
132
  ```
132
133
 
133
134
  Dumping all values of a column:
@@ -191,7 +192,7 @@ $ gem install ronin-code-sql
191
192
 
192
193
  ronin-code-sql - A Ruby DSL for crafting SQL Injections.
193
194
 
194
- Copyright (c) 2007-2022 Hal Brodigan (postmodern.mod3 at gmail.com)
195
+ Copyright (c) 2007-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
195
196
 
196
197
  ronin-code-sql is free software: you can redistribute it and/or modify
197
198
  it under the terms of the GNU Lesser General Public License as published
data/gemspec.yml CHANGED
@@ -10,16 +10,16 @@ homepage: https://github.com/ronin-rb/ronin-code-sql#readme
10
10
  has_yard: true
11
11
 
12
12
  metadata:
13
- documentation_uri: https://rubydoc.info/gems/ronin-code-sql
13
+ documentation_uri: https://ronin-rb.dev/docs/ronin-code-sql
14
14
  source_code_uri: https://github.com/ronin-rb/ronin-code-sql
15
15
  bug_tracker_uri: https://github.com/ronin-rb/ronin-code-sql/issues
16
- changelog_uri: https://github.com/ronin-rb/ronin-code-sql/blob/master/ChangeLog.md
16
+ changelog_uri: https://github.com/ronin-rb/ronin-code-sql/blob/main/ChangeLog.md
17
17
  rubygems_mfa_required: 'true'
18
18
 
19
19
  required_ruby_version: ">= 3.0.0"
20
20
 
21
21
  dependencies:
22
- ronin-support: ~> 1.0.0.beta1
22
+ ronin-support: ~> 1.0
23
23
 
24
24
  development_dependencies:
25
25
  bundler: ~> 2.0
@@ -2,7 +2,7 @@
2
2
  #
3
3
  # ronin-code-sql - A Ruby DSL for crafting SQL Injections.
4
4
  #
5
- # Copyright (c) 2007-2022 Hal Brodigan (postmodern.mod3 at gmail.com)
5
+ # Copyright (c) 2007-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
6
6
  #
7
7
  # ronin-code-sql is free software: you can redistribute it and/or modify
8
8
  # it under the terms of the GNU Lesser General Public License as published
@@ -2,7 +2,7 @@
2
2
  #
3
3
  # ronin-code-sql - A Ruby DSL for crafting SQL Injections.
4
4
  #
5
- # Copyright (c) 2007-2022 Hal Brodigan (postmodern.mod3 at gmail.com)
5
+ # Copyright (c) 2007-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
6
6
  #
7
7
  # ronin-code-sql is free software: you can redistribute it and/or modify
8
8
  # it under the terms of the GNU Lesser General Public License as published
@@ -2,7 +2,7 @@
2
2
  #
3
3
  # ronin-code-sql - A Ruby DSL for crafting SQL Injections.
4
4
  #
5
- # Copyright (c) 2007-2022 Hal Brodigan (postmodern.mod3 at gmail.com)
5
+ # Copyright (c) 2007-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
6
6
  #
7
7
  # ronin-code-sql is free software: you can redistribute it and/or modify
8
8
  # it under the terms of the GNU Lesser General Public License as published
@@ -2,7 +2,7 @@
2
2
  #
3
3
  # ronin-code-sql - A Ruby DSL for crafting SQL Injections.
4
4
  #
5
- # Copyright (c) 2007-2022 Hal Brodigan (postmodern.mod3 at gmail.com)
5
+ # Copyright (c) 2007-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
6
6
  #
7
7
  # ronin-code-sql is free software: you can redistribute it and/or modify
8
8
  # it under the terms of the GNU Lesser General Public License as published
@@ -2,7 +2,7 @@
2
2
  #
3
3
  # ronin-code-sql - A Ruby DSL for crafting SQL Injections.
4
4
  #
5
- # Copyright (c) 2007-2022 Hal Brodigan (postmodern.mod3 at gmail.com)
5
+ # Copyright (c) 2007-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
6
6
  #
7
7
  # ronin-code-sql is free software: you can redistribute it and/or modify
8
8
  # it under the terms of the GNU Lesser General Public License as published
@@ -2,7 +2,7 @@
2
2
  #
3
3
  # ronin-code-sql - A Ruby DSL for crafting SQL Injections.
4
4
  #
5
- # Copyright (c) 2007-2022 Hal Brodigan (postmodern.mod3 at gmail.com)
5
+ # Copyright (c) 2007-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
6
6
  #
7
7
  # ronin-code-sql is free software: you can redistribute it and/or modify
8
8
  # it under the terms of the GNU Lesser General Public License as published
@@ -75,7 +75,7 @@ module Ronin
75
75
  # The sub-field name.
76
76
  #
77
77
  # @param [Array] arguments
78
- # Additional mehtod arguments.
78
+ # Additional method arguments.
79
79
  #
80
80
  # @return [Field]
81
81
  # The sub-field for the given name.
@@ -2,7 +2,7 @@
2
2
  #
3
3
  # ronin-code-sql - A Ruby DSL for crafting SQL Injections.
4
4
  #
5
- # Copyright (c) 2007-2022 Hal Brodigan (postmodern.mod3 at gmail.com)
5
+ # Copyright (c) 2007-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
6
6
  #
7
7
  # ronin-code-sql is free software: you can redistribute it and/or modify
8
8
  # it under the terms of the GNU Lesser General Public License as published
@@ -2,7 +2,7 @@
2
2
  #
3
3
  # ronin-code-sql - A Ruby DSL for crafting SQL Injections.
4
4
  #
5
- # Copyright (c) 2007-2022 Hal Brodigan (postmodern.mod3 at gmail.com)
5
+ # Copyright (c) 2007-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
6
6
  #
7
7
  # ronin-code-sql is free software: you can redistribute it and/or modify
8
8
  # it under the terms of the GNU Lesser General Public License as published
@@ -2,7 +2,7 @@
2
2
  #
3
3
  # ronin-code-sql - A Ruby DSL for crafting SQL Injections.
4
4
  #
5
- # Copyright (c) 2007-2022 Hal Brodigan (postmodern.mod3 at gmail.com)
5
+ # Copyright (c) 2007-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
6
6
  #
7
7
  # ronin-code-sql is free software: you can redistribute it and/or modify
8
8
  # it under the terms of the GNU Lesser General Public License as published
@@ -2,7 +2,7 @@
2
2
  #
3
3
  # ronin-code-sql - A Ruby DSL for crafting SQL Injections.
4
4
  #
5
- # Copyright (c) 2007-2022 Hal Brodigan (postmodern.mod3 at gmail.com)
5
+ # Copyright (c) 2007-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
6
6
  #
7
7
  # ronin-code-sql is free software: you can redistribute it and/or modify
8
8
  # it under the terms of the GNU Lesser General Public License as published
@@ -2,7 +2,7 @@
2
2
  #
3
3
  # ronin-code-sql - A Ruby DSL for crafting SQL Injections.
4
4
  #
5
- # Copyright (c) 2007-2022 Hal Brodigan (postmodern.mod3 at gmail.com)
5
+ # Copyright (c) 2007-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
6
6
  #
7
7
  # ronin-code-sql is free software: you can redistribute it and/or modify
8
8
  # it under the terms of the GNU Lesser General Public License as published
@@ -2,7 +2,7 @@
2
2
  #
3
3
  # ronin-code-sql - A Ruby DSL for crafting SQL Injections.
4
4
  #
5
- # Copyright (c) 2007-2022 Hal Brodigan (postmodern.mod3 at gmail.com)
5
+ # Copyright (c) 2007-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
6
6
  #
7
7
  # ronin-code-sql is free software: you can redistribute it and/or modify
8
8
  # it under the terms of the GNU Lesser General Public License as published
@@ -2,7 +2,7 @@
2
2
  #
3
3
  # ronin-code-sql - A Ruby DSL for crafting SQL Injections.
4
4
  #
5
- # Copyright (c) 2007-2022 Hal Brodigan (postmodern.mod3 at gmail.com)
5
+ # Copyright (c) 2007-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
6
6
  #
7
7
  # ronin-code-sql is free software: you can redistribute it and/or modify
8
8
  # it under the terms of the GNU Lesser General Public License as published
@@ -2,7 +2,7 @@
2
2
  #
3
3
  # ronin-code-sql - A Ruby DSL for crafting SQL Injections.
4
4
  #
5
- # Copyright (c) 2007-2022 Hal Brodigan (postmodern.mod3 at gmail.com)
5
+ # Copyright (c) 2007-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
6
6
  #
7
7
  # ronin-code-sql is free software: you can redistribute it and/or modify
8
8
  # it under the terms of the GNU Lesser General Public License as published
@@ -2,7 +2,7 @@
2
2
  #
3
3
  # ronin-code-sql - A Ruby DSL for crafting SQL Injections.
4
4
  #
5
- # Copyright (c) 2007-2022 Hal Brodigan (postmodern.mod3 at gmail.com)
5
+ # Copyright (c) 2007-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
6
6
  #
7
7
  # ronin-code-sql is free software: you can redistribute it and/or modify
8
8
  # it under the terms of the GNU Lesser General Public License as published
@@ -2,7 +2,7 @@
2
2
  #
3
3
  # ronin-code-sql - A Ruby DSL for crafting SQL Injections.
4
4
  #
5
- # Copyright (c) 2007-2022 Hal Brodigan (postmodern.mod3 at gmail.com)
5
+ # Copyright (c) 2007-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
6
6
  #
7
7
  # ronin-code-sql is free software: you can redistribute it and/or modify
8
8
  # it under the terms of the GNU Lesser General Public License as published
@@ -2,7 +2,7 @@
2
2
  #
3
3
  # ronin-code-sql - A Ruby DSL for crafting SQL Injections.
4
4
  #
5
- # Copyright (c) 2007-2022 Hal Brodigan (postmodern.mod3 at gmail.com)
5
+ # Copyright (c) 2007-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
6
6
  #
7
7
  # ronin-code-sql is free software: you can redistribute it and/or modify
8
8
  # it under the terms of the GNU Lesser General Public License as published
@@ -2,7 +2,7 @@
2
2
  #
3
3
  # ronin-code-sql - A Ruby DSL for crafting SQL Injections.
4
4
  #
5
- # Copyright (c) 2007-2022 Hal Brodigan (postmodern.mod3 at gmail.com)
5
+ # Copyright (c) 2007-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
6
6
  #
7
7
  # ronin-code-sql is free software: you can redistribute it and/or modify
8
8
  # it under the terms of the GNU Lesser General Public License as published
@@ -2,7 +2,7 @@
2
2
  #
3
3
  # ronin-code-sql - A Ruby DSL for crafting SQL Injections.
4
4
  #
5
- # Copyright (c) 2007-2022 Hal Brodigan (postmodern.mod3 at gmail.com)
5
+ # Copyright (c) 2007-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
6
6
  #
7
7
  # ronin-code-sql is free software: you can redistribute it and/or modify
8
8
  # it under the terms of the GNU Lesser General Public License as published
@@ -22,7 +22,7 @@ module Ronin
22
22
  module Code
23
23
  module SQL
24
24
  # Ronin SQL version
25
- VERSION = '2.0.0.beta1'
25
+ VERSION = '2.0.0'
26
26
  end
27
27
  end
28
28
  end
@@ -2,7 +2,7 @@
2
2
  #
3
3
  # ronin-code-sql - A Ruby DSL for crafting SQL Injections.
4
4
  #
5
- # Copyright (c) 2007-2022 Hal Brodigan (postmodern.mod3 at gmail.com)
5
+ # Copyright (c) 2007-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
6
6
  #
7
7
  # ronin-code-sql is free software: you can redistribute it and/or modify
8
8
  # it under the terms of the GNU Lesser General Public License as published
@@ -27,6 +27,8 @@ Gem::Specification.new do |gem|
27
27
  gem.files = `git ls-files`.split($/)
28
28
  gem.files = glob[gemspec['files']] if gemspec['files']
29
29
  gem.files += Array(gemspec['generated_files'])
30
+ # exclude test files from the packages gem
31
+ gem.files -= glob[gemspec['test_files'] || 'spec/{**/}*']
30
32
 
31
33
  gem.executables = gemspec.fetch('executables') do
32
34
  glob['bin/*'].map { |path| File.basename(path) }
@@ -34,7 +36,6 @@ Gem::Specification.new do |gem|
34
36
  gem.default_executable = gem.executables.first if Gem::VERSION < '1.7.'
35
37
 
36
38
  gem.extensions = glob[gemspec['extensions'] || 'ext/**/extconf.rb']
37
- gem.test_files = glob[gemspec['test_files'] || 'spec/{**/}*_spec.rb']
38
39
  gem.extra_rdoc_files = glob[gemspec['extra_doc_files'] || '*.{txt,md}']
39
40
 
40
41
  gem.require_paths = Array(gemspec.fetch('require_paths') {
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ronin-code-sql
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0.beta1
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Postmodern
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-01-01 00:00:00.000000000 Z
11
+ date: 2023-02-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ronin-support
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 1.0.0.beta1
19
+ version: '1.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 1.0.0.beta1
26
+ version: '1.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -82,39 +82,14 @@ files:
82
82
  - lib/ronin/code/sql/unary_expr.rb
83
83
  - lib/ronin/code/sql/version.rb
84
84
  - ronin-code-sql.gemspec
85
- - spec/spec_helper.rb
86
- - spec/sql/binary_expr_examples.rb
87
- - spec/sql/binary_expr_spec.rb
88
- - spec/sql/clause_examples.rb
89
- - spec/sql/clause_spec.rb
90
- - spec/sql/clauses_spec.rb
91
- - spec/sql/emittable_spec.rb
92
- - spec/sql/emitter_spec.rb
93
- - spec/sql/field_spec.rb
94
- - spec/sql/fields_spec.rb
95
- - spec/sql/function_examples.rb
96
- - spec/sql/function_spec.rb
97
- - spec/sql/functions_spec.rb
98
- - spec/sql/injection_expr_spec.rb
99
- - spec/sql/injection_spec.rb
100
- - spec/sql/literal_spec.rb
101
- - spec/sql/literals_spec.rb
102
- - spec/sql/operators_spec.rb
103
- - spec/sql/statement_examples.rb
104
- - spec/sql/statement_list_spec.rb
105
- - spec/sql/statement_spec.rb
106
- - spec/sql/statements_spec.rb
107
- - spec/sql/unary_expr_examples.rb
108
- - spec/sql/unary_expr_spec.rb
109
- - spec/sql_spec.rb
110
85
  homepage: https://github.com/ronin-rb/ronin-code-sql#readme
111
86
  licenses:
112
87
  - LGPL-3.0
113
88
  metadata:
114
- documentation_uri: https://rubydoc.info/gems/ronin-code-sql
89
+ documentation_uri: https://ronin-rb.dev/docs/ronin-code-sql
115
90
  source_code_uri: https://github.com/ronin-rb/ronin-code-sql
116
91
  bug_tracker_uri: https://github.com/ronin-rb/ronin-code-sql/issues
117
- changelog_uri: https://github.com/ronin-rb/ronin-code-sql/blob/master/ChangeLog.md
92
+ changelog_uri: https://github.com/ronin-rb/ronin-code-sql/blob/main/ChangeLog.md
118
93
  rubygems_mfa_required: 'true'
119
94
  post_install_message:
120
95
  rdoc_options: []
@@ -135,23 +110,4 @@ rubygems_version: 3.3.26
135
110
  signing_key:
136
111
  specification_version: 4
137
112
  summary: A Ruby DSL for crafting SQL Injections.
138
- test_files:
139
- - spec/sql/binary_expr_spec.rb
140
- - spec/sql/clause_spec.rb
141
- - spec/sql/clauses_spec.rb
142
- - spec/sql/emittable_spec.rb
143
- - spec/sql/emitter_spec.rb
144
- - spec/sql/field_spec.rb
145
- - spec/sql/fields_spec.rb
146
- - spec/sql/function_spec.rb
147
- - spec/sql/functions_spec.rb
148
- - spec/sql/injection_expr_spec.rb
149
- - spec/sql/injection_spec.rb
150
- - spec/sql/literal_spec.rb
151
- - spec/sql/literals_spec.rb
152
- - spec/sql/operators_spec.rb
153
- - spec/sql/statement_list_spec.rb
154
- - spec/sql/statement_spec.rb
155
- - spec/sql/statements_spec.rb
156
- - spec/sql/unary_expr_spec.rb
157
- - spec/sql_spec.rb
113
+ test_files: []
data/spec/spec_helper.rb DELETED
@@ -1,3 +0,0 @@
1
- require 'rspec'
2
- require 'simplecov'
3
- SimpleCov.start
@@ -1,25 +0,0 @@
1
- require 'spec_helper'
2
- require 'ronin/code/sql/binary_expr'
3
-
4
- shared_examples_for "BinaryExpr" do |method,operator=method|
5
- describe "##{method}" do
6
- let(:operand) { 1 }
7
- let(:expr) { subject.send(method,operand) }
8
-
9
- it "should be a BinaryExpr" do
10
- expect(expr).to be_kind_of(Ronin::Code::SQL::BinaryExpr)
11
- end
12
-
13
- it "should set the left-hand side operand" do
14
- expect(expr.left).to eq(subject)
15
- end
16
-
17
- it "should have a '#{operator}' operator" do
18
- expect(expr.operator).to eq(operator)
19
- end
20
-
21
- it "should set the right-hand side operand" do
22
- expect(expr.right).to eq(operand)
23
- end
24
- end
25
- end
@@ -1,5 +0,0 @@
1
- require 'spec_helper'
2
- require 'ronin/code/sql/binary_expr'
3
-
4
- describe Ronin::Code::SQL::BinaryExpr do
5
- end
@@ -1,43 +0,0 @@
1
- require 'spec_helper'
2
-
3
- shared_examples_for "Clause" do |method,keyword,argument_or_block=nil|
4
- describe "##{method}" do
5
- case argument_or_block
6
- when Proc
7
- before { subject.send(method,&argument_or_block) }
8
- when Array
9
- let(:arguments) { argument_or_block }
10
-
11
- before { subject.send(method,*arguments) }
12
- when NilClass
13
- before { subject.send(method) }
14
- else
15
- let(:argument) { argument_or_block }
16
-
17
- before { subject.send(method,argument) }
18
- end
19
-
20
- it "should add a #{keyword} clause" do
21
- expect(clause.keyword).to eq(keyword)
22
- end
23
-
24
- case argument_or_block
25
- when Proc
26
- it "should accept a block" do
27
- expect(clause.argument).not_to be_nil
28
- end
29
- when NilClass
30
- it "should not have an argument" do
31
- expect(clause.argument).to be_nil
32
- end
33
- when Array
34
- it "should accept an argument" do
35
- expect(clause.argument).to eq(arguments)
36
- end
37
- else
38
- it "should accept an argument" do
39
- expect(clause.argument).to eq(argument)
40
- end
41
- end
42
- end
43
- end
@@ -1,31 +0,0 @@
1
- require 'spec_helper'
2
- require 'ronin/code/sql/clause'
3
-
4
- describe Ronin::Code::SQL::Clause do
5
- describe "#initialize" do
6
- context "when given an argument" do
7
- let(:argument) { 1 }
8
-
9
- subject { described_class.new(:CLAUSE,argument) }
10
-
11
- it "should set the argument" do
12
- expect(subject.argument).to eq(argument)
13
- end
14
- end
15
-
16
- context "when given a block" do
17
- subject do
18
- described_class.new(:CLAUSE) { 1 }
19
- end
20
-
21
- it "should use the return value as the argument" do
22
- expect(subject.argument).to eq(1)
23
- end
24
-
25
- context "that accepts an argument" do
26
- it "should yield itself" do
27
- end
28
- end
29
- end
30
- end
31
- end
@@ -1,47 +0,0 @@
1
- require 'spec_helper'
2
- require 'sql/clause_examples'
3
- require 'ronin/code/sql/clause'
4
- require 'ronin/code/sql/clauses'
5
-
6
- describe Ronin::Code::SQL::Clauses do
7
- subject { Object.new.extend(described_class) }
8
-
9
- let(:clause) { subject.clauses.last }
10
-
11
- it { expect(subject.clauses).to be_empty }
12
-
13
- describe "#clause" do
14
- let(:keyword) { :EXEC }
15
-
16
- before { subject.clause(keyword) }
17
-
18
- it "should add an arbitrary clause" do
19
- expect(clause.keyword).to eq(keyword)
20
- end
21
- end
22
-
23
- include_examples "Clause", :from, :FROM, :table
24
- include_examples "Clause", :into, :INTO, :table
25
- include_examples "Clause", :where, :WHERE, proc { id == 1 }
26
- include_examples "Clause", :join, :JOIN, :table
27
- include_examples "Clause", :inner_join, [:INNER, :JOIN], :table
28
- include_examples "Clause", :left_join, [:LEFT, :JOIN], :table
29
- include_examples "Clause", :right_join, [:RIGHT, :JOIN], :table
30
- include_examples "Clause", :full_join, [:FULL, :JOIN], :table
31
- include_examples "Clause", :on, :ON, proc { id == 1 }
32
- include_examples "Clause", :union, :UNION, proc { select(:*).from(:table) }
33
- include_examples "Clause", :union_all, [:UNION, :ALL], proc {
34
- select(:*).from(:table)
35
- }
36
- include_examples "Clause", :group_by, [:GROUP, :BY], [:column1, :column2]
37
- include_examples "Clause", :having, :HAVING, proc { max(priv) > 100 }
38
- include_examples "Clause", :limit, :LIMIT, 100
39
- include_examples "Clause", :offset, :OFFSET, 20
40
- include_examples "Clause", :top, :TOP, 50
41
- include_examples "Clause", :into, :INTO, :table
42
- include_examples "Clause", :values, :VALUES, [1,2,3,4]
43
- include_examples "Clause", :default_values, [:DEFAULT, :VALUES]
44
- include_examples "Clause", :set, :SET, {x: 1, y: 2}
45
- include_examples "Clause", :indexed_by, [:INDEXED, :BY], :index_name
46
- include_examples "Clause", :not_indexed, [:NOT, :INDEXED]
47
- end
@@ -1,41 +0,0 @@
1
- require 'spec_helper'
2
- require 'ronin/code/sql/emittable'
3
- require 'ronin/code/sql/literal'
4
-
5
- describe Ronin::Code::SQL::Emittable do
6
- subject { Ronin::Code::SQL::Literal.new('hello') }
7
-
8
- describe "#emitter" do
9
- it "should return an Ronin::Code::SQL::Emitter" do
10
- expect(subject.emitter).to be_kind_of(Ronin::Code::SQL::Emitter)
11
- end
12
-
13
- it "should accept Emitter options" do
14
- expect(subject.emitter(case: :lower).case).to eq(:lower)
15
- end
16
- end
17
-
18
- describe "#to_sql" do
19
- it "should emit the object" do
20
- expect(subject.to_sql).to eq("'hello'")
21
- end
22
-
23
- context "when given options" do
24
- it "should pass them to #emitter" do
25
- expect(subject.to_sql(quotes: :double)).to eq('"hello"')
26
- end
27
- end
28
- end
29
-
30
- describe "#to_s" do
31
- it "should call #to_sql with no arguments" do
32
- expect(subject.to_s).to eq(subject.to_sql)
33
- end
34
- end
35
-
36
- describe "#inspect" do
37
- it "should call #to_sql with no arguments" do
38
- expect(subject.inspect).to include(subject.to_sql)
39
- end
40
- end
41
- end