cspec 0.2.7 → 0.2.8

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: 37f5f6e0df55477bdae0f6536656d20887381940916f820469ac28f6743146f8
4
- data.tar.gz: 7e0de0d51f8af19e40290f8e6fdf7ace494c7ea8f0c1151df13415ee22a52b96
3
+ metadata.gz: d77748862bc561faec18dbdf8fe81e4d36a3aba73c8f407727227c1ff425225b
4
+ data.tar.gz: 6469311b41f6791ca6ef1d8f624a28e527fce93e4f5e6ed14ffefe95fb5164de
5
5
  SHA512:
6
- metadata.gz: e18e98d574800854437069aa7676f5404e90ef43f6f32958010b47f000b2480d6b90edea9058041ae4417a4569b3bc2eaa313cd14bf069dc8ef7ed26bc23daa8
7
- data.tar.gz: 14aa6812e2872eae093e3ca5107cb5d09515bddbee07162e51d4d69a9f79f19bcc8274dee4aa617fb73065e7aeb6d9d60392b90d6c4a17c22e494235859ae03e
6
+ metadata.gz: 9af5fb2b70cece31594e123af832aca72ee88cc145b7df360e5df9727caef9651322c050f3a625341b0f9a11a5cc318f44477991f4ed81d4026c494367a215d4
7
+ data.tar.gz: e05c4831dc228f6a5c28780690407d14265400e8d6d088027e1e28a4d2f92ada599f70762ef19afcbb15439f507860680334295a44fdd737427744d3eb81d815
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cspec (0.2.6)
4
+ cspec (0.2.8)
5
5
  colorize (~> 0.8.1)
6
6
 
7
7
  GEM
data/bin/cspec ADDED
@@ -0,0 +1,30 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require 'bundler/setup'
5
+ require 'fileutils'
6
+ require 'cspec'
7
+
8
+ USAGE = "\n Usage:\n\n cspec template list\n cspec generate <template name>\n"
9
+
10
+ command = ARGV[0]
11
+ sub_command = ARGV[1]
12
+
13
+ case command
14
+ when 'template'
15
+ if sub_command == 'list'
16
+ dir = File.join(CSpec.root, 'examples')
17
+ Dir.chdir(dir)
18
+ result = Dir.glob('*').select do |f|
19
+ File.directory?(f)
20
+ end
21
+ puts result
22
+ end
23
+ when 'generate'
24
+ puts "Generating from template: #{sub_command}"
25
+ example_dir = File.join(CSpec.root, 'examples', sub_command)
26
+ FileUtils.cp_r(example_dir, '.')
27
+ puts "cd into the #{sub_command} directory"
28
+ else
29
+ puts USAGE
30
+ end
data/cspec.gemspec CHANGED
@@ -34,8 +34,9 @@ Gem::Specification.new do |spec|
34
34
  spec.files = Dir.chdir(File.expand_path(__dir__)) do
35
35
  `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
36
36
  end
37
- spec.bindir = 'exe'
38
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
37
+ spec.bindir = 'bin'
38
+ # spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
39
+ spec.executables << 'cspec'
39
40
  spec.require_paths = ['lib']
40
41
 
41
42
  spec.add_dependency 'colorize', '~> 0.8.1'
@@ -2,7 +2,7 @@ GEM
2
2
  remote: https://rubygems.org/
3
3
  specs:
4
4
  colorize (0.8.1)
5
- cspec (0.2.6)
5
+ cspec (0.2.7)
6
6
  colorize (~> 0.8.1)
7
7
 
8
8
  PLATFORMS
@@ -3,4 +3,4 @@ MyClass,my test,instance,greet,Bob,Jones,,"Hello, Bob Jones"
3
3
  Calculator,another test,class,add,1,2,,3
4
4
  Calculator,another test,class,multi_subtract,6,2,1,3
5
5
  Util,another test,instance,build_array,6,2,1,"[6, 2, 1]"
6
- Util,another test,instance,sum_array,"[6, 2, 1]",,,91
6
+ Util,another test,instance,sum_array,"[6, 2, 1]",,,9
@@ -2,7 +2,7 @@ GEM
2
2
  remote: https://rubygems.org/
3
3
  specs:
4
4
  colorize (0.8.1)
5
- cspec (0.2.6)
5
+ cspec (0.2.7)
6
6
  colorize (~> 0.8.1)
7
7
 
8
8
  PLATFORMS
@@ -2,7 +2,7 @@ GEM
2
2
  remote: https://rubygems.org/
3
3
  specs:
4
4
  colorize (0.8.1)
5
- cspec (0.2.6)
5
+ cspec (0.2.7)
6
6
  colorize (~> 0.8.1)
7
7
 
8
8
  PLATFORMS
@@ -2,7 +2,7 @@ GEM
2
2
  remote: https://rubygems.org/
3
3
  specs:
4
4
  colorize (0.8.1)
5
- cspec (0.2.6)
5
+ cspec (0.2.7)
6
6
  colorize (~> 0.8.1)
7
7
 
8
8
  PLATFORMS
@@ -3,7 +3,7 @@
3
3
  module CSpec
4
4
  module ResultsOutputter
5
5
  def self.display(results)
6
- results.filter { |r| !r.error.nil? }.map(&:to_s).join("\n")
6
+ results.reject { |r| r.error.nil? }.map(&:to_s).join("\n")
7
7
  end
8
8
  end
9
9
  end
data/lib/cspec/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CSpec
4
- VERSION = '0.2.7'
4
+ VERSION = '0.2.8'
5
5
  end
data/lib/cspec.rb CHANGED
@@ -12,4 +12,7 @@ require 'cspec/results_outputter'
12
12
  require 'csv'
13
13
 
14
14
  module CSpec
15
+ def self.root
16
+ File.dirname __dir__
17
+ end
15
18
  end
@@ -0,0 +1,10 @@
1
+ bundle update
2
+ WORK_DIR=`pwd`
3
+ cd "$WORK_DIR/examples/advance"
4
+ bundle update
5
+ cd "$WORK_DIR/examples/basic"
6
+ bundle update
7
+ cd "$WORK_DIR/examples/class_methods"
8
+ bundle update
9
+ cd "$WORK_DIR/examples/method_args"
10
+ bundle update
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.7
4
+ version: 0.2.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jarrod Folino
8
8
  autorequire:
9
- bindir: exe
9
+ bindir: bin
10
10
  cert_chain: []
11
- date: 2022-03-16 00:00:00.000000000 Z
11
+ date: 2022-03-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colorize
@@ -97,7 +97,8 @@ dependencies:
97
97
  description: A testing framework to run unit tests via csv
98
98
  email:
99
99
  - jarrod.folino@coderacademy.edu.au
100
- executables: []
100
+ executables:
101
+ - cspec
101
102
  extensions: []
102
103
  extra_rdoc_files: []
103
104
  files:
@@ -113,6 +114,7 @@ files:
113
114
  - README.md
114
115
  - Rakefile
115
116
  - bin/console
117
+ - bin/cspec
116
118
  - bin/setup
117
119
  - cspec.gemspec
118
120
  - examples/advance/Gemfile
@@ -141,6 +143,7 @@ files:
141
143
  - lib/cspec/spec.rb
142
144
  - lib/cspec/validator.rb
143
145
  - lib/cspec/version.rb
146
+ - update_examples.sh
144
147
  homepage: https://github.com/jarroddalefolino/cspec
145
148
  licenses:
146
149
  - MIT