pro1-tester 0.1.2 → 0.1.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 81b7bdfbf3d4cd3b4025f7859e19630be068d32a
4
- data.tar.gz: cae01b4f167d3e25c5ec47f3c70c8d7a0bf2cc71
3
+ metadata.gz: 9ac490e5295c57858df547236166c4bd28e7f040
4
+ data.tar.gz: 6c97ef67a732103f8bc807862702d226cd959aae
5
5
  SHA512:
6
- metadata.gz: 10f74e80882971f68c9052302b0dcf856b52bebf69f3cb6ec131cc5141396b9e65d6e368677a050f8d1fd6193b9e789203be595062d8e8a9e624ab157ff231fd
7
- data.tar.gz: aec16bf4de324f3c616265c91ee9d0ede976704583a20cb106f6b8878254338f2a345f87033aff45d42606871fca60f969bd1c3192b7094230243241e35f5354
6
+ metadata.gz: 92e7889b9cea74bc90f25fc1884022e6fe86891e0c3e28367ab322000123e2bd1eb0932c697dcde23b58111517117261ab61ce45858d667895820187b2628d12
7
+ data.tar.gz: f034e190996f367e8261961f8e582d02c4fa5e8d8c5b70362dc12da7808e0b22d9d604425b880676f72cbd48d3fb8dee0bf2013cc981c92a6077295f81097b36
data/bin/pro1-tester CHANGED
@@ -13,7 +13,10 @@ module Pro1Tester
13
13
  exit
14
14
  end
15
15
  opt.on('-d', "Use default testcase. (testcase.default.yml)") do
16
- ENV.store(ENV_KEY,File.join(DIR_PWD, "testcase.default.yml"))
16
+ ENV.store(ENV_KEY_TESTCASE,File.join(DIR_PWD, "testcase.default.yml"))
17
+ end
18
+ opt.on('-s', "Use strict mode. (compare result including LF and spaces)") do
19
+ ENV.store(ENV_KEY_STRICT_MODE,"on")
17
20
  end
18
21
  opt.parse!(ARGV)
19
22
  end
data/lib/core.rb CHANGED
@@ -19,7 +19,7 @@ end
19
19
 
20
20
  module Pro1Tester
21
21
  load_path = []
22
- load_path << ENV[ENV_KEY]
22
+ load_path << ENV[ENV_KEY_TESTCASE]
23
23
  load_path << File.join(DIR_PWD, "testcase.yml")
24
24
  load_path << File.join(DIR_PWD, "testcase.default.yml")
25
25
  yml_path = load_path.compact.select do |lp|
@@ -82,12 +82,20 @@ module Pro1Tester
82
82
  # remove space just in front of LF
83
83
  # remove the last LF if exist
84
84
  result = testcase["result"]
85
- result.gsub!(/\s+\n/, "\n")
86
- result.gsub!(/\n$/, "")
87
-
88
85
  expectation = testcase["expect"]
89
- expectation.gsub!(/\s+\n/, "\n")
90
- expectation.gsub!(/\n$/, "")
86
+
87
+ unless ENV[ENV_KEY_STRICT_MODE] == "on"
88
+ # result.gsub!(/\s+\n/, "\n")
89
+ # result.gsub!(/\n$/, "")
90
+ #
91
+ # expectation.gsub!(/\s+\n/, "\n")
92
+ # expectation.gsub!(/\n$/, "")
93
+ result.gsub!(/\s/, "")
94
+ result.gsub!(/\n/, "")
95
+
96
+ expectation.gsub!(/\s/, "")
97
+ expectation.gsub!(/\n/, "")
98
+ end
91
99
 
92
100
  expect(result).to eq expectation
93
101
  end
@@ -1,3 +1,3 @@
1
1
  module Pro1Tester
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
data/lib/pro1_tester.rb CHANGED
@@ -8,7 +8,8 @@ module Pro1Tester
8
8
  DIST_DIR = "tmp"
9
9
  DIR_BASE = File.expand_path(File.dirname(__FILE__))
10
10
  DIR_PWD = Dir.pwd
11
- ENV_KEY = "PRO1_TESTER_TESTCASE"
11
+ ENV_KEY_TESTCASE = "PRO1_TESTER_TESTCASE"
12
+ ENV_KEY_STRICT_MODE = "PRO1_TESTER_STRICT_MODE"
12
13
 
13
14
  class << self
14
15
  def run
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pro1-tester
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kumassy