Glad to announce that XCFit is available to download from Homebrew package manager. XCFit a.k.a (XCUI, Cucumberish and Fitnesse Integrations Tests) is a full stack Xcode BDD framework for Swift iOS apps. XCFit creates automated Xcode templates which helps us to setup BDD style tests within Xcode. You can read more about XCFit on my previous post or articles published on DZone here .
Homebrew
Just in case, if you have not heard of Homebrew, it’s package manager fro macOS. We can install almost everything using Homebrew including macOS free apps. Homebrew can be installed on any macOS using a command.
1 |
$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" |
Now that, we are ready to use Homebrew. We can install package as core Homebrew or using HomeBrew caskroom like this
1 2 |
$ brew install <PACKAGE_NAME> $ brew cask install <PACKAGE_NAME> |
e.g We can install ‘Google Chrome” using following command.
1 |
$ brew cask install google-chrome |
Now , we will see how to install XCFit using Homebrew.
XCFit Installation Methods
As mentioned in the previous posts, XCFit has been installed using RubyGems. Actually, It’s very hard to maintaining the Ruby versions and Gem versions.
Using RubyGems – Current Method
XCFit is available on RubyGems, you can see it on Gem server here. We can install XcFit using system Ruby preinstalls on Mac.
1 |
$ sudo gem install xcfit |
Or If you are experienced Ruby user, you can use ‘Gemfile’ and Bundler to manage XCFit. Just add it your ‘Gemfile’
1 2 |
source 'http://rubygems.org' gem 'xcfit' |
At this stage, we can install bundle and start using xcfit.
1 2 |
$ bundle install $ bundle exec xcfit |
This will print all the commands available to XCFit.
Using HomeBrew – New/Recommended Method
It’s true that managing dependencies using RubyGems is very hard as Ruby versions are changing all the time. Also it’s learning curve for the new Ruby user. It will be quick to install XCFit using lightweight package manager like Homebrew. If you have already installed XCFit using Rubygems then uninstall it first to avoid any confusion.
1 |
$ gem uninstall xcfit |
Now XCFit can be installed using simple command without any hassle.
1 2 |
$ brew tap shashikant86/homebrew-taps $ brew install xcfit |
This will print all the available commands with XCFit.
Now that, you can have all XCFit commands available to use. The main command which setup BDD Style Xcode template is
1 |
$ xcfit setup_xcode_templates |
Enjoy XCFit with Homebrew !