sinclair 1.4.2 → 1.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +4 -1
- data/Dockerfile +3 -3
- data/README.md +1 -1
- data/config/check_specs.yml +5 -0
- data/config/yardstick.yml +3 -0
- data/lib/sinclair.rb +26 -9
- data/lib/sinclair/config/methods_builder.rb +3 -1
- data/lib/sinclair/config_factory.rb +4 -2
- data/lib/sinclair/matchers/add_class_method_to.rb +1 -0
- data/lib/sinclair/method_builder.rb +61 -0
- data/lib/sinclair/method_builder/base.rb +67 -0
- data/lib/sinclair/method_builder/block_method_builder.rb +34 -0
- data/lib/sinclair/method_builder/string_method_builder.rb +50 -0
- data/lib/sinclair/method_definition.rb +38 -17
- data/lib/sinclair/method_definition/block_definition.rb +8 -94
- data/lib/sinclair/method_definition/block_helper.rb +46 -0
- data/lib/sinclair/method_definition/string_definition.rb +7 -66
- data/lib/sinclair/method_definitions.rb +16 -4
- data/lib/sinclair/version.rb +1 -1
- data/sinclair.gemspec +1 -1
- data/spec/lib/sinclair/method_builder/block_method_builder_spec.rb +55 -0
- data/spec/lib/sinclair/method_builder/string_method_builder_spec.rb +54 -0
- data/spec/lib/sinclair/method_builder_spec.rb +53 -0
- data/spec/lib/sinclair/method_definition/block_definition_spec.rb +66 -0
- data/spec/lib/sinclair/method_definition/block_helper_spec.rb +111 -0
- data/spec/lib/sinclair/method_definition/string_definition_spec.rb +70 -0
- data/spec/lib/sinclair/method_definition_spec.rb +23 -88
- data/spec/lib/sinclair/method_definitions_spec.rb +45 -0
- data/spec/support/models/random_generator.rb +13 -0
- metadata +18 -20
- data/lib/sinclair/method_definition/class_block_definition.rb +0 -22
- data/lib/sinclair/method_definition/class_method_definition.rb +0 -50
- data/lib/sinclair/method_definition/class_string_definition.rb +0 -24
- data/lib/sinclair/method_definition/instance_block_definition.rb +0 -22
- data/lib/sinclair/method_definition/instance_method_definition.rb +0 -48
- data/lib/sinclair/method_definition/instance_string_definition.rb +0 -24
- data/spec/integration/yard/sinclair/method_definition/class_block_definition_spec.rb +0 -34
- data/spec/integration/yard/sinclair/method_definition/class_method_definition_spec.rb +0 -28
- data/spec/integration/yard/sinclair/method_definition/class_string_definition_spec.rb +0 -23
- data/spec/integration/yard/sinclair/method_definition/instance_block_definition_spec.rb +0 -25
- data/spec/integration/yard/sinclair/method_definition/instance_method_definition_spec.rb +0 -35
- data/spec/integration/yard/sinclair/method_definition/instance_string_definition_spec.rb +0 -32
- data/spec/lib/sinclair/method_definition/class_block_definition_spec.rb +0 -29
- data/spec/lib/sinclair/method_definition/class_string_definition_spec.rb +0 -27
- data/spec/lib/sinclair/method_definition/instance_block_definition_spec.rb +0 -30
- 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
|