ammeter 1.1.5 → 1.1.6

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: 15c215e3ca3e6612c3a575d4867460591978e772edc6b25af049887adcab428f
4
- data.tar.gz: 94c066d9357c99d88fb78ea07ddc4a0387248bd5eafc8992d49b81a5bc5fa007
3
+ metadata.gz: 45a625241c915188a70b534c263a9c38bfb1c0315aedf7d7a31fd27aaec8407f
4
+ data.tar.gz: 80c902df52f5b7b68af80f680dbc0273c5b42b819d0a19f7de2065ddc3d556e3
5
5
  SHA512:
6
- metadata.gz: 490b1a299c1916d6e42fb88409ba9c65e8343c6b9696dcbf686b81a08054a5a042737ee993c163f9802c0ea513735238e8deb032af72a7be35b646d138399043
7
- data.tar.gz: 3aefd4e01fb7e0fd75caefd5ed5b4b70d531176e83221d881fb088f42f7bfc787221527b6f0cab9e7c31ece610bf7fa75d023c7fb5f10f7f7aaeb3d8cd3b070a
6
+ metadata.gz: 3ce7d82c75dedff9639409713b630ce6ea8e04c11a75536bd2ef4f5200a9901cc111510d643b316b51da78b83f3cf1729ec5a85d296ff755ea9256e2caca8145
7
+ data.tar.gz: a99410d8eddd86ca0732099a108a9fdcad91674b72e93e7f93d67a8dc6464cde8eb93f860514edaad65c43281304b3c05d8eb9b8035b892bc42f8cb96b0cd704
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.5.8
1
+ 3.2.2
data/History.md CHANGED
@@ -1,5 +1,11 @@
1
1
  ## Ammeter release history
2
2
 
3
+ ### 1.1.6 / 2023-11-29
4
+
5
+ [full changelog](https://github.com/alexrothenberg/ammeter/compare/v1.1.5...v1.1.6)
6
+
7
+ * Deprecate the custom exist matcher (#68)
8
+
3
9
  ### 1.0.0 / 2014-04-07
4
10
 
5
11
  [full changelog](https://github.com/alexrothenberg/ammeter/compare/v0.2.9...v1.0.0)
data/README.md CHANGED
@@ -71,8 +71,6 @@ describe Rspec::Generators::ModelGenerator, :type => :generator do
71
71
  describe 'the spec' do
72
72
  # file - gives you the absolute path where the generator will create the file
73
73
  subject { file('spec/models/posts_spec.rb') }
74
- # is_expected_to exist - verifies the file exists
75
- it { is_expected_to exist }
76
74
 
77
75
  # is_expected_to contain - verifies the file's contents
78
76
  it { is_expected_to contain /require 'spec_helper'/ }
@@ -82,7 +80,7 @@ describe Rspec::Generators::ModelGenerator, :type => :generator do
82
80
  subject { migration_file('db/migrate/create_posts.rb') }
83
81
 
84
82
  # is_expected_to be_a_migration - verifies the file exists with a migration timestamp as part of the filename
85
- it { is_expected_to exist }
83
+ it { is_expected_to be_a_migration }
86
84
  it { is_expected_to contain /create_table/ }
87
85
  end
88
86
  end
@@ -91,7 +89,6 @@ end
91
89
 
92
90
  # Available matchers
93
91
 
94
- - `exist` - verifies the file exists
95
92
  - `contain` - verifies the file's contents
96
93
  - `be_a_migration` - verifies the file exists with a migration timestamp as part of the filename
97
94
  - `have_method` - verifies the file (or a class withing it) implements a method
@@ -1,5 +1,11 @@
1
- RSpec::Matchers.define :exist do
1
+ # DEPRECATED: use `expect(Pathname.new(path)).to exist` instead
2
+ RSpec::Matchers.define :exist do |*expected|
2
3
  match do |file_path|
3
- File.exist?(file_path)
4
+ if !(file_path.respond_to?(:exist?) || file_path.respond_to?(:exists?))
5
+ ActiveSupport::Deprecation.warn "The `exist` matcher overrides one built-in by RSpec; use `expect(Pathname.new(path)).to exist` instead"
6
+ File.exist?(file_path)
7
+ else
8
+ RSpec::Matchers::BuiltIn::Exist.new(*expected).matches?(file_path)
9
+ end
4
10
  end
5
11
  end
@@ -1,3 +1,3 @@
1
1
  module Ammeter
2
- VERSION = "1.1.5"
2
+ VERSION = "1.1.6"
3
3
  end
@@ -5,9 +5,17 @@ describe "exist" do
5
5
  allow(File).to receive(:exist?).with('/some/file/path').and_return(true)
6
6
  expect('/some/file/path').to exist
7
7
  end
8
+
8
9
  it 'fails when the file does not exist' do
9
10
  allow(File).to receive(:exist?).with('/some/file/path').and_return(false)
10
11
  expect('/some/file/path').to_not exist
11
12
  end
12
13
 
14
+ it 'maintains default RSpec behavior', :aggregate_failures do
15
+ path = Pathname.new('/some/file/path')
16
+ allow(path).to receive(:exist?).and_return(true)
17
+ expect(path).to exist
18
+ allow(path).to receive(:exist?).and_return(false)
19
+ expect(path).not_to exist
20
+ end
13
21
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ammeter
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.5
4
+ version: 1.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Rothenberg
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-02-24 00:00:00.000000000 Z
11
+ date: 2023-11-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
@@ -283,8 +283,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
283
283
  - !ruby/object:Gem::Version
284
284
  version: '0'
285
285
  requirements: []
286
- rubyforge_project:
287
- rubygems_version: 2.7.6.2
286
+ rubygems_version: 3.4.10
288
287
  signing_key:
289
288
  specification_version: 4
290
289
  summary: Write specs for your Rails 3+ generators