microscope 0.5.6.1 → 0.5.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +8 -0
- data/lib/microscope/instance_method/boolean_instance_method.rb +6 -0
- data/lib/microscope/instance_method/date_instance_method.rb +6 -0
- data/lib/microscope/instance_method/datetime_instance_method.rb +6 -0
- data/lib/microscope/version.rb +1 -1
- data/spec/microscope/instance_method/boolean_instance_method_spec.rb +6 -0
- data/spec/microscope/instance_method/date_instance_method_spec.rb +8 -0
- data/spec/microscope/instance_method/datetime_instance_method_spec.rb +8 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 42926873b4c35009b176d9ee2bf2928bddf7ef35
|
4
|
+
data.tar.gz: d3b1659915412d6429b51565a5665e52f7b8eed3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 729e7481c9b34ec14105f8a1128a8ab925fb677e6388940ba43c9ba264f76d289b20404e7ec332a894a8dcb0bfab1d6c8fa394441e4b24072ee9bd20ba45ce9d
|
7
|
+
data.tar.gz: 20203298794289b9ccc8abd500bd8f719d5b60448c288c4572571238ff29611d6fb1302099dce1cd8340a0718c60233fc574d47e18916b0aca9afde3b4e2776c
|
data/.travis.yml
CHANGED
@@ -18,3 +18,11 @@ before_script:
|
|
18
18
|
- psql -c 'create database microscope_test;' -U postgres
|
19
19
|
|
20
20
|
script: "echo 'DO IT' && bundle exec rake spec"
|
21
|
+
|
22
|
+
notifications:
|
23
|
+
hipchat:
|
24
|
+
rooms:
|
25
|
+
secure: cJWiEh3XNWrEkoeaZd5Kyx3igwOJto+B8jPiyr38Kfv8Z2WLINkHbMQXcd37/tIubX6w9VWjWJ2TuX5cK2H07EraPDDYAHJlnoR/WIPoYwQoXGUWqGH26O2LdBiLs9JcBQ9rKT8K8wmQuxf2rTpY7lN2RoKMjjEjcleWJwQG/3w=
|
26
|
+
template:
|
27
|
+
- '%{repository}#%{build_number} (%{branch} - %{commit} : %{author}): %{message} (<a href="%{build_url}">Build</a>/<a href="%{compare_url}">Changes</a>)'
|
28
|
+
format: 'html'
|
@@ -36,6 +36,12 @@ module Microscope
|
|
36
36
|
send("#{field.name}=", #{@now})
|
37
37
|
save!
|
38
38
|
end
|
39
|
+
|
40
|
+
define_method "not_#{infinitive_verb}!" do
|
41
|
+
send("#{field.name}=", nil)
|
42
|
+
save!
|
43
|
+
end
|
44
|
+
alias_method 'un#{infinitive_verb}!', 'not_#{infinitive_verb}!'
|
39
45
|
RUBY
|
40
46
|
end
|
41
47
|
end
|
@@ -36,6 +36,12 @@ module Microscope
|
|
36
36
|
send("#{field.name}=", #{@now})
|
37
37
|
save!
|
38
38
|
end
|
39
|
+
|
40
|
+
define_method "not_#{infinitive_verb}!" do
|
41
|
+
send("#{field.name}=", nil)
|
42
|
+
save!
|
43
|
+
end
|
44
|
+
alias_method 'un#{infinitive_verb}!', 'not_#{infinitive_verb}!'
|
39
45
|
RUBY
|
40
46
|
end
|
41
47
|
end
|
data/lib/microscope/version.rb
CHANGED
@@ -15,4 +15,10 @@ describe Microscope::InstanceMethod::BooleanInstanceMethod do
|
|
15
15
|
let(:animal) { Animal.create(fed: false) }
|
16
16
|
it { expect { animal.feed! }.to change { animal.reload.fed? }.from(false).to(true) }
|
17
17
|
end
|
18
|
+
|
19
|
+
describe '#not_feed!' do
|
20
|
+
let(:animal) { Animal.create(fed: true) }
|
21
|
+
it { expect { animal.not_feed! }.to change { animal.reload.fed? }.from(true).to(false) }
|
22
|
+
it { expect(animal).to respond_to(:unfeed!) }
|
23
|
+
end
|
18
24
|
end
|
@@ -79,4 +79,12 @@ describe Microscope::InstanceMethod::DateInstanceMethod do
|
|
79
79
|
let(:event) { Event.create(started_on: nil) }
|
80
80
|
it { expect { event.start! }.to change { event.reload.started_on }.from(nil).to(stubbed_date) }
|
81
81
|
end
|
82
|
+
|
83
|
+
describe '#start!' do
|
84
|
+
let(:stubbed_date) { Date.parse('2020-03-18 08:00:00') }
|
85
|
+
|
86
|
+
let(:event) { Event.create(started_on: stubbed_date) }
|
87
|
+
it { expect { event.not_start! }.to change { event.reload.started_on }.from(stubbed_date).to(nil) }
|
88
|
+
it { expect(event).to respond_to(:unstart!) }
|
89
|
+
end
|
82
90
|
end
|
@@ -67,6 +67,13 @@ describe Microscope::InstanceMethod::DatetimeInstanceMethod do
|
|
67
67
|
|
68
68
|
let(:event) { Event.create(started_at: nil) }
|
69
69
|
it { expect { event.start! }.to change { event.reload.started_at }.from(nil).to(stubbed_date) }
|
70
|
-
|
70
|
+
end
|
71
|
+
|
72
|
+
describe '#not_start!' do
|
73
|
+
let(:stubbed_date) { Time.parse('2020-03-18 08:00:00') }
|
74
|
+
|
75
|
+
let(:event) { Event.create(started_at: stubbed_date) }
|
76
|
+
it { expect { event.not_start! }.to change { event.reload.started_at }.from(stubbed_date).to(nil) }
|
77
|
+
it { expect(event).to respond_to(:unstart!) }
|
71
78
|
end
|
72
79
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: microscope
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Simon Prévost
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-02-
|
12
|
+
date: 2014-02-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|