Skip to content

Commit

Permalink
Fix typos
Browse files Browse the repository at this point in the history
  • Loading branch information
hiemanshu committed Nov 25, 2024
1 parent d504b40 commit 1666aed
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions lib/scenic/adapters/postgres.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module Scenic
module Adapters
# An adapter for managing Postgres views.
#
# These methods are used interally by Scenic and are not intended for direct
# These methods are used internally by Scenic and are not intended for direct
# use. Methods that alter database schema are intended to be called via
# {Statements}, while {#refresh_materialized_view} is called via
# {Scenic.database}.
Expand Down Expand Up @@ -188,7 +188,7 @@ def drop_materialized_view(name)
# This is typically called from application code via {Scenic.database}.
#
# @param name The name of the materialized view to refresh.
# @param concurrently [Boolean] Whether the refreshs hould happen
# @param concurrently [Boolean] Whether the refresh should happen
# concurrently or not. A concurrent refresh allows the view to be
# refreshed without locking the view for select but requires that the
# table have at least one unique index that covers all rows. Attempts to
Expand Down
16 changes: 8 additions & 8 deletions spec/scenic/statements_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ module Scenic
end

it "creates a view from a text definition" do
sql_definition = "a defintion"
sql_definition = "a definition"

connection.create_view(:views, sql_definition: sql_definition)

expect(Scenic.database).to have_received(:create_view)
.with(:views, sql_definition)
end

it "creates version 1 of the view if neither version nor sql_defintion are provided" do
it "creates version 1 of the view if neither version nor sql_definition are provided" do
version = 1
definition_stub = instance_double("Definition", to_sql: "foo")
allow(Definition).to receive(:new)
Expand All @@ -43,9 +43,9 @@ module Scenic
.with(:views, definition_stub.to_sql)
end

it "raises an error if both version and sql_defintion are provided" do
it "raises an error if both version and sql_definition are provided" do
expect do
connection.create_view :foo, version: 1, sql_definition: "a defintion"
connection.create_view :foo, version: 1, sql_definition: "a definition"
end.to raise_error ArgumentError
end
end
Expand Down Expand Up @@ -108,7 +108,7 @@ module Scenic
end

it "updates a view from a text definition" do
sql_definition = "a defintion"
sql_definition = "a definition"

connection.update_view(:name, sql_definition: sql_definition)

Expand Down Expand Up @@ -144,19 +144,19 @@ module Scenic
.with(:name, definition.to_sql, no_data: true)
end

it "raises an error if not supplied a version or sql_defintion" do
it "raises an error if not supplied a version or sql_definition" do
expect { connection.update_view :views }.to raise_error(
ArgumentError,
/sql_definition or version must be specified/
)
end

it "raises an error if both version and sql_defintion are provided" do
it "raises an error if both version and sql_definition are provided" do
expect do
connection.update_view(
:views,
version: 1,
sql_definition: "a defintion"
sql_definition: "a definition"
)
end.to raise_error ArgumentError, /cannot both be set/
end
Expand Down

0 comments on commit 1666aed

Please sign in to comment.