File: rspec_integration_test.rb

package info (click to toggle)
ruby-test-construct 2.0.2-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 188 kB
  • sloc: ruby: 762; makefile: 4
file content (24 lines) | stat: -rw-r--r-- 652 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
require 'test_helper'

class RspecIntegrationTest < Minitest::Test
  include TestConstruct::Helpers

  test 'rspec integration' do
    lib_path = File.realpath('lib')
    within_construct do |construct|
      spec_file_name = 'rspec_spec.rb'
      construct.file(spec_file_name, <<-RSPEC)
require 'test_construct/rspec_integration'

describe 'test_construct', test_construct: true do
  it 'accesses metadata' do |example|
    f = example.metadata[:construct].file "somefile", "abcd"
    expect(f.size).to eq 4
  end
end
      RSPEC
      output = `rspec -I '#{lib_path}' #{spec_file_name}`
      assert $CHILD_STATUS.success?, output
    end
  end
end