<commit_before>require 'spec_helper'

module CommonSense
  describe SensorDataRelation do

    let(:relation) {
      relation = SensorDataRelation.new
      relation.stub("check_session!").and_return(true)
      relation.stub("get_data").and_return(sensors)
      relation
    }

    describe "build" do
      it "should return a sensorData object" do
        sensor_id = 1
        SensorDataRelation.new(sensor_id).build.should be_a_kind_of(SensorData)
      end
    end

    describe "get_data!" do
      it "should fetch the data point from commonSense" do
        sensor_id = 1
        session = double("Session")
        option = { page: 100, per_page: 99, start_date: 1365278885,
          end_date: 1365278886, last: 1, sort: 'ASC', interval: 300 }
        session.should_receive(:get).with("/sensors/#{sensor_id}/data.json", option)

        relation = SensorDataRelation.new(sensor_id, session)
        relation.get_data!(page:100, per_page: 99, start_date: 1365278885,
          end_date: 1365278886, last: true, sort: 'ASC', interval: 300)
      end
    end

    describe "get_data" do
       it "call get_data! and not throw exception" do

       end
    end

    describe "each" do
      it "should get all sensor data based on the criteria and yield" do

      end
    end

    describe "count" do
      it "should return the total number of sensor data match with criteria" do

      end
    end

    describe "first" do
      it "should return the first record" do

      end
    end

    describe "last" do
      it "should return the last record" do

      end
    end

    describe "where" do
      it "should update the query parameter" do

      end
    end

    describe "all" do
      it "return array of all matching sensor" do

      end
    end


  end
end<commit_msg>remove unecessary line<commit_after>require 'spec_helper'

module CommonSense
  describe SensorDataRelation do

    let(:relation) {
      relation = SensorDataRelation.new
      relation.stub("check_session!").and_return(true)
      relation.stub("get_data").and_return(sensors)
      relation
    }

    describe "build" do
      it "should return a sensorData object" do
        sensor_id = 1
        SensorDataRelation.new(sensor_id).build.should be_a_kind_of(SensorData)
      end
    end

    describe "get_data!" do
      it "should fetch the data point from commonSense" do
        sensor_id = 1
        session = double("Session")
        option = { page: 100, per_page: 99, start_date: 1365278885,
          end_date: 1365278886, last: 1, sort: 'ASC', interval: 300 }
        session.should_receive(:get).with("/sensors/#{sensor_id}/data.json", option)

        relation = SensorDataRelation.new(sensor_id, session)
        relation.get_data!(page:100, per_page: 99, start_date: 1365278885,
          end_date: 1365278886, last: true, sort: 'ASC', interval: 300)
      end
    end

    describe "get_data" do
       it "call get_data! and not throw exception" do

       end
    end

    describe "each" do
      it "should get all sensor data based on the criteria and yield" do

      end
    end

    describe "count" do
      it "should return the total number of sensor data match with criteria" do

      end
    end

    describe "first" do
      it "should return the first record" do

      end
    end

    describe "last" do
      it "should return the last record" do

      end
    end

    describe "where" do
      it "should update the query parameter" do

      end
    end

    describe "all" do
      it "return array of all matching sensor" do

      end
    end
  end
end
{'fraction_non_alphanumeric': 0.0778426466499861, 'fraction_numerical': 0.032805115373922715, 'mean_word_length': 2.403973509933775, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6079444', 'n_tokens_mistral': 1191, 'n_tokens_neox': 1060, 'n_words': 361}