Skip to content

Commit

Permalink
test: use real column object
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Feb 3, 2017
1 parent e5c7e87 commit fb5378d
Showing 1 changed file with 20 additions and 5 deletions.
25 changes: 20 additions & 5 deletions test/unit/test_record.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,16 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

class TestRecord < Test::Unit::TestCase
Column = Groonga::Client::Response::Schema::Column

sub_test_case("ActiveModel") do
class EmptyModel < GroongaClientModel::Record
class << self
def columns
GroongaClientModel::Schema::Columns.new(nil, "_id" => {})
raw_columns = {
"_id" => Column.new(nil, {}),
}
GroongaClientModel::Schema::Columns.new(nil, raw_columns)
end
end
end
Expand Down Expand Up @@ -55,17 +60,27 @@ def columns
class NoKey < GroongaClientModel::Record
class << self
def columns
GroongaClientModel::Schema::Columns.new(nil, "_id" => {})
raw_columns = {
"_id" => Column.new(nil, {}),
}
GroongaClientModel::Schema::Columns.new(nil, raw_columns)
end
end
end

class HaveKey < GroongaClientModel::Record
class << self
def columns
GroongaClientModel::Schema::Columns.new(nil,
"_id" => {},
"_key" => {})
raw_columns = {
"_id" => Column.new(nil, {}),
"_key" => Column.new(nil, {
"name" => "_key",
"value_type" => {
"name" => "ShortText",
},
}),
}
GroongaClientModel::Schema::Columns.new(nil, raw_columns)
end
end
end
Expand Down

0 comments on commit fb5378d

Please sign in to comment.