From 87fd11a17b2f2c34b9df409f79143376c8026924 Mon Sep 17 00:00:00 2001 From: Isaac Lewis Date: Thu, 22 Mar 2018 14:19:55 -0700 Subject: [PATCH] reorg --- .rspec | 3 --- CODE_OF_CONDUCT.md | 2 +- LICENSE | 21 --------------------- README.md | 5 +---- Rakefile | 10 +++++++--- spec/spec_helper.rb | 14 -------------- spec/syspro_spec.rb | 116 -------------------------------------------------------------------------------------------------------------------- syspro.gemspec | 11 ++++------- test/syspro_test.rb | 11 +++++++++++ test/test_helper.rb | 4 ++++ 10 files changed, 28 insertions(+), 169 deletions(-) delete mode 100644 .rspec delete mode 100644 LICENSE delete mode 100644 spec/spec_helper.rb delete mode 100644 spec/syspro_spec.rb create mode 100644 test/syspro_test.rb create mode 100644 test/test_helper.rb diff --git a/.rspec b/.rspec deleted file mode 100644 index 34c5164..0000000 --- a/.rspec +++ /dev/null @@ -1,3 +0,0 @@ ---format documentation ---color ---require spec_helper diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 620452b..09770f4 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -55,7 +55,7 @@ further defined and clarified by project maintainers. ## Enforcement Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported by contacting the project team at isaac@ike.io. All +reported by contacting the project team at ike@wild.land. All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 157e38e..0000000 --- a/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2018 Isaac Lewis - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/README.md b/README.md index 831d55e..abfc591 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ TODO: Write usage instructions here ## Development -After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment. +After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment. To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org). @@ -41,6 +41,3 @@ The gem is available as open source under the terms of the [MIT License](https:/ ## Code of Conduct Everyone interacting in the Syspro project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/syspro/blob/master/CODE_OF_CONDUCT.md). - -# syspro -Syspro Rails adapter diff --git a/Rakefile b/Rakefile index b7e9ed5..d433a1e 100644 --- a/Rakefile +++ b/Rakefile @@ -1,6 +1,10 @@ require "bundler/gem_tasks" -require "rspec/core/rake_task" +require "rake/testtask" -RSpec::Core::RakeTask.new(:spec) +Rake::TestTask.new(:test) do |t| + t.libs << "test" + t.libs << "lib" + t.test_files = FileList["test/**/*_test.rb"] +end -task :default => :spec +task :default => :test diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb deleted file mode 100644 index 089555a..0000000 --- a/spec/spec_helper.rb +++ /dev/null @@ -1,14 +0,0 @@ -require "bundler/setup" -require "syspro" - -RSpec.configure do |config| - # Enable flags like --only-failures and --next-failure - config.example_status_persistence_file_path = ".rspec_status" - - # Disable RSpec exposing methods globally on `Module` and `main` - config.disable_monkey_patching! - - config.expect_with :rspec do |c| - c.syntax = :expect - end -end diff --git a/spec/syspro_spec.rb b/spec/syspro_spec.rb deleted file mode 100644 index 1b186ed..0000000 --- a/spec/syspro_spec.rb +++ /dev/null @@ -1,116 +0,0 @@ -RSpec.describe Syspro do - server_name = "dev3" - - Rspec.describe PrimitiveClient do - base_url = "http://#{server_name}/SYSPROWCFService" - binding = "RESTHttp" - - it "has a version number" do - expect(Syspro::VERSION).not_to be nil - end - - it "does something useful" do - expect(false).to eq(true) - end - - it "can be instantiated" do - expect { - sys = Syspro::PrimitiveClient.new(base_url, binding) - }.not_to raise_error - end - - it "can login to a syspro database" do - sys = Syspro::PrimitiveClient.new(base_url, binding) - login_reply = sys.login(operator_name, password, company_id, company_password) - - expect(login_reply).to eq(login_reply_example) - end - - it "can logoff from a syspro database" do - sys = Syspro::PrimitiveClient.new(base_url, binding) - logoff_reply = sys.logoff(user_id) - - expect(logoff_reply).to eq(logoff_reply_example) - end - - Rspec.describe Query do - sys = Syspro::PrimitiveClient.new(base_url, binding) - - it "can query browse" do - query_result = sys.query_browse(user_id, query_object) - - expect(query_result).to eq(query_result_example) - end - - it "can query fetch" do - query_result = sys.query_fetch(user_id, query_object) - - expect(query_result).to eq(query_result_example) - end - - it "can query query" do - query_result = sys.query_query(user_id, business_object, query_object) - - expect(query_result).to eq(query_result_example) - end - end - - Rspec.describe Setup do - sys = Syspro::PrimitiveClient.new(base_url, binding) - - it "can add" do - setup_result = sys.setup_add(user_id, business_object, params, query_object) - - expect(setup_result).to eq(setup_result_example) - end - - it "can delete" do - setup_result = sys.setup_delete(user_id, business_object, params, query_object) - - expect(setup_result).to eq(setup_result_example) - end - - it "can update" do - setup_result = sys.setup_update(user_id, business_object, params, query_object) - - expect(setup_result).to eq(setup_result_example) - end - end - - Rspec.describe Transaction do - sys = Syspro::PrimitiveClient.new(base_url, binding) - - it "can build" do - expect(sys.transaction_build(user_id, business_object, query_object)).to eq(transaction_result_example) - end - - it "can post" do - expect(sys.transaction_post(user_id, business_object, query_object)).to eq(transaction_result_example) - end - end - - Rspec.describe Asynchronous do - # TODO: Describe asynchronous versions of above methods - end - - end # Primitive - - Rpec.describe Client do - base_url = "http://#{server_name}/SYSPROWCFService" - binding = "RESTHttp" - - Rspec.describe Utilities do - - end - - Rspec.describe Query do - end - - Rspec.describe Setup do - end - - Rspec.describe Transaction do - end - end # Client -end - diff --git a/syspro.gemspec b/syspro.gemspec index 3024f07..3aa441e 100644 --- a/syspro.gemspec +++ b/syspro.gemspec @@ -1,4 +1,3 @@ - lib = File.expand_path("../lib", __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require "syspro/version" @@ -7,17 +6,15 @@ Gem::Specification.new do |spec| spec.name = "syspro" spec.version = Syspro::VERSION spec.authors = ["Isaac Lewis"] - spec.email = ["isaac@ike.io"] + spec.email = ["ike@wild.land"] - spec.summary = %q{TODO: Write a short summary, because RubyGems requires one.} - spec.description = %q{TODO: Write a longer description or delete this line.} - spec.homepage = "TODO: Put your gem's website or public repo URL here." + spec.summary = %q{Connection library for SYSPRO 7 API} spec.license = "MIT" # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host' # to allow pushing to a single host or delete this section to allow pushing to any host. if spec.respond_to?(:metadata) - spec.metadata["allowed_push_host"] = "TODO: Set to 'http://mygemserver.com'" + spec.metadata["allowed_push_host"] = "http://rubygems.org" else raise "RubyGems 2.0 or newer is required to protect against " \ "public gem pushes." @@ -32,5 +29,5 @@ Gem::Specification.new do |spec| spec.add_development_dependency "bundler", "~> 1.16" spec.add_development_dependency "rake", "~> 10.0" - spec.add_development_dependency "rspec", "~> 3.0" + spec.add_development_dependency "minitest", "~> 5.0" end diff --git a/test/syspro_test.rb b/test/syspro_test.rb new file mode 100644 index 0000000..59a5410 --- /dev/null +++ b/test/syspro_test.rb @@ -0,0 +1,11 @@ +require "test_helper" + +class SysproTest < Minitest::Test + def test_that_it_has_a_version_number + refute_nil ::Syspro::VERSION + end + + def test_it_does_something_useful + assert false + end +end diff --git a/test/test_helper.rb b/test/test_helper.rb new file mode 100644 index 0000000..fef5973 --- /dev/null +++ b/test/test_helper.rb @@ -0,0 +1,4 @@ +$LOAD_PATH.unshift File.expand_path("../../lib", __FILE__) +require "syspro" + +require "minitest/autorun" -- libgit2 0.21.4