sinclair 1.4.2 → 1.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +4 -1
  3. data/Dockerfile +3 -3
  4. data/README.md +1 -1
  5. data/config/check_specs.yml +5 -0
  6. data/config/yardstick.yml +3 -0
  7. data/lib/sinclair.rb +26 -9
  8. data/lib/sinclair/config/methods_builder.rb +3 -1
  9. data/lib/sinclair/config_factory.rb +4 -2
  10. data/lib/sinclair/matchers/add_class_method_to.rb +1 -0
  11. data/lib/sinclair/method_builder.rb +61 -0
  12. data/lib/sinclair/method_builder/base.rb +67 -0
  13. data/lib/sinclair/method_builder/block_method_builder.rb +34 -0
  14. data/lib/sinclair/method_builder/string_method_builder.rb +50 -0
  15. data/lib/sinclair/method_definition.rb +38 -17
  16. data/lib/sinclair/method_definition/block_definition.rb +8 -94
  17. data/lib/sinclair/method_definition/block_helper.rb +46 -0
  18. data/lib/sinclair/method_definition/string_definition.rb +7 -66
  19. data/lib/sinclair/method_definitions.rb +16 -4
  20. data/lib/sinclair/version.rb +1 -1
  21. data/sinclair.gemspec +1 -1
  22. data/spec/lib/sinclair/method_builder/block_method_builder_spec.rb +55 -0
  23. data/spec/lib/sinclair/method_builder/string_method_builder_spec.rb +54 -0
  24. data/spec/lib/sinclair/method_builder_spec.rb +53 -0
  25. data/spec/lib/sinclair/method_definition/block_definition_spec.rb +66 -0
  26. data/spec/lib/sinclair/method_definition/block_helper_spec.rb +111 -0
  27. data/spec/lib/sinclair/method_definition/string_definition_spec.rb +70 -0
  28. data/spec/lib/sinclair/method_definition_spec.rb +23 -88
  29. data/spec/lib/sinclair/method_definitions_spec.rb +45 -0
  30. data/spec/support/models/random_generator.rb +13 -0
  31. metadata +18 -20
  32. data/lib/sinclair/method_definition/class_block_definition.rb +0 -22
  33. data/lib/sinclair/method_definition/class_method_definition.rb +0 -50
  34. data/lib/sinclair/method_definition/class_string_definition.rb +0 -24
  35. data/lib/sinclair/method_definition/instance_block_definition.rb +0 -22
  36. data/lib/sinclair/method_definition/instance_method_definition.rb +0 -48
  37. data/lib/sinclair/method_definition/instance_string_definition.rb +0 -24
  38. data/spec/integration/yard/sinclair/method_definition/class_block_definition_spec.rb +0 -34
  39. data/spec/integration/yard/sinclair/method_definition/class_method_definition_spec.rb +0 -28
  40. data/spec/integration/yard/sinclair/method_definition/class_string_definition_spec.rb +0 -23
  41. data/spec/integration/yard/sinclair/method_definition/instance_block_definition_spec.rb +0 -25
  42. data/spec/integration/yard/sinclair/method_definition/instance_method_definition_spec.rb +0 -35
  43. data/spec/integration/yard/sinclair/method_definition/instance_string_definition_spec.rb +0 -32
  44. data/spec/lib/sinclair/method_definition/class_block_definition_spec.rb +0 -29
  45. data/spec/lib/sinclair/method_definition/class_string_definition_spec.rb +0 -27
  46. data/spec/lib/sinclair/method_definition/instance_block_definition_spec.rb +0 -30
  47. data/spec/lib/sinclair/method_definition/instance_string_definition_spec.rb +0 -28
@@ -1,28 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'spec_helper'
4
-
5
- describe Sinclair::MethodDefinition::InstanceStringDefinition do
6
- let(:klass) { Class.new }
7
- let(:instance) { klass.new }
8
-
9
- describe '#build' do
10
- subject(:method_definition) do
11
- described_class.new(method_name, code)
12
- end
13
-
14
- let(:method_name) { :the_method }
15
-
16
- let(:code) { '@x = @x.to_i + 1' }
17
-
18
- it_behaves_like 'MethodDefinition#build without cache'
19
-
20
- context 'with cached options' do
21
- subject(:method_definition) do
22
- described_class.new(method_name, code, cached: cached_option)
23
- end
24
-
25
- it_behaves_like 'MethodDefinition#build with cache options'
26
- end
27
- end
28
- end