Skip to content

Commit

Permalink
Setup aruba and add rspec and cucumber tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Richard Bates committed Feb 22, 2018
1 parent f9c4790 commit 321ca4b
Show file tree
Hide file tree
Showing 7 changed files with 69 additions and 0 deletions.
33 changes: 33 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,19 @@ GEM
specs:
addressable (2.5.2)
public_suffix (>= 2.0.2, < 4.0)
aruba (0.14.3)
childprocess (~> 0.8.0)
contracts (~> 0.9)
cucumber (>= 1.3.19)
ffi (~> 1.9.10)
rspec-expectations (>= 2.99)
thor (~> 0.19)
ast (2.4.0)
backports (3.11.1)
builder (3.2.3)
childprocess (0.8.0)
ffi (~> 1.0, >= 1.0.11)
contracts (0.16.0)
coveralls (0.7.1)
multi_json (~> 1.3)
rest-client
Expand All @@ -20,10 +32,28 @@ GEM
thor
crack (0.4.3)
safe_yaml (~> 1.0.0)
cucumber (3.1.0)
builder (>= 2.1.2)
cucumber-core (~> 3.1.0)
cucumber-expressions (~> 5.0.4)
cucumber-wire (~> 0.0.1)
diff-lcs (~> 1.3)
gherkin (~> 5.0)
multi_json (>= 1.7.5, < 2.0)
multi_test (>= 0.1.2)
cucumber-core (3.1.0)
backports (>= 3.8.0)
cucumber-tag_expressions (~> 1.1.0)
gherkin (>= 5.0.0)
cucumber-expressions (5.0.13)
cucumber-tag_expressions (1.1.1)
cucumber-wire (0.0.1)
diff-lcs (1.3)
docile (1.1.5)
domain_name (0.5.20170404)
unf (>= 0.0.5, < 1.0.0)
ffi (1.9.21)
gherkin (5.0.0)
hashdiff (0.3.7)
http-cookie (1.0.3)
domain_name (~> 0.5)
Expand All @@ -34,6 +64,7 @@ GEM
mime-types-data (~> 3.2015)
mime-types-data (3.2016.0521)
multi_json (1.13.1)
multi_test (0.1.2)
multi_xml (0.6.0)
netrc (0.11.0)
parallel (1.12.0)
Expand Down Expand Up @@ -94,8 +125,10 @@ PLATFORMS
ruby

DEPENDENCIES
aruba (~> 0.14.2)
bundler (~> 1.16)
coveralls (~> 0.7.1)
cucumber (>= 3.0)
hodlmoon!
rake (~> 10.0)
rspec (~> 3.0)
Expand Down
9 changes: 9 additions & 0 deletions features/hello.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Feature: Hello

Scenario: With a name of Emilio
When I run `hodlmoon hello Emilio`
Then the output should contain "Hello Emilio"

Scenario: With no name
When I run `hodlmoon hello`
Then the output should contain "called with no arguments"
14 changes: 14 additions & 0 deletions features/price.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Feature: Price

Scenario: Price of ethereum
When I run `hodlmoon price`

Scenario: No currency provided
When I run `hodlmoon price ethereum`
Then the output should contain "Price gbp"
And the output should contain "Market cap gbp"

Scenario: Currency provided
When I run `hodlmoon price ethereum usd`
Then the output should contain "Price usd"
And the output should contain "Market cap usd"
1 change: 1 addition & 0 deletions features/support/setup.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
require 'aruba/cucumber'
2 changes: 2 additions & 0 deletions hodlmoon.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ Gem::Specification.new do |spec|
spec.add_dependency 'terminal-table', '~> 1.8.0'
spec.add_dependency 'thor', '~> 0.20.0'

spec.add_development_dependency 'aruba', '~> 0.14.2'
spec.add_development_dependency 'bundler', '~> 1.16'
spec.add_development_dependency 'coveralls', '~> 0.7.1'
spec.add_development_dependency 'cucumber', '>= 3.0'
spec.add_development_dependency 'rake', '~> 10.0'
spec.add_development_dependency 'rspec', '~> 3.0'
spec.add_development_dependency 'rubocop', '~> 0.52.1'
Expand Down
7 changes: 7 additions & 0 deletions spec/cli_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
RSpec.describe Hodlmoon::Cli do
subject(:cli) { described_class.new }

describe '#hello' do
it { expect { cli.hello('Emilio') }.to output("Hello Emilio\n").to_stdout }
end
end
3 changes: 3 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
require 'hodlmoon'
require 'webmock/rspec'
require 'vcr'
require 'aruba'

WebMock.disable_net_connect!(allow_localhost: true)

Expand All @@ -21,6 +22,8 @@
# Disable RSpec exposing methods globally on `Module` and `main`
config.disable_monkey_patching!

config.include Aruba::Api

config.expect_with :rspec do |c|
c.syntax = :expect
end
Expand Down

0 comments on commit 321ca4b

Please sign in to comment.