skeem 0.2.10 → 0.2.11

Sign up to get free protection for your applications and to get access to all the features.
@@ -14,3 +14,27 @@ RSpec.configure do |config|
14
14
  # Display stack trace in case of failure
15
15
  config.full_backtrace = true
16
16
  end
17
+
18
+ module InterpreterSpec
19
+ def expect_expr(aSkeemExpr)
20
+ result = subject.run(aSkeemExpr)
21
+ expect(result)
22
+ end
23
+
24
+ # This method assumes that 'subject' is a Skeem::Interpreter instance.
25
+ def compare_to_predicted(arrActualsPredictions)
26
+ arrActualsPredictions.each_with_index do |(source, predicted), index|
27
+ begin
28
+ result = subject.run(source)
29
+ if block_given?
30
+ yield result, predicted
31
+ else
32
+ expect(result).to eq(predicted)
33
+ end
34
+ rescue Exception => exc
35
+ $stderr.puts "Row #{index + 1} failed."
36
+ throw exc
37
+ end
38
+ end
39
+ end
40
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: skeem
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.10
4
+ version: 0.2.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dimitri Geshef
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-06-15 00:00:00.000000000 Z
11
+ date: 2019-06-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rley