Paul: Check-in [6aece84c55]

Online event coordination and survey application

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Add first bits of test infrastructure
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256:6aece84c55f4a4cbb38717f18a98404f4623bd7ae2a9ea0395f40e1e92d8e468
User & Date: milouse 2018-11-15 22:41:08
Context
2018-11-16
16:09
Upgrade webpack check-in: a47ba8e108 user: milouse tags: trunk
2018-11-15
22:41
Add first bits of test infrastructure check-in: 6aece84c55 user: milouse tags: trunk
22:40
Forgot the config singleton in the last commit 🤦 check-in: 9add5281a0 user: milouse tags: trunk
Changes

Changes to Gemfile.

7
8
9
10
11
12
13
14

15
16
gem 'rake', '~> 12.0'
gem 'sinatra', '~> 2.0'
gem 'slim', '~> 3.0'
gem 'sqlite3', '~> 1.3'
gem 'thin', '~> 1.7'

group :development do
  gem 'rspec'

  gem 'rubocop'
end







|
>


7
8
9
10
11
12
13
14
15
16
17
gem 'rake', '~> 12.0'
gem 'sinatra', '~> 2.0'
gem 'slim', '~> 3.0'
gem 'sqlite3', '~> 1.3'
gem 'thin', '~> 1.7'

group :development do
  gem 'rspec-core'
  gem 'rspec-expectations'
  gem 'rubocop'
end

Changes to Gemfile.lock.

16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
..
62
63
64
65
66
67
68
69

70
71
72
73
74
75
76
77
    powerpack (0.1.2)
    rack (2.0.5)
    rack-protection (2.0.4)
      rack
    rainbow (2.2.2)
      rake
    rake (12.3.1)
    rspec (3.8.0)
      rspec-core (~> 3.8.0)
      rspec-expectations (~> 3.8.0)
      rspec-mocks (~> 3.8.0)
    rspec-core (3.8.0)
      rspec-support (~> 3.8.0)
    rspec-expectations (3.8.2)
      diff-lcs (>= 1.2.0, < 2.0)
      rspec-support (~> 3.8.0)
    rspec-mocks (3.8.0)
      diff-lcs (>= 1.2.0, < 2.0)
      rspec-support (~> 3.8.0)
    rspec-support (3.8.0)
    rubocop (0.59.2)
      jaro_winkler (~> 1.5.1)
      parallel (~> 1.10)
      parser (>= 2.5, != 2.5.1.1)
................................................................................
PLATFORMS
  ruby

DEPENDENCIES
  mail (~> 2.7)
  rainbow (~> 2.2)
  rake (~> 12.0)
  rspec

  rubocop
  sinatra (~> 2.0)
  slim (~> 3.0)
  sqlite3 (~> 1.3)
  thin (~> 1.7)

BUNDLED WITH
   1.16.6







<
<
<
<



<
<
<







 







|
>








16
17
18
19
20
21
22




23
24
25



26
27
28
29
30
31
32
..
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
    powerpack (0.1.2)
    rack (2.0.5)
    rack-protection (2.0.4)
      rack
    rainbow (2.2.2)
      rake
    rake (12.3.1)




    rspec-core (3.8.0)
      rspec-support (~> 3.8.0)
    rspec-expectations (3.8.2)



      diff-lcs (>= 1.2.0, < 2.0)
      rspec-support (~> 3.8.0)
    rspec-support (3.8.0)
    rubocop (0.59.2)
      jaro_winkler (~> 1.5.1)
      parallel (~> 1.10)
      parser (>= 2.5, != 2.5.1.1)
................................................................................
PLATFORMS
  ruby

DEPENDENCIES
  mail (~> 2.7)
  rainbow (~> 2.2)
  rake (~> 12.0)
  rspec-core
  rspec-expectations
  rubocop
  sinatra (~> 2.0)
  slim (~> 3.0)
  sqlite3 (~> 1.3)
  thin (~> 1.7)

BUNDLED WITH
   1.16.6

Added spec/spec_helper.rb.























































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# frozen_string_literal: true

# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
RSpec.configure do |config|
  # rspec-expectations config goes here. You can use an alternate
  # assertion/expectation library such as wrong or the stdlib/minitest
  # assertions if you prefer.
  config.expect_with :rspec do |expectations|
    # This option will default to `true` in RSpec 4. It makes the `description`
    # and `failure_message` of custom matchers include text for helper methods
    # defined using `chain`, e.g.:
    #     be_bigger_than(2).and_smaller_than(4).description
    #     # => "be bigger than 2 and smaller than 4"
    # ...rather than:
    #     # => "be bigger than 2"
    expectations.include_chain_clauses_in_custom_matcher_descriptions = true
  end

  # rspec-mocks config goes here. You can use an alternate test double
  # library (such as bogus or mocha) by changing the `mock_with` option here.
  config.mock_with :rspec do |mocks|
    # Prevents you from mocking or stubbing a method that does not exist on
    # a real object. This is generally recommended, and will default to
    # `true` in RSpec 4.
    mocks.verify_partial_doubles = true
  end
end

Added spec/survey_spec.rb.































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# frozen_string_literal: true

require './lib/survey'

RSpec.describe Survey, '#save' do
  context 'with no id given' do
    it 'should save a new survey' do
      opts = {
        'title' => 'My new survey'
      }
      s = Survey.new opts
      expect(s.id).to_not be_nil
    end
  end
end