esse-rspec 0.0.3 → 0.0.4

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: 97f5b2d2ce2ec86c915c41999b883834b103096c62977767ec45bc7ded85cb69
4
- data.tar.gz: 656757868411fa3bf601f10d42a39834d62abf3fe62604d98d2933fea9aea496
3
+ metadata.gz: edf7cd6ae62013f70d49d21f5e633f90b07cb4331b7f3573d1614d0e74e26ec2
4
+ data.tar.gz: df206c8c7f5c749dfda9ed95bf8b04ee7fdf04d215a356760a936a0069be3660
5
5
  SHA512:
6
- metadata.gz: 61273eb70c4bf06bcd678762824ddd8ff5d2f4f55cffa7c7bd0ff2830293abf0297df25b2fe05c38a78f54e8c5a417aa8eeda7cf9927434718b7baba88575bfe
7
- data.tar.gz: cd48e5edea52e6199a17e679ecd998fd8a40ecafd84f120e21b378021f851729f966a952ac73ad9d18c3970cbe66c43f3a5056ac2f1eab29f4761e96959bba92
6
+ metadata.gz: 320944994296eca28470899960df56a72aefea1ef1137e46ce8de30a519eeb505dc531103fdea416b8c67badb9a6843d12240a6dc337a1132797f33a075e356c
7
+ data.tar.gz: 2ab0182c6862f3e7745fadaf136be9f397dc2bda626c29fbff879830585d1e545dd28df4fd7be93eebdec23e934a216198ab36b988c610807ea77d2fedfdf8b0
data/CHANGELOG.md CHANGED
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
4
4
 
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## 0.0.4 - 2023-11-15
8
+ * The `cluster_id` argument of `stub_esse_search` is useless when the given index is a Esse::Index. Cluster id is now optional.
9
+
10
+
7
11
  ## 0.0.3 - 2023-11-15
8
12
  It should not automatically require `esse/rspec` anymore. You should require it manually in your `spec_helper.rb` file.
9
13
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- esse-rspec (0.0.3)
4
+ esse-rspec (0.0.4)
5
5
  esse (>= 0.2.4)
6
6
  rspec (>= 3)
7
7
 
@@ -17,8 +17,16 @@ module Esse
17
17
  stub_const(Esse::Hstring.new(name).camelize.to_s, klass)
18
18
  end
19
19
 
20
- def stub_esse_search(cluster_name, *indexes, **definition)
21
- cluster = Esse.cluster(cluster_name)
20
+ def stub_esse_search(*cluster_and_indexes, **definition)
21
+ cluster = if Esse.config.cluster_ids.include?(cluster_and_indexes.first)
22
+ Esse.cluster(cluster_and_indexes.shift)
23
+ elsif cluster_and_indexes.first.is_a?(Esse::Index)
24
+ cluster_and_indexes.first.cluster
25
+ else
26
+ Esse.cluster
27
+ end
28
+
29
+ indexes = cluster_and_indexes
22
30
  transport = cluster.api
23
31
  definition[:index] ||= Esse::Search::Query.normalize_indices(*indexes)
24
32
  response = yield
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Esse
4
4
  module RSpec
5
- VERSION = "0.0.3"
5
+ VERSION = "0.0.4"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: esse-rspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marcos G. Zimmermann