spec/data_depository_spec.rb
# Fill the database with example repositories for testing
#   Also initilizes the tables, which would usually be done
#   by DataDepository
Fill the database with example repositories for testing
Also initilizes the tables, which would usually be done
by DataDepository
Fill the database with example repositories for testing Also initilizes the tables which would usually be done by DataDepository
def init_example_db
    database.create_table :repos do
      primary_key :id
      String :name
      foreign_id :token_id
    end
    r = database[:repos]
    r.insert(:name => "josefwaller/pycatan")
    r.insert(:name => "josefwaller/github_dash")
    r.insert(:name => "rails/rails")
    database.create_table :tokens do
      primary_key :id
      String :token
      String :name
    end
    t = database[:tokens]
    ENV['GITHUB_DASH_TOKEN'] ||= "ThisIsAnExampleGithubApiKey"
    t.insert(:token => ENV['GITHUB_DASH_TOKEN'])
  end
def init_example_db database . create_table :repos do primary_key :id String :name foreign_id :token_id end r = database [ :repos ] r . insert ( :name => "josefwaller/pycatan" ) r . insert ( :name => "josefwaller/github_dash" ) r . insert ( :name => "rails/rails" ) database . create_table :tokens do primary_key :id String :token String :name end t = database [ :tokens ] ENV [ 'GITHUB_DASH_TOKEN' ] ||= "ThisIsAnExampleGithubApiKey" t . insert ( :token => ENV [ 'GITHUB_DASH_TOKEN' ] ) end
Fill the database with example repositories for testing
Also initilizes the tables, which would usually be done
by DataDepository
Fill the database with example repositories for testing Also initilizes the tables which would usually be done by DataDepository
# Create repos table # Add example repositories # Create tokens table # Add example token