magicka 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/magicka.rb +1 -0
- data/lib/magicka/button.rb +9 -0
- data/lib/magicka/version.rb +1 -1
- data/spec/lib/magicka/button_spec.rb +54 -0
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7939778de2faac419e42a17986de873d7cbefa0b65531dcc968f697411e0ee7a
|
4
|
+
data.tar.gz: 831909938f84d296ba8706893b13c5ef7bf9f5b16e2d57cb10986e83151a2ed3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 74b61fb09691f38d280b08adde917d838866b918f23d4b9a530bf0f43cd22d8c963980bd5e02de23b89e601bbb708fd374da6e5285e7507d33e1b319fe9937a7
|
7
|
+
data.tar.gz: 8a263ca1eb2a0fc180e4fdc9eff054aede6452e19819d788b1e6c3f203875104ea177c1f2b8d38b14d5909d506528fb2a621fcdb4aafe9ab7ff49513bac3509e
|
data/README.md
CHANGED
@@ -11,7 +11,7 @@ Magicka
|
|
11
11
|
|
12
12
|
Yard Documentation
|
13
13
|
-------------------
|
14
|
-
[https://www.rubydoc.info/gems/magicka/0.3.
|
14
|
+
[https://www.rubydoc.info/gems/magicka/0.3.1](https://www.rubydoc.info/gems/magicka/0.3.1)
|
15
15
|
|
16
16
|
Installation
|
17
17
|
---------------
|
data/lib/magicka.rb
CHANGED
@@ -11,6 +11,7 @@ require 'sinclair'
|
|
11
11
|
# module holding herlper to render inputs
|
12
12
|
module Magicka
|
13
13
|
autoload :VERSION, 'magicka/version'
|
14
|
+
autoload :Button, 'magicka/button'
|
14
15
|
autoload :Element, 'magicka/element'
|
15
16
|
autoload :FormElement, 'magicka/form_element'
|
16
17
|
autoload :Input, 'magicka/input'
|
data/lib/magicka/version.rb
CHANGED
@@ -0,0 +1,54 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
describe Magicka::Button do
|
6
|
+
let(:renderer) { instance_double('renderer') }
|
7
|
+
let(:template) { 'templates/forms/button' }
|
8
|
+
|
9
|
+
let(:ng_click) { 'controler.click()' }
|
10
|
+
let(:ng_disabled) { 'false' }
|
11
|
+
let(:classes) { 'custom class' }
|
12
|
+
let(:text) { 'Click' }
|
13
|
+
|
14
|
+
let(:locals) do
|
15
|
+
{
|
16
|
+
ng_click: ng_click,
|
17
|
+
ng_disabled: ng_disabled,
|
18
|
+
classes: classes,
|
19
|
+
text: text
|
20
|
+
}
|
21
|
+
end
|
22
|
+
|
23
|
+
describe '.render' do
|
24
|
+
let(:arguments) do
|
25
|
+
{
|
26
|
+
renderer: renderer,
|
27
|
+
ng_click: ng_click,
|
28
|
+
ng_disabled: ng_disabled,
|
29
|
+
classes: classes,
|
30
|
+
text: text
|
31
|
+
}
|
32
|
+
end
|
33
|
+
|
34
|
+
before do
|
35
|
+
allow(renderer)
|
36
|
+
.to receive(:render)
|
37
|
+
.with(partial: template, locals: locals)
|
38
|
+
end
|
39
|
+
|
40
|
+
it do
|
41
|
+
described_class.render(arguments)
|
42
|
+
|
43
|
+
expect(renderer).to have_received(:render)
|
44
|
+
end
|
45
|
+
|
46
|
+
context 'when called with extra params' do
|
47
|
+
it do
|
48
|
+
described_class.render(name: 'Name', **arguments)
|
49
|
+
|
50
|
+
expect(renderer).to have_received(:render)
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: magicka
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- DarthJee
|
@@ -397,6 +397,7 @@ files:
|
|
397
397
|
- config/yardstick.yml
|
398
398
|
- docker-compose.yml
|
399
399
|
- lib/magicka.rb
|
400
|
+
- lib/magicka/button.rb
|
400
401
|
- lib/magicka/element.rb
|
401
402
|
- lib/magicka/element/class_methods.rb
|
402
403
|
- lib/magicka/form_element.rb
|
@@ -467,6 +468,7 @@ files:
|
|
467
468
|
- spec/dummy/storage/.keep
|
468
469
|
- spec/integration/readme/.keep
|
469
470
|
- spec/integration/yard/.keep
|
471
|
+
- spec/lib/magicka/button_spec.rb
|
470
472
|
- spec/lib/magicka/element/class_methods_spec.rb
|
471
473
|
- spec/lib/magicka/element_spec.rb
|
472
474
|
- spec/lib/magicka/form_element_spec.rb
|