simple_operation 0.0.1 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/simple_operation/version.rb +1 -1
- data/lib/simple_operation.rb +6 -1
- data/test/simple_operation_test.rb +10 -0
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8c4801ae0b98ab5ac7a4ea15b7180ffc7c4d23e9
|
|
4
|
+
data.tar.gz: 3d49d85d3cea0a6943606fd0ae79823d3d86bf1b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c77629e1a454236c6a969243dcf0632f4eeb4310a3d7747aca30deb5decaca380799204e87dffb0d32db06bb8277df2611ffe3c158bf5b6441fdeb1c40e06ed9
|
|
7
|
+
data.tar.gz: 038f3b90e5ebbf4eff70f4eb586676bc6eceaba47cde7f8dc3a6a8ba3a8680bf3898eb97a7630176b6af010db16d4956a851784e2b5a61afff62ae0b06d61206
|
data/lib/simple_operation.rb
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
require "simple_operation/version"
|
|
2
2
|
|
|
3
3
|
class SimpleOperation
|
|
4
4
|
|
|
@@ -14,8 +14,13 @@ class SimpleOperation
|
|
|
14
14
|
#{args.map { |arg| "@#{arg}= #{arg}" }.join(';') }
|
|
15
15
|
end
|
|
16
16
|
|
|
17
|
+
def perform
|
|
18
|
+
call
|
|
19
|
+
end
|
|
20
|
+
|
|
17
21
|
private
|
|
18
22
|
#{args.map { |arg| "attr_reader :#{arg}" }.join(';') }
|
|
23
|
+
|
|
19
24
|
code
|
|
20
25
|
end
|
|
21
26
|
end
|
|
@@ -28,6 +28,16 @@ class SimpleOperationTest < Minitest::Test
|
|
|
28
28
|
assert object.respond_to?(:call)
|
|
29
29
|
end
|
|
30
30
|
|
|
31
|
+
def test_instance_call_runs_correctly
|
|
32
|
+
assert klass.new('Arnvald').()
|
|
33
|
+
refute klass.new('Grzegorz').()
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
def test_perform_aliases_to_call
|
|
37
|
+
assert klass.new('Arnvald').perform
|
|
38
|
+
refute klass.new('Grzegorz').perform
|
|
39
|
+
end
|
|
40
|
+
|
|
31
41
|
def test_class_has_call_method
|
|
32
42
|
assert klass.respond_to?(:call)
|
|
33
43
|
end
|