brutal 1.1.1 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 98d43784db59dbf4d8263ec4730d302832e7e5edc46ebafc1a13d95935e9b697
4
- data.tar.gz: e2d37b31d5b37387437e6ac80afb11b5b1a6d104cb677629ec3aafa9aae153af
3
+ metadata.gz: 7a7eb1b01e30dda0f5b204eef32ac2ec59c19384b37500f40587a1a522fce6db
4
+ data.tar.gz: be19e4c8f4741658ef2aea98891b8bf040a250361fe48fee5219b02cc297b10f
5
5
  SHA512:
6
- metadata.gz: d3af04c68e89e7bdd965163066db2b99a4e3df78846ea6f33a0a89b9fe443e477376a6108a31c8b69d86d45f04459991d503f56c345b5089b7233a22b0d831bd
7
- data.tar.gz: 55e326bf5cdcba338c63d7e57a8f75378f9869fe0f986867a86ece479850dd78745a2a568c3e0b89c8080f343e977b17d42b714e80dbbe3543b980204fd67c4d
6
+ metadata.gz: 565a5d6628dd7f3904f97343da33539eaddf97c6fa020d2c14736ed84a146c3fe3d0aa7eb6fdfc73a94a3238be3bba40d892f07281d231918022b2c96fb95ce6
7
+ data.tar.gz: 245f56b40a04d626c653e679b3634a5e1f3805a4f356c6f009759cb9e350e675b89e17e699e430fac5ffcb596e83c19190b929b4086b1da42254f2ffdbc7ea60
data/LICENSE.md CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2020 Cyril Kato
3
+ Copyright (c) 2020-2021 Cyril Kato
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -1,16 +1,16 @@
1
1
  # Brutal 💎🔨
2
2
 
