cspec 0.2.1 → 0.2.2

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
  SHA256:
3
- metadata.gz: 8614fd567ad97eaea1795b6784a114231372e2a06958ed27ab8159b1826df43d
4
- data.tar.gz: 8232cd508d0bb084224329b08fdbe9fe036887a293a5441576c0c9abf9481b9c
3
+ metadata.gz: d04fe4315cc0239fbba40d3b9161a2a611ba9e5199530020dd3111904969a063
4
+ data.tar.gz: f79b42125b163718b31b525c7dbaab2358e774b46ab4ac40f1bf82fe575ee252
5
5
  SHA512:
6
- metadata.gz: 831a347acc12b8ac8a5f81af9f426f3bd6a9730818406c5303bb41b2e67b3b21e6354112dd361eae91917db677be0a1499b355b33e1627bab70da13b38bc8887
7
- data.tar.gz: 10132f08dd3fe64a7f14406adcecee1c3374e5988f94562387ceec35aa7043877c8713761900e2e9a4acb7c87f3aefb0f255282a13406c530478eebbb0511252
6
+ metadata.gz: 3427855f23bc9f089a938454ec8c21c2220f6ea27fbcce4707930fa2c40674cf5df7a1277dc7ed574687bbe7d70b53d8b05a732236c85581b2077dd8e9fbc785
7
+ data.tar.gz: 5e50f436086bf34ad3e0de488e231f87ec2fe07b8cb8f8eaa79c89b28a3333b4f74afbe0dcd6cf034b593d8907f9b24d58086db37341e8bc6b6023b343e04c8d
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cspec (0.2.0)
4
+ cspec (0.2.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/cspec.gemspec CHANGED
@@ -7,7 +7,7 @@ require 'cspec/version'
7
7
  Gem::Specification.new do |spec|
8
8
  spec.required_ruby_version = '>= 2.5.0'
9
9
  spec.name = 'cspec'
10
- spec.version = Cspec::VERSION
10
+ spec.version = CSpec::VERSION
11
11
  spec.authors = ['Jarrod Folino']
12
12
  spec.email = ['jarrod.folino@coderacademy.edu.au']
13
13
 
@@ -1,7 +1,7 @@
1
1
  GEM
2
2
  remote: https://rubygems.org/
3
3
  specs:
4
- cspec (0.2.0)
4
+ cspec (0.2.1)
5
5
 
6
6
  PLATFORMS
7
7
  ruby
@@ -8,6 +8,26 @@ class MyClass
8
8
  end
9
9
  end
10
10
 
11
+ class Util
12
+ def build_array(val1, val2, val3)
13
+ [val1, val2, val3]
14
+ end
15
+
16
+ def sum_array(array)
17
+ array.sum
18
+ end
19
+ end
20
+
21
+ class Calculator
22
+ def self.add(val1, val2)
23
+ val1 + val2
24
+ end
25
+
26
+ def self.multi_subtract(val1, val2, val3)
27
+ val1 - val2 - val3
28
+ end
29
+ end
30
+
11
31
  result = CSpec::Runner.run!("#{Dir.pwd}/specs.csv")
12
32
  puts "Success: #{result}"
13
33
  exit result ? 0 : 1
@@ -1,2 +1,6 @@
1
- class,name,type,method,method_arg_1,method_arg_2,expected
2
- MyClass,my test,instance,greet,Bob,Jones,"Hello, Bob Jones"
1
+ class,name,type,method,method_arg_1,method_arg_2,method_arg_3,expected
2
+ MyClass,my test,instance,greet,Bob,Jones,,"Hello, Bob Jones"
3
+ Calculator,another test,class,add,1,2,,3
4
+ Calculator,another test,class,multi_subtract,6,2,1,3
5
+ Util,another test,instance,build_array,6,2,1,"[6, 2, 1]"
6
+ Util,another test,instance,sum_array,"[6, 2, 1]",,,9
@@ -1,7 +1,7 @@
1
1
  GEM
2
2
  remote: https://rubygems.org/
3
3
  specs:
4
- cspec (0.2.0)
4
+ cspec (0.2.1)
5
5
 
6
6
  PLATFORMS
7
7
  ruby
@@ -6,6 +6,10 @@ class MyClass
6
6
  def hello
7
7
  'world'
8
8
  end
9
+
10
+ def hello2(param1)
11
+ "world2#{param1}"
12
+ end
9
13
  end
10
14
 
11
15
  result = CSpec::Runner.run!("#{Dir.pwd}/specs.csv")
@@ -1,2 +1,12 @@
1
- class,name,type,method,expected
2
- MyClass,my test,instance,hello,world
1
+ class,name,type,method,method_arg_1,expected
2
+ MyClass,my test,instance,hello2,aaa,world2aaa
3
+ MyClass,my test,instance,hello,,world
4
+ MyClass,my test,instance,hello2,aaa,world2aaa
5
+ MyClass,my test,instance,hello,,world
6
+ MyClass,my test,instance,hello2,aaa,world2aaa
7
+ MyClass,my test,instance,hello,,world
8
+ MyClass,my test,instance,hello2,aaa,world2aaa
9
+ MyClass,my test,instance,hello,,world
10
+ MyClass,my test,instance,hello2,aaa,world2aaa
11
+ MyClass,my test,instance,hello,,world
12
+
@@ -1,7 +1,7 @@
1
1
  GEM
2
2
  remote: https://rubygems.org/
3
3
  specs:
4
- cspec (0.2.0)
4
+ cspec (0.2.1)
5
5
 
6
6
  PLATFORMS
7
7
  ruby
@@ -1,7 +1,7 @@
1
1
  GEM
2
2
  remote: https://rubygems.org/
3
3
  specs:
4
- cspec (0.2.0)
4
+ cspec (0.2.1)
5
5
 
6
6
  PLATFORMS
7
7
  ruby
data/lib/cspec/loader.rb CHANGED
@@ -18,7 +18,7 @@ module CSpec
18
18
  def self.process_arg(spec, regex, aggregate_key)
19
19
  spec.merge({
20
20
  aggregate_key => spec.keys
21
- .select { |k| k.match?(regex) && spec[k] != nil }
21
+ .select { |k| k.match?(regex) && !spec[k].nil? }
22
22
  .inject([]) { |values, key| values << spec[key] }
23
23
  })
24
24
  end
data/lib/cspec/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module Cspec
4
- VERSION = '0.2.1'
3
+ module CSpec
4
+ VERSION = '0.2.2'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jarrod Folino
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-03-06 00:00:00.000000000 Z
11
+ date: 2022-03-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler