Skip to content

Commit 9ed8e57

Browse files
committed
sdk parity
1 parent c9d222d commit 9ed8e57

File tree

8 files changed

+546
-168
lines changed

8 files changed

+546
-168
lines changed

README.md

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ This SDK is compatible with [Featurevisor](https://featurevisor.com/) v2.0 proje
4141
- [Close](#close)
4242
- [CLI usage](#cli-usage)
4343
- [Test](#test)
44+
- [Test against example-1](#test-against-example-1)
4445
- [Benchmark](#benchmark)
4546
- [Assess distribution](#assess-distribution)
4647
- [Development](#development)
@@ -383,7 +384,7 @@ require 'json'
383384
def update_datafile(f, datafile_url)
384385
loop do
385386
sleep(5 * 60) # 5 minutes
386-
387+
387388
begin
388389
response = Net::HTTP.get_response(URI(datafile_url))
389390
datafile_content = JSON.parse(response.body)
@@ -683,10 +684,24 @@ Additional options that are available:
683684
```bash
684685
$ bundle exec featurevisor test \
685686
--projectDirectoryPath="/absolute/path/to/your/featurevisor/project" \
686-
--quiet|verbose \
687+
--quiet|--verbose \
687688
--onlyFailures \
688689
--keyPattern="myFeatureKey" \
689-
--assertionPattern="#1"
690+
--assertionPattern="#1" \
691+
--with-scopes \
692+
--with-tags
693+
```
694+
695+
`--with-scopes` and `--with-tags` make the Ruby test runner build scoped/tagged datafiles in memory (via `npx featurevisor build --json`) and evaluate matching assertions against those exact datafiles.
696+
697+
For compatibility, camelCase aliases are also supported: `--withScopes` and `--withTags`.
698+
699+
### Test against example-1
700+
701+
```bash
702+
$ cd /absolute/path/to/featurevisor-ruby
703+
$ bundle exec featurevisor test --projectDirectoryPath=/path/to/featurevisor/project
704+
$ bundle exec featurevisor test --projectDirectoryPath=/path/to/featurevisor/project --with-scopes
690705
```
691706

692707
### Benchmark

bin/cli.rb

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ class Options
77
attr_accessor :command, :assertion_pattern, :context, :environment, :feature,
88
:key_pattern, :n, :only_failures, :quiet, :variable, :variation,
99
:verbose, :inflate, :show_datafile, :schema_version, :project_directory_path,
10-
:populate_uuid
10+
:populate_uuid, :with_scopes, :with_tags
1111

1212
def initialize
1313
@n = 1000
@@ -86,6 +86,14 @@ def self.parse(args)
8686
options.schema_version = v
8787
end
8888

89+
opts.on("--with-scopes", "--withScopes", "Test scoped assertions against scoped datafiles") do
90+
options.with_scopes = true
91+
end
92+
93+
opts.on("--with-tags", "--withTags", "Test tagged assertions against tagged datafiles") do
94+
options.with_tags = true
95+
end
96+
8997
opts.on("--projectDirectoryPath=PATH", "Project directory path") do |v|
9098
options.project_directory_path = v
9199
end

0 commit comments

Comments
 (0)