Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ build-iPhoneSimulator/
/.bundle/
/vendor/bundle
/lib/bundler/man/
vendor

# for a library or gem, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
Expand Down
6 changes: 3 additions & 3 deletions BmcApi/lib/pnap_bmc_api/models/quota_edit_limit_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def list_invalid_properties
invalid_properties.push('invalid value for "reason", reason cannot be nil.')
end

pattern = Regexp.new(/^(?s)(?!\s*$).+/)
pattern = Regexp.new(/^(?m)(?!\s*$).+/)
if @reason !~ pattern
invalid_properties.push("invalid value for \"reason\", must conform to the pattern #{pattern}.")
end
Expand All @@ -115,7 +115,7 @@ def valid?
return false if @limit.nil?
return false if @limit < 0
return false if @reason.nil?
return false if @reason !~ Regexp.new(/^(?s)(?!\s*$).+/)
return false if @reason !~ Regexp.new(/^(?m)(?!\s*$).+/)
true
end

Expand All @@ -140,7 +140,7 @@ def reason=(reason)
fail ArgumentError, 'reason cannot be nil'
end

pattern = Regexp.new(/^(?s)(?!\s*$).+/)
pattern = Regexp.new(/^(?m)(?!\s*$).+/)
if reason !~ pattern
fail ArgumentError, "invalid value for \"reason\", must conform to the pattern #{pattern}."
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def list_invalid_properties
invalid_properties.push('invalid value for "reason", reason cannot be nil.')
end

pattern = Regexp.new(/^(?s)(?!\s*$).+/)
pattern = Regexp.new(/^(?m)(?!\s*$).+/)
if @reason !~ pattern
invalid_properties.push("invalid value for \"reason\", must conform to the pattern #{pattern}.")
end
Expand All @@ -136,7 +136,7 @@ def valid?
return false if @limit.nil?
return false if @limit < 0
return false if @reason.nil?
return false if @reason !~ Regexp.new(/^(?s)(?!\s*$).+/)
return false if @reason !~ Regexp.new(/^(?m)(?!\s*$).+/)
return false if @requested_on.nil?
true
end
Expand All @@ -162,7 +162,7 @@ def reason=(reason)
fail ArgumentError, 'reason cannot be nil'
end

pattern = Regexp.new(/^(?s)(?!\s*$).+/)
pattern = Regexp.new(/^(?m)(?!\s*$).+/)
if reason !~ pattern
fail ArgumentError, "invalid value for \"reason\", must conform to the pattern #{pattern}."
end
Expand Down
11 changes: 10 additions & 1 deletion tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,13 @@ Tests can be run per-module by running its respective `tc_` script, or all at on

```sh
bundler exec ruby ./ts_sdk.rb
```
```

### NixOS
When using **NixOS** the above *will not work*, as it will not find the `libcurl.so.4` library.

First, get `bundix` - then run `nix-setup.sh`. One thing to note is that this script will *temporarily* modify the `Gemfile` to use **absolute paths** instead of relative ones.
It will then open a *nix shell* for you, at which point you can just do `bundler exec ruby ./ts_sdk.rb` to run all tests. Once you're done, run `exit` and the shell will close,
with the old `Gemfile` being restored.

If it *doesn't* get restored, just replace the `Gemfile` with `Gemfile.old`. Otherwise, the absolute paths can be manually changed into relative ones.
14 changes: 14 additions & 0 deletions tests/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
with (import <nixpkgs> {});
let
gems = bundlerEnv {
name = "your-package";
inherit ruby;
gemdir = ./.;
};
in
mkShell {
packages = [
gems
gems.wrappedRuby
];
}
Loading
Loading