-
-
Notifications
You must be signed in to change notification settings - Fork 350
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a temporary backwards compatibility module for ::Ruby::OpenAI. Th…
…is commit can be removed when backwards compatibility is no longer needed.
- Loading branch information
1 parent
8572b69
commit 3eb5ce2
Showing
5 changed files
with
51 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
module Ruby | ||
module OpenAI | ||
VERSION = ::OpenAI::VERSION | ||
|
||
Error = ::OpenAI::Error | ||
ConfigurationError = ::OpenAI::ConfigurationError | ||
Configuration = ::OpenAI::Configuration | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
require_relative "../openai" | ||
require_relative "../openai/compatibility" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
RSpec.describe "compatibility" do | ||
context "for moved constants" do | ||
describe "::Ruby::OpenAI::VERSION" do | ||
it "is mapped to ::OpenAI::VERSION" do | ||
expect(::Ruby::OpenAI::VERSION).to eq(::OpenAI::VERSION) | ||
end | ||
end | ||
|
||
describe "::Ruby::OpenAI::Error" do | ||
it "is mapped to ::OpenAI::Error" do | ||
expect(::Ruby::OpenAI::Error).to eq(::OpenAI::Error) | ||
expect(::Ruby::OpenAI::Error.new).to be_a(::OpenAI::Error) | ||
expect(::OpenAI::Error.new).to be_a(::Ruby::OpenAI::Error) | ||
end | ||
end | ||
|
||
describe "::Ruby::OpenAI::ConfigurationError" do | ||
it "is mapped to ::OpenAI::ConfigurationError" do | ||
expect(::Ruby::OpenAI::ConfigurationError).to eq(::OpenAI::ConfigurationError) | ||
expect(::Ruby::OpenAI::ConfigurationError.new).to be_a(::OpenAI::ConfigurationError) | ||
expect(::OpenAI::ConfigurationError.new).to be_a(::Ruby::OpenAI::ConfigurationError) | ||
end | ||
end | ||
|
||
describe "::Ruby::OpenAI::Configuration" do | ||
it "is mapped to ::OpenAI::Configuration" do | ||
expect(::Ruby::OpenAI::Configuration).to eq(::OpenAI::Configuration) | ||
expect(::Ruby::OpenAI::Configuration.new).to be_a(::OpenAI::Configuration) | ||
expect(::OpenAI::Configuration.new).to be_a(::Ruby::OpenAI::Configuration) | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters