nrser 0.2.0.pre.3 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/nrser/ext/enumerable.rb +12 -3
- data/lib/nrser/ext/module.rb +62 -0
- data/lib/nrser/ext.rb +1 -0
- data/lib/nrser/functions/binding.rb +33 -0
- data/lib/nrser/functions/enumerable/associate.rb +103 -0
- data/lib/nrser/functions/enumerable/map_keys.rb +0 -0
- data/lib/nrser/functions/enumerable/map_values.rb +94 -0
- data/lib/nrser/functions/enumerable.rb +2 -87
- data/lib/nrser/functions/module/methods.rb +206 -0
- data/lib/nrser/functions/module/source_locations.rb +213 -0
- data/lib/nrser/functions/module.rb +2 -0
- data/lib/nrser/functions.rb +1 -0
- data/lib/nrser/logging/appender/sync.rb +148 -0
- data/lib/nrser/logging/appender.rb +3 -0
- data/lib/nrser/logging/formatters/color.rb +165 -0
- data/lib/nrser/logging/formatters.rb +1 -0
- data/lib/nrser/logging.rb +353 -0
- data/lib/nrser/refinements/module.rb +5 -0
- data/lib/nrser/refinements.rb +1 -0
- data/lib/nrser/rspex/described.rb +99 -0
- data/lib/nrser/rspex/example_group/describe_called_with.rb +2 -2
- data/lib/nrser/rspex/example_group/describe_class.rb +31 -0
- data/lib/nrser/rspex/example_group/describe_instance.rb +1 -1
- data/lib/nrser/rspex/example_group/describe_method.rb +40 -0
- data/lib/nrser/rspex/example_group.rb +2 -34
- data/lib/nrser/rspex/format.rb +19 -6
- data/lib/nrser/rspex.rb +1 -1
- data/lib/nrser/types/numbers.rb +16 -16
- data/lib/nrser/version.rb +1 -1
- data/lib/nrser.rb +2 -5
- data/spec/design/mapping_spec.rb +42 -0
- data/spec/lib/nrser/mean_streak/identity_instance_spec.rb +7 -5
- data/spec/spec_helper.rb +23 -105
- data/spec/support/shared/types.rb +92 -0
- data/spec/support/shared.rb +1 -0
- metadata +27 -24
- data/lib/nrser/labs/unicode_math.rb +0 -48
- data/lib/nrser/labs/where.rb +0 -50
- data/lib/nrser/logger.rb +0 -457
- data/spec/lib/nrser/logger/dest_spec.rb +0 -15
- data/spec/lib/nrser/logger/die_spec.rb +0 -41
- data/spec/lib/nrser/logger/install_spec.rb +0 -98
- data/spec/lib/nrser/logger/level_int_spec.rb +0 -22
- data/spec/lib/nrser/logger/level_name_spec.rb +0 -23
- data/spec/lib/nrser/logger/level_sym_spec.rb +0 -22
- data/spec/lib/nrser/logger/send_log_spec.rb +0 -63
- data/spec/lib/nrser/logger/use_spec.rb +0 -16
@@ -1,63 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
NRSER::Logger.install MAIN, on: true, say_hi: false
|
4
|
-
|
5
|
-
describe 'NRSER::Logger.send_log' do
|
6
|
-
it "works with blocks that yield msg strings" do
|
7
|
-
expect_to_log {
|
8
|
-
info {
|
9
|
-
"hey!"
|
10
|
-
}
|
11
|
-
}
|
12
|
-
end
|
13
|
-
|
14
|
-
it "works with blocks that yield values hashes" do
|
15
|
-
expect_to_log {
|
16
|
-
info {
|
17
|
-
{x: 'ex', y: 'why?'}
|
18
|
-
}
|
19
|
-
}
|
20
|
-
end
|
21
|
-
|
22
|
-
it "works with blocks that yield msg and values" do
|
23
|
-
expect_to_log {
|
24
|
-
info {
|
25
|
-
["hey!", {x: 'ex', y: 'why'}]
|
26
|
-
}
|
27
|
-
}
|
28
|
-
end
|
29
|
-
|
30
|
-
it "doesn't evaluate blocks unless they're going to be logged" do
|
31
|
-
evaled = false
|
32
|
-
|
33
|
-
expect_to_log {
|
34
|
-
info {
|
35
|
-
evaled = true
|
36
|
-
}
|
37
|
-
}
|
38
|
-
|
39
|
-
expect(evaled).to be true
|
40
|
-
|
41
|
-
evaled = false
|
42
|
-
|
43
|
-
logger.off {
|
44
|
-
expect_to_not_log {
|
45
|
-
info {
|
46
|
-
evaled = true
|
47
|
-
}
|
48
|
-
}
|
49
|
-
}
|
50
|
-
|
51
|
-
expect(evaled).to be false
|
52
|
-
|
53
|
-
logger.with_level :fatal do
|
54
|
-
expect_to_not_log {
|
55
|
-
info {
|
56
|
-
evaled = true
|
57
|
-
}
|
58
|
-
}
|
59
|
-
end
|
60
|
-
|
61
|
-
expect(evaled).to be false
|
62
|
-
end
|
63
|
-
end
|
@@ -1,16 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe 'NRSER::Logger.use' do
|
4
|
-
it "points to the source logger" do
|
5
|
-
module Source
|
6
|
-
NRSER::Logger.install self, on: true, say_hi: false
|
7
|
-
|
8
|
-
module Target
|
9
|
-
NRSER::Logger.use Source, self
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
expect_to_log { Source::Target.send :info, "here" }
|
14
|
-
expect(Source::Target.logger).to be Source.logger
|
15
|
-
end
|
16
|
-
end
|