Skip to content

Commit

Permalink
Fix README
Browse files Browse the repository at this point in the history
  • Loading branch information
psousa50 committed Oct 20, 2023
1 parent 58e6161 commit c7fe019
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ You can test models independently by mocking their dependencies (models, sources
- [Main Features](#main-features)
- [Documentation](#documentation)
- [Anatomy of a test](#anatomy-of-a-test)
- [Running Tests](#running-tests)
- [Available Macros](#available-macros)
- [Test Examples](#test-examples)
- [Different ways to build mock values](#different-ways-to-build-mock-values)
Expand Down
3 changes: 3 additions & 0 deletions integration-tests/models/model_ephemeral.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{{ config (materialized = 'incremental' ) }}

select 1 as a, 'b' as b
1 change: 1 addition & 0 deletions integration-tests/models/model_references_ephemeral.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
select * from {{ dbt_unit_testing.ref('model_ephemeral') }} where a >= 1
16 changes: 16 additions & 0 deletions integration-tests/tests/unit/model_references_ephemeral.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{{
config(
tags=['unit-test', 'bigquery', 'snowflake', 'postgres']
)
}}

{% call dbt_unit_testing.test('model_ephemeral', 'sample test') %}
{% call dbt_unit_testing.mock_ref ('model_a') %}
select 0 as a, 'a' as b
UNION ALL
select 1 as a, 'b' as b
{% endcall %}
{% call dbt_unit_testing.expect() %}
select 1 as a, 'b' as b
{% endcall %}
{% endcall %}
1 change: 1 addition & 0 deletions macros/utils.sql
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
{% endmacro %}

{% macro extract_columns_difference(cl1, cl2) %}
!! WRONG !!
{% set columns = cl1 | reject('in', cl2) | list %}
{{ return(columns) }}
{% endmacro %}
Expand Down

0 comments on commit c7fe019

Please sign in to comment.