Skip to content

Commit

Permalink
Merge pull request #13 from automation-wizards/master
Browse files Browse the repository at this point in the history
Refacotred Support for Symbols
  • Loading branch information
cheezy committed Oct 20, 2016
2 parents 6a39409 + d8c4688 commit 1d34e88
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
.bundle
.config
.yardoc
.idea
Gemfile.lock
InstalledFiles
_yardoc
Expand Down
1 change: 1 addition & 0 deletions config/yaml/test_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ first:
port: 1234
set_flag: true
cleared_flag: false
my_symbol: :hello_world
5 changes: 5 additions & 0 deletions features/fig_newton.feature
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ Feature: Functionality of the fig_newton gem
When I ask for the value for "cleared_flag"
Then I should see false

Scenario: Requesting a symbol value
Given I have read the configuration file
When I ask for the value for "my_symbol"
Then I should see :hello_world

Scenario: Requesting data from a node can be converted to a hash
Given I have read the configuration file
When I ask for the value for "database"
Expand Down
4 changes: 4 additions & 0 deletions features/step_definitions/fig_newton_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
expect(@value).to eql value.to_i
end

Then (/^I should see :([^\"]*)$/) do |value|
expect(@value).to eql value.to_sym
end

Then (/^I should see true$/) do
expect(@value).to be true
end
Expand Down
2 changes: 1 addition & 1 deletion lib/fig_newton/missing.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def read_file
private

def type_known?(value)
known_types = [String, Integer, TrueClass, FalseClass]
known_types = [String, Integer, TrueClass, FalseClass, Symbol]
known_types.any? { |type| value.kind_of? type }
end
end
Expand Down

0 comments on commit 1d34e88

Please sign in to comment.