ProductPromotion
Logo

Ruby

made by https://0x3d.site

GitHub - fixrb/fix: Specing framework.
Specing framework. Contribute to fixrb/fix development by creating an account on GitHub.
Visit Site

GitHub - fixrb/fix: Specing framework.

GitHub - fixrb/fix: Specing framework.

Fix

Home Version Yard documentation Ruby RuboCop License

Fix specing framework for Ruby

Project Goals

  • Distinguish Specifications from Examples: Clear separation between what is expected (specifications) and how it's demonstrated (examples).
  • Logic-Free Specification Documents: Create specifications that are straightforward and free of complex logic, focusing purely on defining expected behaviors.
  • Nuanced Semantic Language in Specifications: Utilize a rich, nuanced semantic language, similar to that in RFC 2119, employing keywords like MUST, SHOULD, and MAY to define different levels of requirement in specifications.
  • Fast and Individual Test Execution: Enable quick execution of tests on an individual basis, providing immediate feedback on compliance with specifications.

Installation

Add to your Gemfile:

gem "fix", ">= 1.0.0.beta9"

Then execute:

bundle install

Or install it yourself:

gem install fix --pre

Example

Specifications for a Duck class:

# examples/duck/fix.rb

require "fix"

Fix :Duck do
  it SHOULD be_an_instance_of :Duck

  on :swims do
    it MUST be_an_instance_of :String
    it MUST eql "Swoosh..."
  end

  on :speaks do
    it MUST raise_exception NoMethodError
  end

  on :sings do
    it MAY eql "♪... ♫..."
  end
end

Implementing the Duck class:

# examples/duck/app.rb

class Duck
  def walks
    "Klop klop!"
  end

  def swims
    "Swoosh..."
  end

  def quacks
    puts "Quaaaaaack!"
  end
end

Running the test:

# examples/duck/test.rb

require_relative "app"
require_relative "fix"

Fix[:Duck].test { Duck.new }

Execute:

ruby examples/duck/test.rb

Expected output:

(irb):3 Success: expected #<Duck:0x00007fb2fa208708> to be an instance of Duck.
(irb):7 Success: expected to eq "Swoosh...".
(irb):15 NoMethodError: undefined method `sings' for #<Duck:0x00007fb2fd8371d0>.
(irb):6 Success: expected "Swoosh..." to be an instance of String.
(irb):11 Success: undefined method `speaks' for #<Duck:0x00007fb2fcc79258>.

Contact

Versioning

Fix follows Semantic Versioning 2.0.

License

The gem is available as open source under the terms of the MIT License.


More Resources
to explore the angular.

mail [email protected] to add your project or resources here 🔥.

Related Articles
to learn about angular.

FAQ's
to learn more about Angular JS.

mail [email protected] to add more queries here 🔍.

More Sites
to check out once you're finished browsing here.

0x3d
https://www.0x3d.site/
0x3d is designed for aggregating information.
NodeJS
https://nodejs.0x3d.site/
NodeJS Online Directory
Cross Platform
https://cross-platform.0x3d.site/
Cross Platform Online Directory
Open Source
https://open-source.0x3d.site/
Open Source Online Directory
Analytics
https://analytics.0x3d.site/
Analytics Online Directory
JavaScript
https://javascript.0x3d.site/
JavaScript Online Directory
GoLang
https://golang.0x3d.site/
GoLang Online Directory
Python
https://python.0x3d.site/
Python Online Directory
Swift
https://swift.0x3d.site/
Swift Online Directory
Rust
https://rust.0x3d.site/
Rust Online Directory
Scala
https://scala.0x3d.site/
Scala Online Directory
Ruby
https://ruby.0x3d.site/
Ruby Online Directory
Clojure
https://clojure.0x3d.site/
Clojure Online Directory
Elixir
https://elixir.0x3d.site/
Elixir Online Directory
Elm
https://elm.0x3d.site/
Elm Online Directory
Lua
https://lua.0x3d.site/
Lua Online Directory
C Programming
https://c-programming.0x3d.site/
C Programming Online Directory
C++ Programming
https://cpp-programming.0x3d.site/
C++ Programming Online Directory
R Programming
https://r-programming.0x3d.site/
R Programming Online Directory
Perl
https://perl.0x3d.site/
Perl Online Directory
Java
https://java.0x3d.site/
Java Online Directory
Kotlin
https://kotlin.0x3d.site/
Kotlin Online Directory
PHP
https://php.0x3d.site/
PHP Online Directory
React JS
https://react.0x3d.site/
React JS Online Directory
Angular
https://angular.0x3d.site/
Angular JS Online Directory