3
3
  [![RuboCop Status](https://github.com/fixrb/brutal/workflows/RuboCop/badge.svg)][workflow_rubocop]
4
- [![Build Status](https://api.travis-ci.org/fixrb/brutal.svg?branch=master)][travis]
4
+ [![Build Status](https://api.travis-ci.org/fixrb/brutal.svg?branch=main)][travis]
5
5
  [![Gem Version](https://badge.fury.io/rb/brutal.svg)][gem]
6
- [![Inline docs](https://inch-ci.org/github/fixrb/brutal.svg?branch=master)][inchpages]
6
+ [![Inline docs](https://inch-ci.org/github/fixrb/brutal.svg?branch=main)][inchpages]
7
7
  [![Documentation](http://img.shields.io/:yard-docs-38c800.svg)][rubydoc]
8
8
 
9
9
  > A _code-first_ approach to automate the writing of unit tests.
10
10
 
11
11
  ## Intro
12
12
 
13
- [![I Hate Tests](https://github.com/fixrb/brutal/raw/master/img/rubyhack-2019-ruby3-what-s-missing-by-yukihiro-matsumoto.jpg)](https://www.youtube.com/embed/cmOt9HhszCI?start=1732&end=1736 "I don't like tests. It's not DRY.")
13
+ [![I Hate Tests](https://github.com/fixrb/brutal/raw/main/img/rubyhack-2019-ruby3-what-s-missing-by-yukihiro-matsumoto.jpg)](https://www.youtube.com/embed/cmOt9HhszCI?start=1732&end=1736 "I don't like tests. It's not DRY.")
14
14
 
15
15
  > I don't like tests. It's not DRY.<br/>
16
16
  > -- [Matz](https://github.com/matz)
@@ -38,7 +38,7 @@ This is the price for _Brutal-Driven Development_.
38
38
  Add this line to your application's Gemfile:
39
39
 
40
40
  ```ruby
41
- gem 'brutal'
41
+ gem "brutal"
42
42
  ```
43
43
 
44
44
  And then execute:
@@ -111,7 +111,7 @@ raise if actual.length != 9
111
111
 
112
112
  ### More examples
113
113
 
114
- https://github.com/fixrb/brutal/raw/master/examples/
114
+ https://github.com/fixrb/brutal/raw/main/examples/
115
115
 
116
116
  ## Rake integration example
117
117
 
@@ -119,7 +119,7 @@ A generated `test.rb` file could be matched as follows:
119
119
 
120
120
  ```ruby
121
121
  Rake::TestTask.new do |t|
122
- t.pattern = 'test.rb'
122
+ t.pattern = "test.rb"
123
123
  end
124
124
  ```
125
125
 
@@ -140,7 +140,7 @@ The [gem](https://rubygems.org/gems/brutal) is available as open source under th
140
140
  <p>
141
141
  This project is sponsored by:<br />
142
142
  <a href="https://sashite.com/"><img
143
- src="https://github.com/fixrb/brutal/raw/master/img/sashite.png"
143
+ src="https://github.com/fixrb/brutal/raw/main/img/sashite.png"
144
144
  alt="Sashite" /></a>
145
145
  </p>
146
146
 
data/bin/brutal CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
  # frozen_string_literal: true
3
3
 
4
- require_relative File.join('..', 'lib', 'brutal')
4
+ require_relative File.join("..", "lib", "brutal")
5
5
 
6
6
  Brutal.generate!
data/lib/brutal.rb CHANGED
@@ -6,7 +6,7 @@
6
6
  file/write
7
7
  scaffold
8
8
  yaml
9
- ].each { |file_name| require_relative(File.join('brutal', file_name)) }
9
+ ].each { |file_name| require_relative(File.join("brutal", file_name)) }
10
10
 
11
11
  # The Brutal namespace.
12
12
  module Brutal
@@ -7,18 +7,18 @@ module Brutal
7
7
  class Configuration
8
8
  DEFAULT_ACTUALS = [].freeze
9
9
  DEFAULT_CONTEXTS = {}.freeze
10
- DEFAULT_HEAD = '# Brutal test suite'
11
- DEFAULT_SUBJECT = ''
10
+ DEFAULT_HEAD = "# Brutal test suite"
11
+ DEFAULT_SUBJECT = ""
12
12
 
13
13
  # Load the configuration parameters.
14
14
  #
15
15
  # @param params [Hash] Receive the 4 top-level section parameters.
16
16
  def self.load(params)
17
17
  new(
18
- actuals: params.fetch('actuals', DEFAULT_ACTUALS),
19
- contexts: params.fetch('contexts', DEFAULT_CONTEXTS),
20
- header: params.fetch('header', DEFAULT_HEAD),
21
- subject: params.fetch('subject', DEFAULT_SUBJECT)
18
+ actuals: params.fetch("actuals", DEFAULT_ACTUALS),
19
+ contexts: params.fetch("contexts", DEFAULT_CONTEXTS),
20
+ header: params.fetch("header", DEFAULT_HEAD),
21
+ subject: params.fetch("subject", DEFAULT_SUBJECT)
22
22
  )
23
23
  end
24
24
 
@@ -41,7 +41,7 @@ module Brutal
41
41
  raise ::TypeError, header.inspect unless header.is_a?(::String)
42
42
  raise ::TypeError, subject.inspect unless subject.is_a?(::String)
43
43
 
44
- @actuals = actuals
44
+ @actuals = actuals.sort
45
45
  @contexts = contexts
46
46
  @header = header
47
47
  @subject = subject
@@ -9,7 +9,7 @@ module Brutal
9
9
  #
10
10
  # @since 1.1.0
11
11
  class Read
12
- NAME = '.brutal.yml'
12
+ NAME = ".brutal.yml"
13
13
 
14
14
  attr_reader :name
15
15
 
@@ -9,7 +9,7 @@ module Brutal
9
9
  #
10
10
  # @since 1.1.0
11
11
  class Write
12
- NAME = 'test.rb'
12
+ NAME = "test.rb"
13
13
 
14
14
  attr_reader :name
15
15
 
@@ -18,7 +18,7 @@ module Brutal
18
18
  end
19
19
 
20
20
  def call(scaffold)
21
- file = ::File.open(path, 'w')
21
+ file = ::File.open(path, "w")
22
22
  file.write(scaffold)
23
23
 
24
24
  true
@@ -19,9 +19,9 @@ module Brutal
19
19
 
20
20
  # Initialize a new scaffold generator.
21
21
  def initialize(header, subject, *actuals, **contexts)
22
- warn('Empty subject!') if subject.empty?
23
- warn('Empty actual values!') if actuals.empty?
24
- warn('Empty contexts!') if contexts.empty?
22
+ warn("Empty subject!") if subject.empty?
23
+ warn("Empty actual values!") if actuals.empty?
24
+ warn("Empty contexts!") if contexts.empty?
25
25
 
26
26
  eval(header) # rubocop:disable Security/Eval
27
27
 
@@ -61,7 +61,7 @@ module Brutal
61
61
  actual = eval(actual_str) # rubocop:disable Security/Eval, Lint/UselessAssignment
62
62
 
63
63
  actuals.each do |actual_value|
64
- result_str = format(actual_value, subject: 'actual')
64
+ result_str = format(actual_value, subject: "actual")
65
65
  string += "raise if #{result_str} != #{eval(result_str).inspect}\n" # rubocop:disable Security/Eval
66
66
  end
67
67
 
@@ -71,8 +71,8 @@ module Brutal
71
71
  # rubocop:enable Metrics/AbcSize, Metrics/MethodLength
72
72
 
73
73
  def blank_line
74
- "\n" \
75
- "# #{('-' * 78)}\n" \
74
+ "\n" \
75
+ "# #{'-' * 78}\n" \
76
76
  "\n"
77
77
  end
78
78
 
data/lib/brutal/yaml.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'yaml'
3
+ require "yaml"
4
4
 
5
5
  module Brutal
6
6
  # Brutal::Yaml
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: brutal
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cyril Kato
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-09-08 00:00:00.000000000 Z
11
+ date: 2021-05-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -38,6 +38,20 @@ dependencies:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rubocop-md
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: rubocop-performance
43
57
  requirement: !ruby/object:Gem::Requirement
@@ -52,6 +66,20 @@ dependencies:
52
66
  - - ">="
53
67
  - !ruby/object:Gem::Version
54
68
  version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rubocop-rake
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
55
83
  - !ruby/object:Gem::Dependency
56
84
  name: rubocop-thread_safety
57
85
  requirement: !ruby/object:Gem::Requirement
@@ -129,7 +157,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
129
157
  - !ruby/object:Gem::Version
130
158
  version: '0'
131
159
  requirements: []
132
- rubygems_version: 3.1.2
160
+ rubygems_version: 3.1.4
133
161
  signing_key:
134
162
  specification_version: 4
135
163
  summary: A code-first approach to automate the writing of unit tests.