Skip to content

Support parameters with lazily-evaluated default values #6

Support parameters with lazily-evaluated default values

Support parameters with lazily-evaluated default values #6

GitHub Actions / Rspec Tests - 3.2 failed Oct 17, 2024 in 1s

16 passed, 2 failed and 0 skipped

Tests failed

❌ test_results/rspec.xml

18 tests were completed in 23ms with 16 passed, 2 failed and 0 skipped.

Test suite Passed Failed Skipped Time
rspec 16✅ 2❌ 23ms

❌ rspec

spec.unit.value_spec
  ✅ Value Value.new requires arguments
  ✅ Value Value.new requires members to be valid identifiers
  ✅ Value with a simple value can construct an instance with positional arguments
  ✅ Value with a simple value can construct an instance with keyword arguments
  ✅ Value with a simple value raises an error if unknown keyword arguments are provided
  ❌ Value with a simple value is immutable
	Failure/Error: expect { v.a = 10 }.to raise_error(RuntimeError, /can't modify frozen/)
  ❌ Value with a simple value can be mutated after duplicating
	Failure/Error: v.a = 10
  ✅ Value with a simple value can update values via .with
  ✅ Value with optional arguments can construct an instance with positional arguments
  ✅ Value with optional arguments can construct an instance with keyword arguments
  ✅ Value with optional arguments can update values via .with
  ✅ Value with optional arguments raises an error unless all required positional arguments are provided
  ✅ Value with optional arguments raises an error unless all required keyword arguments are provided
  ✅ Value with lazy defaults can construct an instance with positional lazy arguments
  ✅ Value with lazy defaults can construct an instance with keyword lazy arguments
  ✅ Value with a class body can override the constructor and call super
  ✅ Value with a class body can define methods
  ✅ Value with a class body only invokes the class body once

Annotations

Check failure on line 0 in test_results/rspec.xml

See this annotation in the file changed.

@github-actions github-actions / Rspec Tests - 3.2

rspec ► spec.unit.value_spec ► Value with a simple value is immutable

Failed test found in:
  test_results/rspec.xml
Error:
  Failure/Error: expect { v.a = 10 }.to raise_error(RuntimeError, /can't modify frozen/)
Raw output
Failure/Error: expect { v.a = 10 }.to raise_error(RuntimeError, /can't modify frozen/)

  expected RuntimeError with message matching /can't modify frozen/, got #<NoMethodError: undefined method `a=' for #<struct a=1, b=2>> with backtrace:
    # ./spec/unit/value_spec.rb:41:in `block (4 levels) in <top (required)>'
    # ./spec/unit/value_spec.rb:41:in `block (3 levels) in <top (required)>'
./spec/unit/value_spec.rb:41:in `block (3 levels) in <top (required)>'

Check failure on line 0 in test_results/rspec.xml

See this annotation in the file changed.

@github-actions github-actions / Rspec Tests - 3.2

rspec ► spec.unit.value_spec ► Value with a simple value can be mutated after duplicating

Failed test found in:
  test_results/rspec.xml
Error:
  Failure/Error: v.a = 10
Raw output
Failure/Error: v.a = 10

NoMethodError:
  undefined method `a=' for #<struct a=1, b=2>
./spec/unit/value_spec.rb:46:in `block (3 levels) in <top (required)>'